|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectequip.runtime.Object
equip.runtime.ValueBase
equip.net.ServiceProxy
equip.data.DataProxy
The main API for a dataspace replica, whether client or server.
Note that equip.data.beans provides an alternative and
simple Java API IDataspace for
dataspaces using this.
| Field Summary | |
ItemBinding[] |
initialItems
Internal - any initial data items to place into the dataspace (e.g. when de-serialised) |
| Fields inherited from class equip.net.ServiceProxy |
serviceMoniker |
| Constructor Summary | |
DataProxy()
Default no-arg constructor |
|
| Method Summary | |
boolean |
_equals_helper(DataProxy c)
Internal IDL-generated equality test helper |
boolean |
_matches_helper(DataProxy c)
Internal IDL-generated match test helper |
abstract void |
activateAsync()
Create a thread to repeatedly attempt to activate this dataspace (assuming that it is a client) whenever its activation fails. |
abstract void |
addEvent(Event event)
Add a new event into the dataspace. |
abstract void |
addItem(ItemData item,
int locked,
boolean processBound,
boolean local,
Lease itemLease)
add item event helper - create and publish an AddEvent. |
abstract void |
beginBusy()
this dangerous internal API lets you suspend the enactment of events; also make a matching call to endBusy().
|
abstract DataSession |
createSession(DataCallback callback,
ValueBase closure)
Create a new data session in which to express interest in events and data items and to get callbacks/notifications. |
abstract void |
deleteItem(GUID id,
boolean local)
delete item event helper - create and publish an DeleteEvent. |
abstract void |
deleteSession(DataSession session)
Delete a DataSession previously created with
createSession(equip.data.DataCallback, equip.runtime.ValueBase); effectively any remaining
EventPatterns will be removed. |
abstract void |
endBusy()
this dangerous internal API lets you resume the enactment of events; only call to match a previous call to beginBusy().
|
boolean |
equals(java.lang.Object c)
Standard IDL-generated equality test. |
abstract ItemData |
getItem(GUID id)
Get an ItemData from the local dataspace by item
GUID. |
abstract ItemBinding |
getItemBinding(GUID id)
Get an ItemBinding from the local dataspace by item
GUID. |
java.lang.String |
getModuleName()
IDL-generated helper routine to get module name (currently unimplemented). |
abstract GUID |
getResponsible()
Get this dataspace replica's 'responsible' GUID, which is a globally unique identifier for this dataspace replica. |
boolean |
matches(java.lang.Object c)
Standard IDL-generated template match test. |
abstract void |
queueEvent(Event event)
(always) Queued add of a new event into the dataspace. |
void |
readObject(ObjectInputStream in)
Internal IDL-generated serialisation helper. |
abstract void |
setDefaultAgent(GUID defaultAgentId)
Set a default GUID to be used as the default owner and/or requestor for locally generated events and data items. |
abstract void |
setPersist(boolean persistFlag)
Whether this dataspace replica should try to associate persistently with its server/peer. |
abstract void |
terminate()
Destroy this dataspace, terminating any communication and threads and (hopefully) allowing all resources to be released/GCed. |
abstract void |
updateItem(ItemData item,
boolean local,
boolean reliable)
update item event helper - create and publish an UpdateEvent with default priority (0).
|
abstract void |
updateItem2(ItemData item,
boolean local,
boolean reliable,
int priority)
update item event helper - create and publish an UpdateEvent.
|
abstract void |
waitForEvents(boolean local)
Block and wait for all pending events to be enacted. |
void |
writeObject(ObjectOutputStream out)
Internal IDL-generated serialisation helper. |
| Methods inherited from class equip.net.ServiceProxy |
_equals_helper, _matches_helper, activate, deactivate |
| 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 |
| Field Detail |
public ItemBinding[] initialItems
| Constructor Detail |
public DataProxy()
| Method Detail |
public abstract void activateAsync()
ServiceProxy.activate(equip.net.DeactivateCallback, equip.runtime.ValueBase) and ServiceProxy.deactivate() which are also implemented
for direct control over activation.
public abstract void setPersist(boolean persistFlag)
Lease mechanism to
handle garbage collection: use with care.
Note that replicas are identified to each other by the
responsible GUID of each.
persistFlag - Whether to connect persistently.public abstract void addEvent(Event event)
event - The event to published.public abstract void queueEvent(Event event)
event - The event to published.public abstract ItemBinding getItemBinding(GUID id)
ItemBinding from the local dataspace by item
GUID.
id - The item's GUID.
public abstract ItemData getItem(GUID id)
ItemData from the local dataspace by item
GUID.
id - The item's GUID.
public abstract void setDefaultAgent(GUID defaultAgentId)
defaultAgentId - GUID to use as default
owner/requestor
public abstract void addItem(ItemData item,
int locked,
boolean processBound,
boolean local,
Lease itemLease)
AddEvent.
item - The value of the new item (including id).locked - See ItemBindingInfo.locked.processBound - See ItemBindingInfo.processBound.local - See ItemBindingInfo.local.itemLease - See ItemBindingInfo.itemLease.
public abstract void updateItem2(ItemData item,
boolean local,
boolean reliable,
int priority)
UpdateEvent.
NOTE: if this is an item with a lease and you want the lease
to be renewed then use an addItem repeatedly instead (with
the new Lease value in the ItemBinding).
item - The new value of the item (including original id).local - See EventMetadata.local.reliable - See EventMetadata.reliable.priority - See EventMetadata.priority.
public abstract void updateItem(ItemData item,
boolean local,
boolean reliable)
UpdateEvent with default priority (0).
NOTE: if this is an item with a lease and you want the lease
to be renewed then use an addItem repeatedly instead (with
the new Lease value in the ItemBinding).
item - The new value of the item (including original id).local - See EventMetadata.local.reliable - See EventMetadata.reliable.
public abstract void deleteItem(GUID id,
boolean local)
DeleteEvent.
id - The GUID of the item to be deleted.local - See EventMetadata.local.public abstract void waitForEvents(boolean local)
local - Wait only for local events (if false, then
also send a message to the server dataspace and wait for
it to come back as well).
public abstract DataSession createSession(DataCallback callback,
ValueBase closure)
DataCallback and
(usually easier to use) DataCallbackPost.
callback - Event-handling subclass of DataCallback or DataCallbackPost, notified
about events matching any EventPatterns that
are added to new session.closure - Optional application parameter provided to the
callback notification (can be null).
DataSession to which EventPatterns can be added to cause replication and/or
notifications of events and items.public abstract void deleteSession(DataSession session)
DataSession previously created with
createSession(equip.data.DataCallback, equip.runtime.ValueBase); effectively any remaining
EventPatterns will be removed. In C++ the caller will still hold the last reference to the data session object, which must be released in order for the session object to actually be deleted.
session - The DataSession object returned
from createSession(equip.data.DataCallback, equip.runtime.ValueBase) to be deleted from the dataspace.public abstract void beginBusy()
endBusy().
Easy to deadlock with unmatched calls!
public abstract void endBusy()
beginBusy().
Easy to deadlock - or break synchronization - with unmatched calls!
public abstract GUID getResponsible()
public abstract void terminate()
public java.lang.String getModuleName()
getModuleName in class ServiceProxypublic boolean equals(java.lang.Object c)
equals in class ServiceProxyc - The object to be compared against this.
cpublic boolean _equals_helper(DataProxy c)
public boolean matches(java.lang.Object c)
matches in class ServiceProxyc - The object to be checked against this template.
this (as a template) matches the argumentpublic boolean _matches_helper(DataProxy c)
public void writeObject(ObjectOutputStream out)
throws java.io.IOException
ObjectInputStream and ObjectOutputStream only.
writeObject in class ServiceProxyjava.io.IOException
public void readObject(ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException,
java.lang.InstantiationException
ObjectInputStream and ObjectOutputStream only.
readObject in class ServiceProxyjava.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||