net.dpml.metro.tools
Class TypeBuilderTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bynet.dpml.tools.tasks.GenericTask
              extended bynet.dpml.metro.tools.TypeBuilderTask
All Implemented Interfaces:
TypeBuilder

public class TypeBuilderTask
extends GenericTask
implements TypeBuilder

The TypeTask creates a serialized descriptor of a component type.

Version:
1.1.0
Author:
Digital Product Meta Library

Field Summary
 
Fields inherited from class net.dpml.tools.tasks.GenericTask
ASC_EXT, GPG_EXE_KEY, MD5_EXT
 
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
TypeBuilderTask()
           
 
Method Summary
 Type buildType(Class subject)
          Build the type.
 Type buildType(ClassLoader classloader)
          Build the type.
 CategoriesDescriptorDataType createCategories()
          Create a new services datatype.
 ServicesDataType createServices()
          Create a new services datatype.
 StateDataType createState()
          Create a state descriptor for the component.
 void execute()
          Execute the task.
 URI getBuilderURI()
          Return a uri identitifying the builder.
protected  String getClassname()
          Return the type classname.
protected  String getName()
          Return the type name.
 URI getTypeHandlerURI()
          Return a urn identitifying the component type strategy that this builder is supporting.
 void setClass(String classname)
          Set the classname of the type.
 void setCollection(String value)
          Set the type collection policy.
 void setLifestyle(String value)
          Set the type lifestyle policy.
 void setName(String name)
          Set the name of the type.
 void setThreadsafe(boolean flag)
          Set the threadsafe flag.
protected static URI setupURI(String spec)
          Internal utility to create a static uri.
 
Methods inherited from class net.dpml.tools.tasks.GenericTask
asc, checksum, copy, deleteDir, getContext, getLibrary, getResource, init, isInitialized, mkDir
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, 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
 

Constructor Detail

TypeBuilderTask

public TypeBuilderTask()
Method Detail

setName

public void setName(String name)
Set the name of the type.

Parameters:
name - the component name

setClass

public void setClass(String classname)
Set the classname of the type.

Parameters:
classname - the component type classname

setThreadsafe

public void setThreadsafe(boolean flag)
Set the threadsafe flag.

Parameters:
flag - true if the component type is threadsafe

setCollection

public void setCollection(String value)
Set the type collection policy.

Parameters:
value - the collection policy value

setLifestyle

public void setLifestyle(String value)
Set the type lifestyle policy.

Parameters:
value - the lifestyle policy value

createServices

public ServicesDataType createServices()
Create a new services datatype.

Returns:
a new services datatype

createCategories

public CategoriesDescriptorDataType createCategories()
Create a new services datatype.

Returns:
a new services datatype

createState

public StateDataType createState()
Create a state descriptor for the component.

Returns:
a state graph descriptor

getTypeHandlerURI

public URI getTypeHandlerURI()
Return a urn identitifying the component type strategy that this builder is supporting.

Returns:
a uri identifiying the type strategy

getBuilderURI

public URI getBuilderURI()
Return a uri identitifying the builder.

Returns:
a uri identifiying the type builder

buildType

public Type buildType(ClassLoader classloader)
               throws IntrospectionException,
                      IOException
Build the type.

Specified by:
buildType in interface TypeBuilder
Parameters:
classloader - the classloader to use for type creation
Returns:
the component type
Throws:
IntrospectionException - if a class introspection error occurs
IOException - if an I/O error occurs

buildType

public Type buildType(Class subject)
               throws IntrospectionException,
                      IOException
Build the type.

Parameters:
subject - the implementation class
Returns:
the component type
Throws:
IntrospectionException - if a class introspection error occurs
IOException - if an I/O error occurs

execute

public void execute()
Execute the task.


getName

protected String getName()
Return the type name.

Returns:
the name

getClassname

protected String getClassname()
Return the type classname.

Returns:
the classname

setupURI

protected static URI setupURI(String spec)
Internal utility to create a static uri.

Parameters:
spec - the uri spec
Returns:
the uri