fulmine.event
Class EventSource

java.lang.Object
  extended by fulmine.AbstractLifeCycle
      extended by fulmine.model.component.AbstractComponent
          extended by fulmine.event.EventSource
All Implemented Interfaces:
IEvent, IEventSource, IAddressable, IDescriptor, IDestroyable, ILifeCycle, IComponent, IWireState, Cloneable
Direct Known Subclasses:
AsymmetricEventProcessor, SystemEventSource

public class EventSource
extends AbstractComponent

A simple event source. All sub-classes will use the same EventProcessor (the zeroth event processor).

Author:
Ramon Servadei

Constructor Summary
  EventSource(String identity)
          Standard constructor
protected EventSource(String identity, IType type, IDomain domain)
          Constructor for sub-classes
 
Method Summary
protected  boolean doReadState(IOperationScope scope, byte[] buffer, int start, int numberOfBytes)
          Update the component state from the wire format state in the buffer.
protected  boolean doWriteState(IOperationScope scope, IWireIdentity wireId, byte[][] headerBuffer, int[] headerBufferPosition, byte[][] dataBuffer, int[] dataBufferPosition, boolean completeState)
          Write the component state in its wire form to the buffer.
protected  AsyncLog getLog()
          Get the log to use for the object hierarchy
 
Methods inherited from class fulmine.model.component.AbstractComponent
addEvent, addListener, checkClone, clone, createIdentityString, doComponentDestroy, doDestroy, doPostAddListener, doPostRemoveListener, doStart, equals, getAddress, getAddressable, getDomain, getDrivingFrame, getEventSourceGroupId, getFrame, getIdentity, getIdentityString, getListeners, getSource, getTriggerEvent, getType, hashCode, isClone, readState, removeListener, removeListeners, setDrivingFrame, setFrame, setTriggerEvent, toDetailedString, toIdentityString, toString, writeState
 
Methods inherited from class fulmine.AbstractLifeCycle
checkActive, destroy, finalize, isActive, start
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fulmine.ILifeCycle
isActive, start
 
Methods inherited from interface fulmine.IDestroyable
destroy
 

Constructor Detail

EventSource

public EventSource(String identity)
Standard constructor

Parameters:
identity - the identity for the source

EventSource

protected EventSource(String identity,
                      IType type,
                      IDomain domain)
Constructor for sub-classes

Parameters:
identity - the identity
type - the source
domain - the domain
Method Detail

doReadState

protected boolean doReadState(IOperationScope scope,
                              byte[] buffer,
                              int start,
                              int numberOfBytes)
                       throws Exception
Description copied from class: AbstractComponent
Update the component state from the wire format state in the buffer. Any nested fields must be read using their AbstractComponent.readState(IOperationScope, byte[], int, int) method.

Specified by:
doReadState in class AbstractComponent
Returns:
true if the read operation succeded.
Throws:
Exception
See Also:
IWireState.readState(IOperationScope, byte[], int, int)

doWriteState

protected boolean doWriteState(IOperationScope scope,
                               IWireIdentity wireId,
                               byte[][] headerBuffer,
                               int[] headerBufferPosition,
                               byte[][] dataBuffer,
                               int[] dataBufferPosition,
                               boolean completeState)
                        throws Exception
Description copied from class: AbstractComponent
Write the component state in its wire form to the buffer. Any nested fields must be written by calling their AbstractComponent.writeState(IOperationScope, IWireIdentity, byte[][], int[], byte[][], int[], boolean) method.

Specified by:
doWriteState in class AbstractComponent
Returns:
true if the write operation succeeded
Throws:
Exception
See Also:
IWireState.writeState(IOperationScope, IWireIdentity, byte[][], int[], byte[][], int[], boolean), for a discussion of the byte[][] usage

getLog

protected AsyncLog getLog()
Description copied from class: AbstractLifeCycle
Get the log to use for the object hierarchy

Overrides:
getLog in class AbstractComponent
Returns:
the log to use for the object hierarchy


Copyright © 2007-2009. All Rights Reserved.