net.user1.union.core.def
Class ModuleDef

java.lang.Object
  extended by net.user1.union.core.def.ModuleDef
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class ModuleDef
extends java.lang.Object
implements java.io.Externalizable

A ModuleDef defines how a module should be constructed.

See Also:
Serialized Form

Field Summary
static java.lang.String ATTR_SCRIPT_FILE
          If the module is written as a script this attribute is a path to the script file from UNION_HOME/modules.
static java.lang.String CLASS
          Denotes that the module is written as a Java class.
static java.lang.String SCRIPT
          Denotes that the module is written using a scripting language.
 
Constructor Summary
ModuleDef()
           
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
          Add an attribute to the module.
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Get the attributes that have been set for the module.
 java.lang.String getID()
          Gets the ID of the module.
 java.lang.String getSource()
          Get the source (the Java class or script name) for the module.
 java.lang.String getType()
          Gets the module type (SCRIPT or CLASS)
 void readExternal(java.io.ObjectInput in)
           
 void setID(java.lang.String moduleID)
          Set the ID of the module.
 void setSource(java.lang.String code)
          Set the source (the Java class or script name) for the module.
 void setType(java.lang.String type)
          Set the module type (SCRIPT or CLASS)
 void validate()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS

public static final java.lang.String CLASS
Denotes that the module is written as a Java class.

See Also:
Constant Field Values

SCRIPT

public static final java.lang.String SCRIPT
Denotes that the module is written using a scripting language.

See Also:
Constant Field Values

ATTR_SCRIPT_FILE

public static final java.lang.String ATTR_SCRIPT_FILE
If the module is written as a script this attribute is a path to the script file from UNION_HOME/modules.

See Also:
Constant Field Values
Constructor Detail

ModuleDef

public ModuleDef()
Method Detail

setID

public void setID(java.lang.String moduleID)
Set the ID of the module.

Parameters:
moduleID - - the ID of the module

getID

public java.lang.String getID()
Gets the ID of the module.

Returns:
the ID of the module

getType

public java.lang.String getType()
Gets the module type (SCRIPT or CLASS)

Returns:
the module type

setType

public void setType(java.lang.String type)
Set the module type (SCRIPT or CLASS)

Parameters:
type - - the module type

setSource

public void setSource(java.lang.String code)
Set the source (the Java class or script name) for the module.

Parameters:
code - - the source for the module

getSource

public java.lang.String getSource()
Get the source (the Java class or script name) for the module.

Returns:
the source for the module

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
Add an attribute to the module.

Parameters:
name - - the name of the attribute
value - - the value of the attribute

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Get the attributes that have been set for the module.

Returns:
a Map of the attributes set for the module

validate

public void validate()
              throws java.lang.Exception
Throws:
java.lang.Exception

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException


Copyright USER1 Subsystems Corporation - Tue Jan 28 2014, 05:05 PM -0500