|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task org.figure8.join.services.scripting.ant.tasks.RemoteServiceTask org.figure8.join.services.scripting.ant.tasks.BindComponentTask
public class BindComponentTask
This an Ant task to use for binding a component being built/discovered to a
specified assembly and/or build.
As an example, use a bindcomponent that way to ensure attaching a
component to an assembly :
>bindcomponent type="myComponent" assembly="myassembly-r1.0-v01"
version="001" url="http://mydomain.org:8080/join"<
>fileset dir="${src.dir}/myComponent" includes="*.*"/<
>/bindcomponent<
That task will then connect to Join system denoted by url to see if component of
type "myComponent" exists with version "001". If no, il will create it into Join
system, specifying its size using files from nested filesets. Finally, it will
attach existing or newly created component to the existing "myassembly-r1.0-v01"
assembly.
This task is very useful when creating an assembly using an Ant script and
introspecting its content, searching for contained components : it allows you
to trace what you have dynamically discovered.
When component version is not easily extractable, you can replace version
attribute by extractor and thus specifying a VersionInfoExtractor
implementation to use for extracting version info from files in nested filesets.
Field Summary | |
---|---|
protected VersionInfoExtractor |
versionExtractor
The version information extractor instance used for retrieving component version |
Fields inherited from class org.figure8.join.services.scripting.ant.tasks.RemoteServiceTask |
---|
REMOTE_URL_SUBCONTEXT |
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 | |
---|---|
BindComponentTask()
Creates a new instance of BindComponentTask |
Method Summary | |
---|---|
void |
addFileset(org.apache.tools.ant.types.FileSet set)
Adds a set of files (nested fileset element) |
protected void |
bindComponent(java.lang.String version,
java.io.File[] files)
Do the real component binding (remote service invocation) |
protected long |
computeSizeInBytes(java.io.File[] files)
Compute the sum of files weigth. |
void |
execute()
Execute this task : do the binding of configured component |
java.lang.String |
getAssembly()
|
java.lang.Class |
getExtractor()
|
protected java.io.File[] |
getFilesFromFileSets()
Build an array of included files. |
java.lang.String |
getType()
|
java.lang.String |
getVersion()
|
void |
setAssembly(java.lang.String assembly)
|
void |
setExtractor(java.lang.Class extractor)
|
void |
setType(java.lang.String type)
|
void |
setVersion(java.lang.String version)
|
protected void |
validateAttributes()
Validate this task attributes before execution. |
Methods inherited from class org.figure8.join.services.scripting.ant.tasks.RemoteServiceTask |
---|
getPassword, getUrl, getUser, loginToRemoteService, releaseRemoteService, retrieveRemoteService, setPassword, setUrl, setUser |
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 |
---|
protected VersionInfoExtractor versionExtractor
Constructor Detail |
---|
public BindComponentTask()
Method Detail |
---|
public java.lang.String getType()
public void setType(java.lang.String type)
type
- The component type to bind a component forpublic java.lang.String getAssembly()
public void setAssembly(java.lang.String assembly)
assembly
- The assembly that contains componentpublic java.lang.String getVersion()
public void setVersion(java.lang.String version)
version
- The component version informationpublic java.lang.Class getExtractor()
public void setExtractor(java.lang.Class extractor)
extractor
- The component version extractor implementation to usepublic void addFileset(org.apache.tools.ant.types.FileSet set)
set
- A FileSet containing files to processpublic void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- if something wrong occurs during task processprotected void validateAttributes() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
- if a mandatory attribute is not presentprotected java.io.File[] getFilesFromFileSets()
protected void bindComponent(java.lang.String version, java.io.File[] files) throws org.apache.tools.ant.BuildException
files
- The files representing component
org.apache.tools.ant.BuildException
- if service invocation failsprotected long computeSizeInBytes(java.io.File[] files) throws java.lang.Exception
files
- The set of files to sum weigth.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |