equip.data
Class EventPatternImpl

java.lang.Object
  extended byequip.runtime.Object
      extended byequip.runtime.ValueBase
          extended byequip.data.ItemData
              extended byequip.data.EventPattern
                  extended byequip.data.EventPatternImpl
All Implemented Interfaces:
java.lang.Cloneable

public class EventPatternImpl
extends EventPattern

Implementation of IDL'd abstract class EventPattern


Field Summary
 
Fields inherited from class equip.data.EventPattern
deleteItemOnMatch, deleteOnCheck, deleteOnMatch, eventTemplates, itemTemplates, local, matched
 
Fields inherited from class equip.data.ItemData
id, name
 
Constructor Summary
EventPatternImpl()
           
 
Method Summary
 void initAsCompoundEventMonitor(Event[] eventTemplates, boolean local)
          convenience initialisation: version of initAsSimpleEventMonitor(equip.data.Event, boolean) for multiple event templates.
 void initAsCompoundItemMonitor(ItemData[] itemTemplates, boolean local)
          convenience initialisation: version of initAsSimpleItemMonitor(equip.data.ItemData, boolean) for multiple item templates.
 void initAsSimpleCollect(ItemData itemTemplate, boolean local)
          convenience initialisation: tuplespace collect - all matching items are returned and deleted (out) (NBonly works on local dataspace at present).
 void initAsSimpleCopyCollect(ItemData itemTemplate, boolean local)
          convenience initialisation: tuplespace copy-collect - all matching items are returned (read) (NBonly works on local dataspace at present).
 void initAsSimpleEventMonitor(Event eventTemplate, boolean local)
          convenience initialisation: ongoing monitor for simple events, rather than data items.
 void initAsSimpleItemMonitor(ItemData itemTemplate, boolean local)
          convenience initialisation: like an ongoing copy-collect: makes an event pattern for Add, update and delete events on the matching itemTemplate (works globally but asynchrnously).
 void initAsSimpleOut(ItemData itemTemplate, boolean local)
          convenience initialisation: tuplespace out - single matching item, which is atomically removed from the data space (NBonly works on local dataspace at present).
 void initAsSimpleRead(ItemData itemTemplate, boolean local)
          convenience initialisation: tuplespace read - single matching item (NBonly works on local dataspace at present).
 void initAsSimpleReadp(ItemData itemTemplate, boolean local)
          convenience initialisation: tuplespace readp (predicate) - single matching item, or null if no item is present at the moment (read waits for an item) (NBonly works on local dataspace at present).
 
Methods inherited from class equip.data.EventPattern
_equals_helper, _matches_helper, equals, getModuleName, matches, readObject, writeObject
 
Methods inherited from class equip.data.ItemData
_equals_helper, _matches_helper
 
Methods inherited from class equip.runtime.ValueBase
_equals_helper, _matches_helper, clone
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventPatternImpl

public EventPatternImpl()
Method Detail

initAsSimpleRead

public void initAsSimpleRead(ItemData itemTemplate,
                             boolean local)
Description copied from class: EventPattern
convenience initialisation: tuplespace read - single matching item (NBonly works on local dataspace at present). (deleteOnMatch)

Specified by:
initAsSimpleRead in class EventPattern

initAsSimpleReadp

public void initAsSimpleReadp(ItemData itemTemplate,
                              boolean local)
Description copied from class: EventPattern
convenience initialisation: tuplespace readp (predicate) - single matching item, or null if no item is present at the moment (read waits for an item) (NBonly works on local dataspace at present). (deleteOnMatch, deleteOnCheck)

Specified by:
initAsSimpleReadp in class EventPattern

initAsSimpleOut

public void initAsSimpleOut(ItemData itemTemplate,
                            boolean local)
Description copied from class: EventPattern
convenience initialisation: tuplespace out - single matching item, which is atomically removed from the data space (NBonly works on local dataspace at present). (deleteOnMatch, deleteItemOnMatch)

Specified by:
initAsSimpleOut in class EventPattern

initAsSimpleCopyCollect

public void initAsSimpleCopyCollect(ItemData itemTemplate,
                                    boolean local)
Description copied from class: EventPattern
convenience initialisation: tuplespace copy-collect - all matching items are returned (read) (NBonly works on local dataspace at present). (deleteOnCheck)

Specified by:
initAsSimpleCopyCollect in class EventPattern

initAsSimpleCollect

public void initAsSimpleCollect(ItemData itemTemplate,
                                boolean local)
Description copied from class: EventPattern
convenience initialisation: tuplespace collect - all matching items are returned and deleted (out) (NBonly works on local dataspace at present). (deleteOnCheck, deleteItemOnMatch)

Specified by:
initAsSimpleCollect in class EventPattern

initAsSimpleItemMonitor

public void initAsSimpleItemMonitor(ItemData itemTemplate,
                                    boolean local)
Description copied from class: EventPattern
convenience initialisation: like an ongoing copy-collect: makes an event pattern for Add, update and delete events on the matching itemTemplate (works globally but asynchrnously).

Using the ItemEventKind.EQDATA_KIND_PRESENT kind (or wildcard) this also returns items existing when the patterns is first added to a session. It will then return add/update/delete events matching until the pattern is removed.

This is the main method used for inter-dataspace replication, since a non-local item monitor will be copied to other connected dataspace replicas and cause matching items to be copied to and kept up to date in the originating dataspace.

Specified by:
initAsSimpleItemMonitor in class EventPattern

initAsCompoundItemMonitor

public void initAsCompoundItemMonitor(ItemData[] itemTemplates,
                                      boolean local)
Description copied from class: EventPattern
convenience initialisation: version of EventPattern.initAsSimpleItemMonitor(equip.data.ItemData, boolean) for multiple item templates.

Specified by:
initAsCompoundItemMonitor in class EventPattern

initAsSimpleEventMonitor

public void initAsSimpleEventMonitor(Event eventTemplate,
                                     boolean local)
Description copied from class: EventPattern
convenience initialisation: ongoing monitor for simple events, rather than data items.

Used for stateless event distribution, e.g. comparable to Elvin.

Specified by:
initAsSimpleEventMonitor in class EventPattern

initAsCompoundEventMonitor

public void initAsCompoundEventMonitor(Event[] eventTemplates,
                                       boolean local)
Description copied from class: EventPattern
convenience initialisation: version of EventPattern.initAsSimpleEventMonitor(equip.data.Event, boolean) for multiple event templates.

Specified by:
initAsCompoundEventMonitor in class EventPattern