com.bea.control.assembly
Class AssembleTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.bea.control.assembly.AssembleTask

public class AssembleTask
extends org.apache.tools.ant.Task

Defines a custom ant task to perform control assembly.

The core assembly algorithm is documented and implemented in Assembler.

Required attributes:
moduleDir: path to the root of J2EE module on which to perform assembly.
Optional attributes:
moduleName: name of J2EE module.
srcOutputDir: path to the dir where control assemblers may output source files. It may be necessary to run additional build steps in order to process such files (for example, if an assembler outputs Java source code, that code may need to be compiled).

Supported nested elements:
classpath: specifies the classpath that will be searched for control interfaces/implementations, control clients and control assemblers.
fileset: specifies the control client manifests that should be processed by this assembly call.
assemblyContextType: You can have multiple occurrences of this element. This specifies a fully qualified classname of a factory class that implements ControlAssemblyContext.Factory. Typically this would depend on the type of module on which assembly is being run (EJB, webapp, etc). Different contexts will expose different APIs to control assemblers (making different descriptors available, etc).

An example usage of the AssembleTask in an ant build script (build.xml):

<path id="wlwassembly.task.classpath"> <pathelement location="${weblogic.home}/beehive/weblogic-beehive/lib/controls/runtime/weblogic-controls.jar"/> <path refid="controls.dependency.path"/> </path> <taskdef name="assemble" classname="com.bea.control.assembly.AssembleTask" classpathref="wlwassembly.task.classpath" onerror="report" /> <assemble appRootDir="@{approotdir}" moduleDir="@{moduledir}" moduleName="@{modulename}" srcOutputDir="@{srcdestdir}"> <assemblyContext factory="org.apache.beehive.controls.runtime.assembly.WebAppAssemblyContext$Factory"/> <assemblyContext factory="org.apache.beehive.controls.runtime.assembly.AppAssemblyContext$Factory"/> <classpath> <path refid="@{classpathref}" /> </classpath> <fileset dir="@{moduledir}"> <include name="**\*.controls.properties" /> </fileset> </assemble>


Field Summary
protected  File _appRootDir
           
protected  List<AssemblyContext> _assemblyContexts
           
protected  org.apache.tools.ant.types.Path _classPath
           
protected  org.apache.tools.ant.types.FileSet _clientManifestFileSet
           
protected  boolean _echoToConsole
           
protected  File _moduleDir
           
protected  String _moduleName
           
protected  File _srcOutputDir
           
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
AssembleTask()
           
 
Method Summary
protected  void assemble(List<File> clientManifestFiles, List<String> contextFactories, List<String> classPaths)
           
 AssemblyContext createAssemblyContext()
           
 org.apache.tools.ant.types.Path createClasspath()
           
 org.apache.tools.ant.types.FileSet createFileset()
           
 void execute()
           
 void setAppRootDir(File appRootDir)
           
 void setClasspath(org.apache.tools.ant.types.Path classpath)
           
 void setEchoToConsole(boolean echoToConsole)
           
 void setModuleDir(File moduleDir)
           
 void setModuleName(String moduleName)
           
 void setSrcOutputDir(File srcOutputDir)
           
protected  void validateAttributeSettings()
           
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_appRootDir

protected File _appRootDir

_moduleDir

protected File _moduleDir

_moduleName

protected String _moduleName

_srcOutputDir

protected File _srcOutputDir

_echoToConsole

protected boolean _echoToConsole

_clientManifestFileSet

protected org.apache.tools.ant.types.FileSet _clientManifestFileSet

_classPath

protected org.apache.tools.ant.types.Path _classPath

_assemblyContexts

protected List<AssemblyContext> _assemblyContexts
Constructor Detail

AssembleTask

public AssembleTask()
Method Detail

setAppRootDir

public void setAppRootDir(File appRootDir)

setModuleDir

public void setModuleDir(File moduleDir)

setModuleName

public void setModuleName(String moduleName)

setSrcOutputDir

public void setSrcOutputDir(File srcOutputDir)

setEchoToConsole

public void setEchoToConsole(boolean echoToConsole)

createFileset

public org.apache.tools.ant.types.FileSet createFileset()

setClasspath

public void setClasspath(org.apache.tools.ant.types.Path classpath)

createClasspath

public org.apache.tools.ant.types.Path createClasspath()

createAssemblyContext

public AssemblyContext createAssemblyContext()

execute

public void execute()
Overrides:
execute in class org.apache.tools.ant.Task

assemble

protected void assemble(List<File> clientManifestFiles,
                        List<String> contextFactories,
                        List<String> classPaths)
                 throws IOException,
                        ControlAssemblyException
Throws:
IOException
ControlAssemblyException

validateAttributeSettings

protected void validateAttributeSettings()
                                  throws org.apache.tools.ant.BuildException
Throws:
org.apache.tools.ant.BuildException