fulmine.model.container
Class AbstractDynamicContainer
java.lang.Object
fulmine.AbstractLifeCycle
fulmine.model.component.AbstractComponent
fulmine.model.container.AbstractContainer
fulmine.model.container.AbstractEventProcessingContainer
fulmine.model.container.AbstractDynamicContainer
- All Implemented Interfaces:
- IEvent, IEventFrame, IEventSource, IAddressable, IDescriptor, IDestroyable, ILifeCycle, IComponent, IContainer, IRemoteSubscribable, IWireState, Cloneable
- Direct Known Subclasses:
- Record
public abstract class AbstractDynamicContainer
- extends AbstractEventProcessingContainer
Base class for dynamic containers.
This implementation is thread safe. A dynamic container is a container with a
variable field population; fields can be added and removed arbitrarily during
the container's life-cycle.
A dynamic container maintains a field that is the
IContainerDefinitionField
to describe the field population for the
container. This definition is sent in the wire frame as the first field. This
allows receiving context instances to correctly construct the field
population of the dynamic container. This is a key difference between a
static and dynamic container structure.
This raises the following events:
- Author:
- Ramon Servadei
Methods inherited from class fulmine.model.container.AbstractContainer |
add, beforeAdd, beforeRemove, beginFrame, contains, doPostAddListener, doPostRemoveListener, doReadState, doStart, doWriteState, endFrame, equals, flushFrame, get, getBooleanField, getComponentIdentities, getContext, getDataState, getDoubleField, getFields, getFloatField, getFrameIdentifier, getIntegerField, getLongField, getNativeContextIdentity, getRemoteSubscriptionCount, getStringField, hashCode, isEmpty, isEventFrameThread, isFrameActive, isLocal, isRemote, lockFrame, logNotTheEventFrameThread, markForRemoteSubscription, remove, setState, size, toDetailedString, toString, unmarkForRemoteSubscription |
Methods inherited from class fulmine.model.component.AbstractComponent |
addListener, checkClone, createIdentityString, doDestroy, getAddress, getAddressable, getDomain, getDrivingFrame, getEventSourceGroupId, getFrame, getIdentity, getIdentityString, getListeners, getSource, getTriggerEvent, getType, isClone, readState, removeListener, removeListeners, setDrivingFrame, setFrame, setTriggerEvent, toIdentityString, writeState |
AbstractDynamicContainer
public AbstractDynamicContainer(String nativeContextIdentity,
String identity,
IType type,
IDomain domain,
IFrameworkContext hostContext,
boolean local)
- Standard constructor. A
ContainerDefinitionField
is constructed
and added as a field of this. The constructor calls the AbstractLifeCycle.start()
method.
- Parameters:
nativeContextIdentity
- the name of the context this container is native to - the name
of its local contextidentity
- the identity of the containertype
- the type of the containerdomain
- the domain for the containerhostContext
- the context hosting this container instancelocal
- true
the container is local to this context
afterAdd
protected final void afterAdd(IField field)
- Description copied from class:
AbstractContainer
- Called after the field is added and the copy-on-write operation has
completed. This is called whilst holding the monitor lock for
adding/removing fields.
- Overrides:
afterAdd
in class AbstractEventProcessingContainer
- Parameters:
field
- the field to add
afterRemove
protected final void afterRemove(IField field,
IField removed)
- Description copied from class:
AbstractContainer
- Called after the field is removed and the copy-on-write operation has
completed. This is called whilst holding the monitor lock for
adding/removing fields.
- Overrides:
afterRemove
in class AbstractContainer
- Parameters:
field
- the field to removeremoved
- the field that has been removed - if null
then
the field was not removed (possibly because it was not in the
fields)
isDynamic
public final boolean isDynamic()
- Description copied from interface:
IContainer
- Identify if the container is dynamic or static. Static container types
have an immutable
IField
population. Dynamic containers have a
variable (mutable) population.
- Specified by:
isDynamic
in interface IContainer
- Overrides:
isDynamic
in class AbstractContainer
- Returns:
true
if the definition is dynamic
getDefinition
protected final IContainerDefinitionField getDefinition()
- Description copied from class:
AbstractContainer
- Get the definition for this container. This effectively provides the
'type' for the this container.
- Overrides:
getDefinition
in class AbstractContainer
- Returns:
- the
IContainerDefinitionField
that defines the
IField
objects (fields) of this container.
newReaderTask
protected final AbstractDynamicContainer.ReaderTask newReaderTask()
- Description copied from class:
AbstractContainer
- Get the reader task to use during the
AbstractContainer.doReadState(IOperationScope, byte[], int, int)
method. The
reader task is executed for each field spec found during the read state
operation. The task implementation is responsible for
constructing/reading the IField
expressed in the field spec.
- Overrides:
newReaderTask
in class AbstractContainer
- Returns:
- the
AbstractContainer.ReaderTask
to invoke for each field spec found during
the read state operation.
getFieldsToWrite
protected final Collection<IField> getFieldsToWrite(boolean completeState)
- Description copied from class:
AbstractContainer
- Get the fields to write to a frame. This occurs whilst the event frame is
locked. This method allows sub-classes to inspect and mutate the
#changedFields
field prior to being written to a frame.
- Overrides:
getFieldsToWrite
in class AbstractEventProcessingContainer
- Returns:
- the fields to write into a frame
Copyright © 2007-2009. All Rights Reserved.