|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrcf.core.util.filter.AbstractFilter<T>
rcf.core.util.collection.AbstractImmutableCollection<T,I,SI,SC,C>
rcf.core.util.collection.AbstractCollection<T,I,SI,SC,C>
rcf.core.util.collection.Hashtable<ImmutablePairInterface<A,B>,rcf.core.util.collection.Hashtable.HashtableIterator,rcf.core.util.map.HashMap.SubHashMapIterator<A,B>,rcf.core.util.map.HashMap.SubHashMap<A,B>,rcf.core.util.map.HashMap<A,B>>
rcf.core.util.map.HashMap<Reference<EventSink<? super Event>>,Class<Event>>
rcf.core.concurrent.events.HashEventSyndicate
@Revision(value="$Revision: 1.19 $",
date="$Date: 2006/12/15 20:37:49 $",
tag="$Name: $")
public class HashEventSyndicateTODO: Javadoc
TODO: Unit tests, Code review, Javadoc review, Seal/Finalize TODO: equals, hashCode, toString
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class rcf.core.util.map.HashMap |
|---|
rcf.core.util.map.HashMap.SubHashMap<A,B>, rcf.core.util.map.HashMap.SubHashMapIterator<A,B> |
| Nested classes/interfaces inherited from class rcf.core.util.collection.Hashtable |
|---|
rcf.core.util.collection.Hashtable.HashtableIterator, rcf.core.util.collection.Hashtable.HashtableNode<T> |
| Nested classes/interfaces inherited from class rcf.core.util.collection.AbstractCollection |
|---|
rcf.core.util.collection.AbstractCollection.AbstractSubCollection<T,I extends rcf.core.util.collection.iterator.FixedUniIterator<T>,SI extends rcf.core.util.collection.AbstractCollection.AbstractSubCollectionIterator<T,I,SI,SC,C>,SC extends rcf.core.util.collection.AbstractCollection.AbstractSubCollection<T,I,SI,SC,C>,C extends rcf.core.util.collection.AbstractCollection<T,I,SI,SC,C>>, rcf.core.util.collection.AbstractCollection.AbstractSubCollectionIterator<T,I extends rcf.core.util.collection.iterator.FixedUniIterator<T>,SI extends rcf.core.util.collection.AbstractCollection.AbstractSubCollectionIterator<T,I,SI,SC,C>,SC extends rcf.core.util.collection.AbstractCollection.AbstractSubCollection<T,I,SI,SC,C>,C extends rcf.core.util.collection.AbstractCollection<T,I,SI,SC,C>>, rcf.core.util.collection.AbstractCollection.SubCollection<T,I extends rcf.core.util.collection.iterator.FixedUniIterator<T>,SI extends rcf.core.util.collection.AbstractCollection.SubCollectionIterator<T,I,SI,SC,C>,SC extends rcf.core.util.collection.AbstractCollection.SubCollection<T,I,SI,SC,C>,C extends rcf.core.util.collection.AbstractCollection<T,I,SI,SC,C>>, rcf.core.util.collection.AbstractCollection.SubCollectionIterator<T,I extends rcf.core.util.collection.iterator.FixedUniIterator<T>,SI extends rcf.core.util.collection.AbstractCollection.SubCollectionIterator<T,I,SI,SC,C>,SC extends rcf.core.util.collection.AbstractCollection.SubCollection<T,I,SI,SC,C>,C extends rcf.core.util.collection.AbstractCollection<T,I,SI,SC,C>> |
| Nested classes/interfaces inherited from class rcf.core.util.collection.AbstractImmutableCollection |
|---|
rcf.core.util.collection.AbstractImmutableCollection.AbstractImmutableSubCollection<T,I extends rcf.core.util.collection.iterator.ImmutableFixedUniIterator<T>,SI extends rcf.core.util.collection.AbstractImmutableCollection.AbstractImmutableSubCollectionIterator<T,I,SI,SC,C>,SC extends rcf.core.util.collection.AbstractImmutableCollection.AbstractImmutableSubCollection<T,I,SI,SC,C>,C extends rcf.core.util.collection.AbstractImmutableCollection<T,I,SI,SC,C>>, rcf.core.util.collection.AbstractImmutableCollection.AbstractImmutableSubCollectionIterator<T,I extends rcf.core.util.collection.iterator.ImmutableFixedUniIterator<T>,SI extends rcf.core.util.collection.AbstractImmutableCollection.AbstractImmutableSubCollectionIterator<T,I,SI,SC,C>,SC extends rcf.core.util.collection.AbstractImmutableCollection.AbstractImmutableSubCollection<T,I,SI,SC,C>,C extends rcf.core.util.collection.AbstractImmutableCollection<T,I,SI,SC,C>>, rcf.core.util.collection.AbstractImmutableCollection.ImmutableSubCollection<T,I extends rcf.core.util.collection.iterator.ImmutableFixedUniIterator<T>,SI extends rcf.core.util.collection.AbstractImmutableCollection.ImmutableSubCollectionIterator<T,I,SI,SC,C>,SC extends rcf.core.util.collection.AbstractImmutableCollection.ImmutableSubCollection<T,I,SI,SC,C>,C extends rcf.core.util.collection.AbstractImmutableCollection<T,I,SI,SC,C>>, rcf.core.util.collection.AbstractImmutableCollection.ImmutableSubCollectionIterator<T,I extends rcf.core.util.collection.iterator.ImmutableFixedUniIterator<T>,SI extends rcf.core.util.collection.AbstractImmutableCollection.ImmutableSubCollectionIterator<T,I,SI,SC,C>,SC extends rcf.core.util.collection.AbstractImmutableCollection.ImmutableSubCollection<T,I,SI,SC,C>,C extends rcf.core.util.collection.AbstractImmutableCollection<T,I,SI,SC,C>> |
| Nested classes/interfaces inherited from interface rcf.core.util.filter.Filter |
|---|
rcf.core.util.filter.Filter.Type |
| Nested classes/interfaces inherited from interface rcf.core.util.filter.Filter |
|---|
rcf.core.util.filter.Filter.Type |
| Nested classes/interfaces inherited from interface rcf.core.util.filter.Filter |
|---|
rcf.core.util.filter.Filter.Type |
| Field Summary | |
|---|---|
protected static SoftReference<rcf.core.util.accessor.Accessor<? super Reference<EventSink>>> |
accessor
TODO: Javadoc |
protected Event |
current
TODO: Javadoc The current event, used to reduce the possibility for infinite loops of events which include multiple syndicates. |
| Fields inherited from class rcf.core.util.map.HashMap |
|---|
adapterInverse, core |
| Fields inherited from class rcf.core.util.collection.Hashtable |
|---|
isImmutable, loadFactor, max, min, resizeLower, resizeUpper, size, table |
| Fields inherited from class rcf.core.util.collection.AbstractCollection |
|---|
collectionEventTypes, currTrans, factory, prevTrans, sequenceNumber, syndicate |
| Fields inherited from class rcf.core.util.collection.AbstractImmutableCollection |
|---|
filter, hashCodeCache |
| Fields inherited from class rcf.core.util.filter.AbstractFilter |
|---|
filterInverse |
| Constructor Summary | |
|---|---|
|
HashEventSyndicate()
TODO: Javadoc |
protected |
HashEventSyndicate(HashEventSyndicate _copyFrom)
TODO: Javadoc |
| Method Summary | ||
|---|---|---|
|
add(Reference<EventSink<? super E>> _sinkReference,
Class<E> _class)
Register an event sink to receive all of the events from the EventSource for this syndicate, which are
assignable to the
specified class. |
|
protected rcf.core.util.collection.Hashtable.HashtableNode<ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>> |
addHashNode(ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>> o,
int robustHashCode,
boolean resize)
|
|
protected static rcf.core.util.accessor.Accessor<? super Reference<EventSink<? super Event>>> |
cachedAccessor()
TODO: Javadoc |
|
protected void |
changeHashNode(rcf.core.util.collection.Hashtable.HashtableNode<ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>> node,
ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>> o,
int robustHashCode)
|
|
HashEventSyndicate |
copy()
|
|
boolean |
event(Event event)
Called by an EventSyndicate to notify this sink that an event
has occured. |
|
|
remove(Reference<EventSink<? super E>> _sinkReference,
Class<E> _class)
Deregister an event sink to stop receiving events from the EventSource for this syndicate. |
|
| Methods inherited from class rcf.core.util.map.HashMap |
|---|
add, collectionA, collectionB, collectionPA, collectionPB, createIterator, createSubCollection, mapA, mapB, mapDefaultAdapter, post, pre, put, remove, typeAdapterInverse |
| Methods inherited from class rcf.core.util.collection.Hashtable |
|---|
add, addAll, clear, complement, createHashNode, filter, getStructuralModCount, hash, hashElement, incStructuralModCount, isImmutable, isUnique, lookupHashNode, remove, removeHashNode, resizeHashTable, robustHashCode, robustHashCode, size |
| Methods inherited from class rcf.core.util.collection.AbstractCollection |
|---|
archivableTransaction, collectionEventTypes, commitTransaction, complementAll, createCompositeTransaction, createdSyndicate, destroyedSyndicate, events, factory, filterInverse, getSequenceNumber, getValueModCount, incSequenceNumber, incValueModCount, isSyndicated, newTransaction, prepTransaction, syndicate, transaction, transaction |
| Methods inherited from class rcf.core.util.collection.AbstractImmutableCollection |
|---|
accessor, asAbstract, count, equals, filter, filterType, first, hashCode, isCompatible, isEmpty, isNative, ordering, toArray, toString |
| Methods inherited from class rcf.core.util.filter.AbstractFilter |
|---|
filterAll, filterAny |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface rcf.core.concurrent.events.EventSyndicate |
|---|
isEmpty, size |
| Methods inherited from interface rcf.core.util.collection.Collection |
|---|
add, addAll, clear, complement, complementAll, factory, remove |
| Methods inherited from interface rcf.core.util.collection.ImmutableCollection |
|---|
asAbstract, count, filter, filter, filterAll, filterAny, first, isUnique, ordering, toArray |
| Methods inherited from interface rcf.core.util.iterator.ImmutableIterable |
|---|
isCompatible, isEmpty, isNative, size |
| Methods inherited from interface rcf.core.util.filter.Filter |
|---|
equals, filterType |
| Methods inherited from interface rcf.core.util.accessor.Accessing |
|---|
accessor |
| Methods inherited from interface rcf.core.util.Immutable |
|---|
isImmutable |
| Methods inherited from interface rcf.core.util.collection.ModCount |
|---|
getStructuralModCount, getValueModCount, incStructuralModCount, incValueModCount |
| Methods inherited from interface rcf.core.util.iterator.ImmutableIterable |
|---|
isCompatible, isEmpty, isNative, size |
| Methods inherited from interface rcf.core.util.iterator.ImmutableIterable |
|---|
isCompatible, isEmpty, isNative, size |
| Methods inherited from interface rcf.core.util.filter.DynamicFilter |
|---|
filterInverse |
| Methods inherited from interface rcf.core.util.filter.Filter |
|---|
equals, filterType |
| Methods inherited from interface rcf.core.concurrent.transactions.Transactional |
|---|
transaction, transaction |
| Methods inherited from interface rcf.core.concurrent.events.EventSource |
|---|
events, getSequenceNumber, incSequenceNumber, isSyndicated, syndicate |
| Methods inherited from interface rcf.core.util.Immutable |
|---|
isImmutable |
| Methods inherited from interface rcf.core.util.collection.ImmutableCollection |
|---|
asAbstract, count, filter, filter, filterAll, filterAny, first, isUnique, ordering, toArray |
| Methods inherited from interface rcf.core.util.iterator.ImmutableIterable |
|---|
isCompatible, isEmpty, isNative, size |
| Methods inherited from interface rcf.core.util.filter.Filter |
|---|
equals, filterType |
| Methods inherited from interface rcf.core.util.accessor.Accessing |
|---|
accessor |
| Methods inherited from interface rcf.core.util.Immutable |
|---|
isImmutable |
| Field Detail |
|---|
protected Event current
add(Reference, Class).
When this field is not null, no event is being reported.
Before actually reporting an event the syndicate should check that it is
not == current in which case an exception should be thrown.
When an event is done being reported, this field should be set back to
null, but only if it is == to the event which
has just finished being reported. This check will ensure correctness
under multi-threading, but it does decrease the utility of these checks,
meaning that they are for debugging only, and cannot be relied upon to
catch all cases of infinite event loops.
Note that access to this field must be synchronized on this
syndicate.
protected static SoftReference<rcf.core.util.accessor.Accessor<? super Reference<EventSink>>> accessor
| Constructor Detail |
|---|
public HashEventSyndicate()
protected HashEventSyndicate(HashEventSyndicate _copyFrom)
_copyFrom - | Method Detail |
|---|
protected static final rcf.core.util.accessor.Accessor<? super Reference<EventSink<? super Event>>> cachedAccessor()
public HashEventSyndicate copy()
copy in interface rcf.core.util.collection.Collection<ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>>copy in interface rcf.core.util.collection.ImmutableCollection<ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>>copy in interface rcf.core.util.Copyablecopy in interface rcf.core.util.filter.DynamicFilter<ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>,rcf.core.util.collection.transaction.CollectionTransaction<ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>>>copy in interface rcf.core.util.map.pair.ImmutablePMapCollection<Reference<EventSink<? super Event>>,Class<Event>,ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>>copy in interface rcf.core.util.map.pair.PMapCollection<Reference<EventSink<? super Event>>,Class<Event>,ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>>copy in class rcf.core.util.map.HashMap<Reference<EventSink<? super Event>>,Class<Event>>
protected rcf.core.util.collection.Hashtable.HashtableNode<ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>> addHashNode(ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>> o,
int robustHashCode,
boolean resize)
addHashNode in class rcf.core.util.collection.Hashtable<ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>,rcf.core.util.collection.Hashtable.HashtableIterator,rcf.core.util.map.HashMap.SubHashMapIterator<Reference<EventSink<? super Event>>,Class<Event>>,rcf.core.util.map.HashMap.SubHashMap<Reference<EventSink<? super Event>>,Class<Event>>,rcf.core.util.map.HashMap<Reference<EventSink<? super Event>>,Class<Event>>>
protected void changeHashNode(rcf.core.util.collection.Hashtable.HashtableNode<ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>> node,
ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>> o,
int robustHashCode)
changeHashNode in class rcf.core.util.collection.Hashtable<ImmutablePairInterface<Reference<EventSink<? super Event>>,Class<Event>>,rcf.core.util.collection.Hashtable.HashtableIterator,rcf.core.util.map.HashMap.SubHashMapIterator<Reference<EventSink<? super Event>>,Class<Event>>,rcf.core.util.map.HashMap.SubHashMap<Reference<EventSink<? super Event>>,Class<Event>>,rcf.core.util.map.HashMap<Reference<EventSink<? super Event>>,Class<Event>>>
public <E extends Event> rcf.core.util.collection.iterator.FixedUniIterator<ImmutablePairInterface<Reference<EventSink<? super E>>,Class<E>>> add(Reference<EventSink<? super E>> _sinkReference,
Class<E> _class)
EventSyndicateEventSource for this syndicate, which are
assignable to the
specified class.
add in interface EventSyndicate_sinkReference - A reference to the event sink, which this
syndicate is supposed to call
EventSink.event(Event) on. Notice
that this is a reference, so that
WeakReferences
can be used to avoid having this syndicate
send events to an event sink which would
otherwise have been garbage collected._class - The class of events the EventSink
specified by _sinkReference
wants to receive from this syndicate.
Collection and
MapCollection.
public <E extends Event> rcf.core.util.collection.iterator.FixedUniIterator<ImmutablePairInterface<Reference<EventSink<? super E>>,Class<E>>> remove(Reference<EventSink<? super E>> _sinkReference,
Class<E> _class)
EventSyndicateEventSource for this syndicate.
remove in interface EventSyndicate_sinkReference - A reference to the event sink, which this
syndicate should no longer report events to.
Note that the
Reference.type()
of the reference is immaterial._class - The class of events the EventSink
specified by _sinkReference
was to receiving from this syndicate.
Collection and
MapCollection.public boolean event(Event event)
EventSinkEventSyndicate to notify this sink that an event
has occured.
event in interface EventSink<Event>event in interface EventSyndicateevent - The event which has occured.
true to keep receiving events from the source
of this event. false to stop receiving events
from the source of this event.EventSink.event(rcf.core.concurrent.events.Event)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||