| java.lang.Object org.cougaar.core.component.ComponentDescription
ComponentDescription | final public class ComponentDescription implements Serializable(Code) | | An immutable description of a loadable component (for example,
a plugin, servlet, etc).
We may want several levels of description and protection,
starting here and ending up at an uninitialized instance.
This could be done either as a sequence of classes or
as a single class with instantiation state (e.g. Description,
Classloaded, Instantiated, Loaded (into a component), Active).
The Description is interpreted and evaluated to varying degrees
as it is passed through the hierarchy until the insertion point
is found. In particular, the description will be evaluated for
trust attributes at each level before instantiation or pass-through.
|
Constructor Summary | |
public | ComponentDescription(String name, String insertionPoint, String classname, URL codebase, Object parameter, Object certificate, Object lease, Object policy) A ComponentDescription must have a non-null name,
insertionPoint, and classname. | public | ComponentDescription(String name, String insertionPoint, String classname, URL codebase, Object parameter, Object certificate, Object lease, Object policy, int priority) A ComponentDescription must have a non-null name,
insertionPoint, and classname. |
Method Summary | |
public boolean | equals(Object o) Equality tests all publicly visibile fields. | public Object | getCertificate() Assurance that the Plugin is trustworth enough to instantiate. | public String | getClassname() The name of the class to instantiate, relative to the
codebase url. | public URL | getCodebase() Where the code for classname should be loaded from. | public String | getInsertionPoint() The point in the component hierarchy where the component
should be inserted. | public Object | getLeaseRequested() Lease information - how long should the plugin live in the agent?
We need some input on what this should look like. | public String | getName() The name of a particular component, used
both as the displayable identifier of
the Component and to disambiguate between
multiple similar components which might otherwise
appear equal. | public Object | getParameter() A parameter supplied to the component immediately
after construction by calling instance.setParameter(param);
using reflection.
setParameter will be called IFF the parameter is non-null. | public Object | getPolicy() High-level Policy information. | public int | getPriority() Load Priority of the component in it's Container relative to
other child components loaded at the same time at the same Containment point.
Two components loaded at the same point and time with the same priority
will be loaded in the order they are specified in.
However, it is up to the Container how to interpret priority. | public int | hashCode() | final public static int | parsePriority(String s) return a priority value, given a priority string which is one of HIGH, INTERNAL, BINDER, COMPONENT,
LOW, or STANDARD. | final public static String | priorityToString(int p) | public String | toString() |
PRIORITY_BINDER | final public static int PRIORITY_BINDER(Code) | | Binders are typically loaded before subcomponents *
|
PRIORITY_COMPONENT | final public static int PRIORITY_COMPONENT(Code) | | Standard subcomponent (including plugin) priority *
|
PRIORITY_Comparator | final public static Comparator PRIORITY_Comparator(Code) | | A comparator which may be used for sorting ComponentDescriptions by priority *
|
PRIORITY_HIGH | final public static int PRIORITY_HIGH(Code) | | Higher priority than internal components. Containers are
less likely to accomodate this level than the others
|
PRIORITY_INTERNAL | final public static int PRIORITY_INTERNAL(Code) | | Same priority as internal subcomponents. E.g. loaded
before binders.
|
PRIORITY_LOW | final public static int PRIORITY_LOW(Code) | | Load after standard subcomponents *
|
PRIORITY_STANDARD | final public static int PRIORITY_STANDARD(Code) | | Default priority for ComponentDescription objects *
|
ComponentDescription | public ComponentDescription(String name, String insertionPoint, String classname, URL codebase, Object parameter, Object certificate, Object lease, Object policy)(Code) | | A ComponentDescription must have a non-null name,
insertionPoint, and classname.
throws: IllegalArgumentException - if name is null,insertionPoint is null, or classname is null. |
ComponentDescription | public ComponentDescription(String name, String insertionPoint, String classname, URL codebase, Object parameter, Object certificate, Object lease, Object policy, int priority)(Code) | | A ComponentDescription must have a non-null name,
insertionPoint, and classname.
throws: IllegalArgumentException - if name is null,insertionPoint is null, classname is null, or priority is illegal. |
equals | public boolean equals(Object o)(Code) | | Equality tests all publicly visibile fields.
In the future this may be modified to ignore the
certificate, lease, and/or policy.
|
getCertificate | public Object getCertificate()(Code) | | Assurance that the Plugin is trustworth enough to instantiate.
The type is specified as Object until we decide what really
should be here.
|
getClassname | public String getClassname()(Code) | | The name of the class to instantiate, relative to the
codebase url. The class will not be loaded or instantiated
until the putative parent component has been found and has
had the opportunity to verify the plugin's identity and
authorization.
|
getCodebase | public URL getCodebase()(Code) | | Where the code for classname should be loaded from.
Will be evaulated for trust before any classes are loaded
from this location.
|
getInsertionPoint | public String getInsertionPoint()(Code) | | The point in the component hierarchy where the component
should be inserted. It is used by the component hierarchy to
determine the container component the plugin should be
added. This point is interpreted individually by each
(parent) component as it propagates through the container
hierarchy - it may be interpreted any number of times along
the way to the final insertion point.
example: a plugin would have an insertion point of
"Node.AgentManager.Agent.PluginManager.Plugin"
Note that data formats (including presentation methods) may
abbreviate full insertion paths as relative to some parent
in the context. For instance, agent.ini files may refer to
plugins as ".PluginManager.Plugin".
|
getLeaseRequested | public Object getLeaseRequested()(Code) | | Lease information - how long should the plugin live in the agent?
We need some input on what this should look like.
It is possible that this could be merged with Policy.
|
getName | public String getName()(Code) | | The name of a particular component, used
both as the displayable identifier of
the Component and to disambiguate between
multiple similar components which might otherwise
appear equal.
It would be consistent to treat the name as a UID/OID for
a specific component.
|
getParameter | public Object getParameter()(Code) | | A parameter supplied to the component immediately
after construction by calling instance.setParameter(param);
using reflection.
setParameter will be called IFF the parameter is non-null. It is an error
for a ComponentDescription to specify a non-null parameter, but for the
actual Component to not define the setParameter method:
public void setParameter(Object parameter);
A parameter is often some sort of structured object (xml document, etc).
While is is defined as just an Object, most implementations
impose additional restrictions (e.g. Serializable)
for safety reasons.
|
getPolicy | public Object getPolicy()(Code) | | High-level Policy information. Allows plugin policy/techspec
to contribute to the component hookup process before it is
actually instantiated. Perhaps this is overkill, and instance-level
policy is sufficient.
|
getPriority | public int getPriority()(Code) | | Load Priority of the component in it's Container relative to
other child components loaded at the same time at the same Containment point.
Two components loaded at the same point and time with the same priority
will be loaded in the order they are specified in.
However, it is up to the Container how to interpret priority. Priority is,
in general, only a recommendation, although the standard Containers
implement the recommended interpretation.
In particular, Containers may decline to load high-priority subcomponents
as early as they might like.
Note that code should always use the priority constants, rather than
int values, as the actual values and implementations are subject to change
without notice.
|
hashCode | public int hashCode()(Code) | | |
parsePriority | final public static int parsePriority(String s)(Code) | | return a priority value, given a priority string which is one of HIGH, INTERNAL, BINDER, COMPONENT,
LOW, or STANDARD.
|
priorityToString | final public static String priorityToString(int p)(Code) | | return a priority string given a legal priority value *
|
|
|