rcf.core.concurrent.events
Interface EventSource

All Known Subinterfaces:
Application, CompositeTransaction<X>, ConcurrentRunnableTask, DynamicProperty<T>, Framework, Future<T>, InterruptibleFuture, InterruptibleTask, rcf.core.util.queue.Queue<T>, rcf.core.util.queue.ReadQueue<T>, RunnableFuture<T>, RunnableTask, Service, Task, TaskQueue<R>, TimerTask, Transaction, Transactional<X>, rcf.core.util.queue.WriteQueue<T>
All Known Implementing Classes:
AbstractApplication, rcf.core.util.collection.AbstractCollection, AbstractDynamicProperty, AbstractEventSource, AbstractFedoraHostedRADService.State, AbstractInterruptibleTask, AbstractNetworkTunnel.State, AbstractRADService.AbstractRADServiceState, AbstractRADService.RefreshTask, AbstractRADService.UpdateTask, AbstractService, AbstractTask, AbstractTransaction, AbstractTransactional, rcf.core.util.collection.vector.AbstractVector, AdvancedResearchIndexLoadLinux.State, ArrayEventSyndicate, rcf.core.util.collection.vector.ArrayVector, CompleteDynamicProperty, ComposedRADService.State, DefaultDynamicProperty, DynamicOperation.Default.Continuation, DynamicProperty.Default, ExternalTransaction, FilteredDynamicProperty, Framework.Default, HAProxyLinux.ConfigTask, HAProxyLinux.State, HashEventSyndicate, rcf.core.util.map.HashMap, rcf.core.util.collection.Hashtable, LigHTTPDLinux.ConfigTask, LigHTTPDLinux.State, LinuxSession.State, LinuxSystem.State, Main, MethodRunnableFuture, MySQLFedora.ConfigTask, RADTools.State, ResearchIndexLoadLinux.State, RoRServerLinux.ConfigDatabaseTask, RoRServerLinux.ConfigEnvironmentTask, RoRServerLinux.State, TimerTask.Abstract, TimerTask.Default, VMWareFedora.State, VMWareLinux.State

@Revision(value="$Revision: 1.7 $",
          date="$Date: 2006/12/15 20:37:49 $",
          tag="$Name:  $")
public interface EventSource

A source of events, including a syndicate() and some form of sequence numbering. For more information about the event model, see rcf.core.concurrent.events.

TODO: Javadoc review, Seal/Finalize

Version:
$Revision: 1.7 $
Author:
Greg Gibeling

Method Summary
 rcf.core.util.collection.ImmutableCollection<Class> events()
          Return an immutable collection of all the classes of Events which this source will generate and syndicate.
 int getSequenceNumber()
          Get the current event sequence number for this source.
 int incSequenceNumber()
          Get the current event sequence number for this source, and increase it for the next call to getSequenceNumber().
 boolean isSyndicated()
          Determine if this event source is syndicated; i.e.
 EventSyndicate syndicate()
          Return the current syndicate for this event source, or allocate one if there isn't one.
 

Method Detail

events

rcf.core.util.collection.ImmutableCollection<Class> events()
Return an immutable collection of all the classes of Events which this source will generate and syndicate. This can be used to check if a source will be will to generate specific events of interest to a potential sink.

Returns:
An immutable collection of all the classes of events which this source will generate and syndicate.

getSequenceNumber

int getSequenceNumber()
Get the current event sequence number for this source. Sequence numbers should be monotonic, but need not have a step size of 1. Sequence numbers can be used to guess at the ordering of events, and to mark the in a log.

Returns:
The current event sequence number.

incSequenceNumber

int incSequenceNumber()
Get the current event sequence number for this source, and increase it for the next call to getSequenceNumber(). Sequence numbers should be monotonic, but need not have a step size of 1. Sequence numbers can be used to guess at the ordering of events, and to mark the in a log.

Returns:
The current event sequence number.

isSyndicated

boolean isSyndicated()
Determine if this event source is syndicated; i.e. that there are one or more event sink registered to receive events from this source.

Returns:
true if there are one or more EventSinks registered to receive events from this source.

syndicate

EventSyndicate syndicate()
Return the current syndicate for this event source, or allocate one if there isn't one. This method should never return null unless events().ImmutableIterable.isEmpty() == true.

Returns:
The event syndicate which an EventSink should register with (EventSyndicate.add(rcf.core.util.reference.Reference, Class)) to receive events from this source.