org.apache.beehive.controls.runtime.generator.apt
Class ControlClientManifest

Object
  extended by ControlClientManifest

public class ControlClientManifest
extends Object

The controls client manifest (aka "client manifest") surfaces the set of control types used by a client, and make the assembly process more efficient. The control client annotation processor generates a client manifest documenting the set of used control types. This manifest is a java.util.Properties file that specifies: - classname of the control client - classnames of each control type used by that control client (the set identified by @Control and @ControlReference usages) and the corresponding default implementation binding Example client manifest: FooImpl.controls.properties --------------------------- .client.name=org.acme.controls.FooImpl org.acme.controls.CustomerDbBean=org.apache.beehive.controls.scl.DatabaseControlImpl org.acme.controls.DailyTimerBean=org.apache.beehive.controls.scl.TimerControlImpl The manifest is a generated artifact and is not user-editable. Ideally, the apt environment optimizes the writing of the manifest such that it's only written to disk when changes occur (allowing external build tools to use the timestamp of the manifest to determine whether assembly on a client needs to occur).


Field Summary
static String BEEHIVE_VERSION_PROP
           
static String CLIENT_NAME_PROP
           
static String FILE_EXTENSION
           
 
Constructor Summary
ControlClientManifest(File f)
          Loads a ControlClientManifest from an existing manifest file.
ControlClientManifest(String client)
          Creates a new ControlClientManifest
 
Method Summary
 void addControlType(String intf, String impl)
          Adds a new control type to the manifest
 void emit(Filer f, String pkg, File mf, String csn)
          Emits the manifest via an apt Filer implementation
 String getControlClient()
           
 List<String> getControlTypes()
           
 String getDefaultImpl(String controlType)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIENT_NAME_PROP

public static final String CLIENT_NAME_PROP
See Also:
Constant Field Values

BEEHIVE_VERSION_PROP

public static final String BEEHIVE_VERSION_PROP
See Also:
Constant Field Values

FILE_EXTENSION

public static final String FILE_EXTENSION
See Also:
Constant Field Values
Constructor Detail

ControlClientManifest

public ControlClientManifest(File f)
                      throws FileNotFoundException,
                             IOException
Loads a ControlClientManifest from an existing manifest file.

Parameters:
f - the manifest file
Throws:
FileNotFoundException
IOException

ControlClientManifest

public ControlClientManifest(String client)
Creates a new ControlClientManifest

Parameters:
client - the fully qualified classname of the control client
Method Detail

getControlClient

public String getControlClient()
Returns:
the name of the control client in this manifest

addControlType

public void addControlType(String intf,
                           String impl)
Adds a new control type to the manifest

Parameters:
intf - fully qualified name of the control type
impl - fully qualified name of the default implementation for the control type

getControlTypes

public List<String> getControlTypes()
Returns:
a list of all control types listed in the manifest

getDefaultImpl

public String getDefaultImpl(String controlType)
Parameters:
controlType -
Returns:
the default implementation for the control type listed in the manifest

emit

public void emit(Filer f,
                 String pkg,
                 File mf,
                 String csn)
          throws IOException
Emits the manifest via an apt Filer implementation

Parameters:
f - an apt Filer
pkg - the package structure to place the manifest in
mf - the name of the manifest
Throws:
IOException