org.jbpm.wire
Interface Descriptor

All Superinterfaces:
Observable, java.io.Serializable
All Known Implementing Classes:
AbstractDescriptor, BusinessCalendarDescriptor, ByteDescriptor, CharacterDescriptor, ClassDescriptor, ClassLoaderDescriptor, CollectionDescriptor, CommandServiceDescriptor, ContextDescriptor, DeployerManagerDescriptor, DoubleDescriptor, EnterpriseTransactionDescriptor, EnvironmentDescriptor, EnvironmentFactoryDescriptor, EnvironmentInterceptorDescriptor, FalseDescriptor, FloatDescriptor, HibernateConfigurationDescriptor, HibernateSessionDescriptor, HibernateSessionFactoryDescriptor, IntegerDescriptor, ListDescriptor, LongDescriptor, MapDescriptor, NullDescriptor, ObjectDescriptor, PropertiesDescriptor, ProvidedObjectDescriptor, PvmDbSessionDescriptor, PvmServiceDescriptor, ReferenceDescriptor, RetryInterceptorDescriptor, SeamHibernateSessionDescriptor, SetDescriptor, ShortDescriptor, StandardTransactionDescriptor, StringDescriptor, TrueDescriptor, TypeRefDescriptor, UrlDescriptor, VariableTypeResolverDescriptor

public interface Descriptor
extends Observable, java.io.Serializable

knows how an object can be created.

A WireDefinition contains a map of Descriptors. They are used by the WireContext that will build and cache the objects.

Author:
Tom Baeyens, Guillaume Porcher (documentation)

Field Summary
static java.lang.String EVENT_CONSTRUCTED
          is fired when object construction is completed.
static java.lang.String EVENT_CONSTRUCTING
          is fired when construction of a wired object starts.
static java.lang.String EVENT_INITIALIZING
          is fired when initialization of a wired object starts (after construction).
static java.lang.String EVENT_REMOVE
          is fired when an object is being removed from the cache of the wire context with WireContext.remove(String).
static java.lang.String EVENT_SET
          is fired when an object is being set into the cache of this wire context with WireContext.set(String, Object).
 
Method Summary
 java.lang.Object construct(WireContext wireContext)
          constructs the object.
 java.lang.String getName()
          the name of this descriptor
 java.lang.Class<?> getType(WireDefinition wireDefinition)
          the type of the produced object or null if that is not available
 void initialize(java.lang.Object object, WireContext wireContext)
          called by the WireContext to initialize the specified object.
 boolean isDelayable()
          Checks if the initialization should be done during the construction phase or if it can be done later.
 boolean isEagerInit()
          if eager initialization is set, it means that an object must be created immediately during construction of the WireContext.
 
Methods inherited from interface org.jbpm.util.Observable
addListener, addListener, addListener, fire, fire, removeListener
 

Field Detail

EVENT_CONSTRUCTING

static final java.lang.String EVENT_CONSTRUCTING
is fired when construction of a wired object starts. The provided event is a WireObjectEventInfo.

See Also:
WireContext, Constant Field Values

EVENT_INITIALIZING

static final java.lang.String EVENT_INITIALIZING
is fired when initialization of a wired object starts (after construction). The provided event is a WireObjectEventInfo.

See Also:
WireContext, Constant Field Values

EVENT_CONSTRUCTED

static final java.lang.String EVENT_CONSTRUCTED
is fired when object construction is completed. The provided event is a WireObjectEventInfo.

See Also:
WireContext, Constant Field Values

EVENT_SET

static final java.lang.String EVENT_SET
is fired when an object is being set into the cache of this wire context with WireContext.set(String, Object). The provided event is a WireObjectEventInfo.

See Also:
WireContext, Constant Field Values

EVENT_REMOVE

static final java.lang.String EVENT_REMOVE
is fired when an object is being removed from the cache of the wire context with WireContext.remove(String). The provided event is a WireObjectEventInfo.

See Also:
WireContext, Constant Field Values
Method Detail

getName

java.lang.String getName()
the name of this descriptor


getType

java.lang.Class<?> getType(WireDefinition wireDefinition)
the type of the produced object or null if that is not available


isEagerInit

boolean isEagerInit()
if eager initialization is set, it means that an object must be created immediately during construction of the WireContext.


construct

java.lang.Object construct(WireContext wireContext)
constructs the object.

Parameters:
wireContext - WireContext in which the object is created. This is also the WireContext where the object will search for other object that may be needed during the initialization phase.
Returns:
the constructed object.

isDelayable

boolean isDelayable()
Checks if the initialization should be done during the construction phase or if it can be done later.

Returns:
false if the initialization should be done during the creation phase, true if it can be done later.

initialize

void initialize(java.lang.Object object,
                WireContext wireContext)
called by the WireContext to initialize the specified object. For more information about initialization, see WireContext section lifecycle.

Parameters:
object - object to initialize.
wireContext - the context in which the object will be initialized.