org.apache.beehive.controls.runtime.assembly
Class BaseAssemblyContext

Object
  extended by BaseAssemblyContext
All Implemented Interfaces:
ControlAssemblyContext
Direct Known Subclasses:
AppAssemblyContext, EJBAssemblyContext, WebAppAssemblyContext

public abstract class BaseAssemblyContext
extends Object
implements ControlAssemblyContext

Base ControlAssemblyContext implementation


Nested Class Summary
 
Nested classes/interfaces inherited from interface ControlAssemblyContext
ControlAssemblyContext.EJBModule, ControlAssemblyContext.EntAppModule, ControlAssemblyContext.Factory, ControlAssemblyContext.WebAppModule
 
Constructor Summary
protected BaseAssemblyContext(Class controlIntfOrExt, Map<String,String> bindings, Set<String> clients, File moduleRoot, String moduleName, File srcOutputRoot)
           
 
Method Summary
 File createJavaOutputFile(String packageName, String className)
           
 Set<String> getClients()
           
<T extends Annotation>
T
getControlAnnotation(Class<T> annotationClass)
           
<T extends Annotation>
T
getControlMethodAnnotation(Class<T> annotationClass, Method m)
           
 Class getControlType()
           
 String getDefaultImplClassName()
           
 File getModuleDir()
           
 String getModuleName()
           
 Class getMostDerivedControlInterface()
           
 File getSrcOutputDir()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseAssemblyContext

protected BaseAssemblyContext(Class controlIntfOrExt,
                              Map<String,String> bindings,
                              Set<String> clients,
                              File moduleRoot,
                              String moduleName,
                              File srcOutputRoot)
                       throws ControlAssemblyException
Throws:
ControlAssemblyException
Method Detail

getControlType

public Class getControlType()
Specified by:
getControlType in interface ControlAssemblyContext
Returns:
the interface type of the control being assembled (annotated w/ ControlExtension or ControlInterface)

getMostDerivedControlInterface

public Class getMostDerivedControlInterface()
Specified by:
getMostDerivedControlInterface in interface ControlAssemblyContext
Returns:
the most derived interface of the control being assembled that is annotated with ControlInterface (may return the same as getControlType() if the control type is non-extended)

getControlAnnotation

public <T extends Annotation> T getControlAnnotation(Class<T> annotationClass)
Specified by:
getControlAnnotation in interface ControlAssemblyContext
Returns:
an annotation on the interface returned by getControlType()

getControlMethodAnnotation

public <T extends Annotation> T getControlMethodAnnotation(Class<T> annotationClass,
                                                           Method m)
                                                throws NoSuchMethodException
Specified by:
getControlMethodAnnotation in interface ControlAssemblyContext
Returns:
an annotation on a method on the interface returned by getControlType()
Throws:
NoSuchMethodException

getDefaultImplClassName

public String getDefaultImplClassName()
Specified by:
getDefaultImplClassName in interface ControlAssemblyContext
Returns:
the defaultBinding member of the ControlInterface

createJavaOutputFile

public File createJavaOutputFile(String packageName,
                                 String className)
Specified by:
createJavaOutputFile in interface ControlAssemblyContext
Returns:
a File into which Java source can be written. Results in a file called .java (in the directory given by ).

getSrcOutputDir

public File getSrcOutputDir()
Specified by:
getSrcOutputDir in interface ControlAssemblyContext
Returns:
the output directory into which "compilable" source should be output.

getModuleDir

public File getModuleDir()
Specified by:
getModuleDir in interface ControlAssemblyContext
Returns:
the root of the module for which assembly is taking place.

getModuleName

public String getModuleName()
Specified by:
getModuleName in interface ControlAssemblyContext
Returns:
the name of the module for which assembly is taking place.

getClients

public Set<String> getClients()
Specified by:
getClients in interface ControlAssemblyContext
Returns:
the set of clients (by class name) which use the control type