|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IJSpace
This interface represents the application view of a GigaSpace instance. It is implemented by all the Space Proxies (Embedded, Remote and Cluster).
When client receives a proxy to the space from the Lookup Service (see
SpaceFinder, this proxy implements this interface, and therefore may
be casted to this interface if specific GigaSpaces methods (such as
clean()) are required.
Since this interface extends the JavaSpace interface, standard
JavaSpaces methods may be invoked without downcasting.
Scenario B: Fetching a POJO from the space using methods read(), readMultiple(),
readIfExists(), take(), takeMultiple(), takeIfExists() etc:
1. When the POJO has no key property declared, it then will be returned without any UID. It
means that only read() and write() operations can be executed on the POJO and
NOT an update().
2. When the POJO has a key property declared, it then will
be returned with the source value of the property but without the generated
UID. The POJO can not approach the UID which was generated by the space. 3.
The POJO has a property which declared as a key and auto generate - The space
returns the POJO with the generated UID into the property.
IJSpaceContainer,
SpaceFinder| Field Summary |
|---|
| Fields inherited from interface net.jini.space.JavaSpace |
|---|
NO_WAIT |
| Method Summary | |
|---|---|
void |
clean()
Cleans this space. |
void |
clear(Entry template,
Transaction txn)
Removes the entries that match the specified template and the specified transaction from this space. |
void |
clear(Object template,
Transaction txn)
Removes the objects that match the specified template and the specified transaction from this space. |
int |
count(Entry tmpl,
Transaction txn)
Count any matching entry from the space, visible under the specified transaction. |
int |
count(Entry tmpl,
Transaction txn,
int modifiers)
Count (according to the modifiers) any matching entry from
the space, visible under the specified transaction. |
int |
count(Object tmpl,
Transaction txn)
Count any matching object from the space, visible under the specified transaction. |
int |
count(Object tmpl,
Transaction txn,
int modifiers)
Count (according to the modifiers) any matching object
from the space, visible under the specified transaction. |
void |
dropClass(String className)
Drops all Class's entries and all its templates from the space. |
Object |
getAdmin()
Returns the admin object to the remote part of this space. |
IJSpaceContainer |
getContainer()
Returns the container proxy this space resides in. |
SpaceURL |
getFinderURL()
Returns the SpaceURL object which was used as the argument for SpaceFinder#find(SpaceURL)
while looking for the space. |
String |
getName()
Returns the name of this space. |
int |
getReadModifiers()
Gets the proxy ReadModifiers. |
int |
getReadTakeModifiers()
Deprecated. use getReadModifiers() instead |
Uuid |
getReferentUuid()
Returns the unique uid of this space instance. |
IStubHandler |
getStubHandler()
Returns the StubHandler of this space. |
int |
getUpdateModifiers()
Gets the proxyUpdateModifiers. |
SpaceURL |
getURL()
Returns the SpaceURL instance which was used to initialize the space. |
boolean |
isEmbedded()
Checks whether proxy is connected to embedded or remote space. |
boolean |
isFifo()
Returns true if this proxy FIFO enabled, otherwise false. |
boolean |
isNOWriteLeaseMode()
Checks the write mode. |
boolean |
isOptimisticLockingEnabled()
Returns status of Optimistic Lock protocol. |
boolean |
isSecured()
Returns an indication : is this space secured. |
EventRegistration |
notify(Entry template,
Transaction txn,
RemoteEventListener listener,
long lease,
MarshalledObject handback,
int notifyType)
An extension to the standard JavaSpace.notify()
method. |
EventRegistration |
notify(Object template,
Transaction txn,
long lease,
com.gigaspaces.events.NotifyInfo info)
|
EventRegistration |
notify(Object template,
Transaction txn,
RemoteEventListener listener,
long lease,
MarshalledObject handback)
When objects that match this template are written, notification is sent to the given listener with a RemoteEvent that includes the handback object. |
EventRegistration |
notify(Object template,
Transaction txn,
RemoteEventListener listener,
long lease,
MarshalledObject handback,
int modifiers)
An extension to the standard JavaSpace.notify()
method. |
void |
ping()
Checks whether the space is alive and accessible. |
Entry |
read(Entry tmpl,
Transaction txn,
long timeout,
int modifiers)
Read (according to the modifiers) any matching entry from
the space, blocking until one exists. |
Object |
read(Object tmpl,
Transaction txn,
long timeout)
Read any matching object from the space, blocking until one exists. |
Object |
read(Object tmpl,
Transaction txn,
long timeout,
int modifiers)
Read (according to the modifiers) any matching object from
the space, blocking until one exists. |
Entry |
readIfExists(Entry tmpl,
Transaction txn,
long timeout,
int modifiers)
Read (according to the modifiers) any matching entry from
the space, returning null if there currently is none. |
Object |
readIfExists(Object tmpl,
Transaction txn,
long timeout)
Read any matching object from the space, returning null if there currently is none. |
Object |
readIfExists(Object tmpl,
Transaction txn,
long timeout,
int modifiers)
Read (according to the modifiers) any matching object from
the space, returning null if there currently is none. |
Entry[] |
readMultiple(Entry tmpl,
Transaction txn,
int limit)
Read any matching entries from the space. |
Entry[] |
readMultiple(Entry tmpl,
Transaction txn,
int limit,
int modifiers)
Read (according to the modifiers) any matching entries
from the space. |
Object[] |
readMultiple(Object tmpl,
Transaction txn,
int limit)
Read any matching objects from the space. |
Object[] |
readMultiple(Object tmpl,
Transaction txn,
int limit,
int modifiers)
Read (according to the modifiers) any matching objects
from the space. |
Object[] |
replace(Entry template,
Entry newEntry,
Transaction txn,
long lease)
Deprecated. use instead: update(Entry, Transaction, long, long, int) |
void |
setDefaultTransaction(Transaction txn)
Sets default transaction to use in case that null parameter is used as transaction parameter with JavaSpace methods. |
void |
setFifo(boolean enabled)
Sets FIFO mode for proxy. |
void |
setNOWriteLeaseMode(boolean noWriteLeaseMode)
If set to true, Lease object will not return from
write/writeMultiple operations. |
void |
setOptimisticLocking(boolean enabled)
Enable/Disable Optimistic Lock protocol. |
int |
setReadModifiers(int readModifiers)
Sets the read mode modifiers for proxy level. |
int |
setReadTakeModifiers(int newModifiers)
Deprecated. use setReadModifiers(int) instead |
void |
setSecurityContext(SecurityContext sc)
This function is called by the client (usually at the beginning of the session) in order to set a security context for the following operations. |
int |
setUpdateModifiers(int newModifiers)
Sets the update mode modifiers for proxy level. |
Object |
snapshot(Object object)
The process of serializing an entry for transmission to a JavaSpaces service will be identical if the same entry is used twice. |
Object |
take(Object tmpl,
Transaction transaction,
long timeout)
Take any matching entry from the space, blocking until one exists. |
Object |
takeIfExists(Object tmpl,
Transaction transaction,
long timeout)
Take any matching object from the space, returning null if there currently is none. |
Entry[] |
takeMultiple(Entry template,
Transaction txn,
int limit)
Takes all the entries matching the specified template from this space. |
Object[] |
takeMultiple(Object template,
Transaction txn,
int limit)
Takes all the entries matching the specified template from this space. |
Object[] |
update(Entry template,
Entry newEntry,
Transaction txn,
long lease)
Deprecated. use instead: update(Entry, Transaction, long, long, int) |
Entry |
update(Entry template,
Entry updatedEntry,
Transaction transaction,
long lease,
long timeout)
Deprecated. use instead: update(Entry, Transaction, long, long, int) |
Entry |
update(Entry updatedEntry,
Transaction transaction,
long lease,
long timeout)
Equivalent to calling update(Entry, Transaction, long, long, int) with
modifiers (if any) set by setUpdateModifiers(int). |
Entry |
update(Entry updatedEntry,
Transaction transaction,
long lease,
long timeout,
boolean writeIfAbsent)
Deprecated. use instead update(Entry, Transaction, long, long, int) with
UpdateModifiers.UPDATE_OR_WRITE modifier which is equivalent to setting
writeIfAbsent=true. |
Entry |
update(Entry updatedEntry,
Transaction transaction,
long lease,
long timeout,
int updateModifiers)
Equivalent to calling update(Object, Transaction, long, long, int) by use of
a cast from Entry to Object. see it also as a reference to further semantics of this method. |
Object |
update(Object updatedEntry,
Transaction transaction,
long lease,
long timeout)
Equivalent to calling update(Object, Transaction, long, long, int) with
modifiers (if any) set by setUpdateModifiers(int). |
Object |
update(Object updatedEntry,
Transaction transaction,
long lease,
long timeout,
int updateModifiers)
An update operation against a space entity which it's UID is known, blocking if locked under another transaction. |
Object[] |
updateMultiple(Entry[] entries,
Transaction transaction,
long[] leases)
Equivalent to calling updateMultiple(Entry[], Transaction, long[], int) with
modifiers (if any) set by setUpdateModifiers(int). |
Object[] |
updateMultiple(Entry[] entries,
Transaction transaction,
long[] leases,
int updateModifiers)
Equivalent to calling updateMultiple(Object[], Transaction, long[], int) by use of an
array of Object[] constructed as new Entry[]. see it also as a reference
to further semantics of this method. |
Object[] |
updateMultiple(Object[] entries,
Transaction transaction,
long[] leases)
Equivalent to calling updateMultiple(Object[], Transaction, long[], int) with
modifiers (if any) set by setUpdateModifiers(int). |
Object[] |
updateMultiple(Object[] objects,
Transaction transaction,
long[] leases,
int updateModifiers)
Same as a single update but for a group of entities sharing the same transaction (if any), applied with the same operation modifier (or default Modifiers.NONE). |
LeaseContext |
write(Object object,
Transaction transaction,
long lease)
Equivalent to calling write(Object, Transaction, long, long, int) with the
UpdateModifiers.UPDATE_OR_WRITE. |
LeaseContext |
write(Object object,
Transaction transaction,
long lease,
long timeout,
int modifiers)
Writes a new object to the space, returning its Lease. |
Lease[] |
writeMultiple(Entry[] entries,
Transaction txn,
long lease)
Writes the specified entries to this space. |
LeaseContext[] |
writeMultiple(Object[] objects,
Transaction txn,
long lease)
Writes the specified objects to this space. |
| Methods inherited from interface net.jini.space.JavaSpace |
|---|
notify, read, readIfExists, snapshot, take, takeIfExists, write |
| Method Detail |
|---|
String getName()
IJSpace aSpace = (IJSpace)SpaceFinder.find("jini://lookup-host/container-name/");
String name = aSpace.getName();
int count(Entry tmpl,
Transaction txn)
throws UnusableEntryException,
TransactionException,
RemoteException
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
RemoteException - if a communication error occurs
int count(Entry tmpl,
Transaction txn,
int modifiers)
throws UnusableEntryException,
TransactionException,
RemoteException
modifiers) any matching entry from
the space, visible under the specified transaction.
Overloads count(Entry, Transaction) by adding a
modifiers parameter. Equivalent when called with the default
modifier - ReadModifiers#REPEATABLE_READ. Modifiers are used
to define the behavior of a read operation.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.modifiers - one or a union of ReadModifiers.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
RemoteException - if a communication error occurs
int count(Object tmpl,
Transaction txn)
throws UnusableEntryException,
TransactionException,
RemoteException
Overloads count(Entry, Transaction) by replacing the
Entry template with Object, to support Plain Old
Java Object templates. Equivalent when called with an Entry cast to
Object.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
RemoteException - if a communication error occurs
int count(Object tmpl,
Transaction txn,
int modifiers)
throws UnusableEntryException,
TransactionException,
RemoteException
modifiers) any matching object
from the space, visible under the specified transaction.
Overloads count(Object, Transaction) by adding a
modifiers parameter. Equivalent when called with the default
modifier - ReadModifiers#REPEATABLE_READ. Modifiers are used
to define the behavior of a read operation.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.modifiers - one or a union of ReadModifiers.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
RemoteException - if a communication error occurs
Entry read(Entry tmpl,
Transaction txn,
long timeout,
int modifiers)
throws UnusableEntryException,
TransactionException,
InterruptedException,
RemoteException
modifiers) any matching entry from
the space, blocking until one exists. Return null if the
timeout expires.
Overloads JavaSpace.read(Entry, Transaction, long) by adding a
modifiers parameter. Equivalent when called with the default
modifier - ReadModifiers#REPEATABLE_READ. Modifiers are used
to define the behavior of a read operation.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.timeout - How long the client is willing to wait for a
transactionally proper matching entry. A timeout of
JavaSpace.NO_WAIT means to wait no time at all; this is
equivalent to a wait of zero.modifiers - one or a union of ReadModifiers.
UnusableEntryException - if any serialized field of the entry being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
InterruptedException - if the thread in which the read occurs is
interrupted
RemoteException - if a communication error occursJavaSpace.read(Entry, Transaction, long)
Object read(Object tmpl,
Transaction txn,
long timeout)
throws UnusableEntryException,
TransactionException,
InterruptedException,
RemoteException
Overloads JavaSpace.read(Entry, Transaction, long) by replacing
the Entry template with Object, to support Plain
Old Java Object templates. Equivalent when called with an Entry cast to
Object.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.timeout - How long the client is willing to wait for a
transactionally proper matching object. A timeout of
JavaSpace.NO_WAIT means to wait no time at all; this is
equivalent to a wait of zero.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
InterruptedException - if the thread in which the read occurs is
interrupted
RemoteException - if a communication error occursJavaSpace.read(Entry, Transaction, long)
Object read(Object tmpl,
Transaction txn,
long timeout,
int modifiers)
throws UnusableEntryException,
TransactionException,
InterruptedException,
RemoteException
modifiers) any matching object from
the space, blocking until one exists. Return null if the
timeout expires.
Overloads read(Object, Transaction, long) by adding a
modifiers parameter. Equivalent when called with the default
modifier - ReadModifiers#REPEATABLE_READ. Modifiers are used
to define the behavior of a read operation.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.timeout - How long the client is willing to wait for a
transactionally proper matching object. A timeout of
JavaSpace.NO_WAIT means to wait no time at all; this is
equivalent to a wait of zero.modifiers - one or a union of ReadModifiers.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
InterruptedException - if the thread in which the read occurs is
interrupted
RemoteException - if a communication error occursread(Object, Transaction, long)
Entry readIfExists(Entry tmpl,
Transaction txn,
long timeout,
int modifiers)
throws UnusableEntryException,
TransactionException,
InterruptedException,
RemoteException
modifiers) any matching entry from
the space, returning null if there currently is none. Matching
and timeouts are done as in read, except that blocking in this
call is done only if necessary to wait for transactional state to settle.
Overloads JavaSpace.readIfExists(Entry, Transaction, long) by
adding a modifiers parameter. Equivalent when called with the
default modifier - ReadModifiers#REPEATABLE_READ. Modifiers
are used to define the behavior of a read operation.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.timeout - How long the client is willing to wait for a
transactionally proper matching entry. A timeout of
JavaSpace.NO_WAIT means to wait no time at all; this is
equivalent to a wait of zero.modifiers - one or a union of ReadModifiers.
UnusableEntryException - if any serialized field of the entry being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
InterruptedException - if the thread in which the read occurs is
interrupted
RemoteException - if a communication error occursJavaSpace.readIfExists(Entry, Transaction, long),
read(Entry, Transaction, long, int)
Object readIfExists(Object tmpl,
Transaction txn,
long timeout)
throws UnusableEntryException,
TransactionException,
InterruptedException,
RemoteException
Overloads JavaSpace.readIfExists(Entry, Transaction, long) by
replacing the Entry template with Object, to
support Plain Old Java Object templates. Equivalent when called with an
Entry cast to Object.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.timeout - How long the client is willing to wait for a
transactionally proper matching object. A timeout of
JavaSpace.NO_WAIT means to wait no time at all; this is
equivalent to a wait of zero.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
InterruptedException - if the thread in which the read occurs is
interrupted
RemoteException - if a communication error occursJavaSpace.readIfExists(Entry, Transaction, long),
read(Entry, Transaction, long, int)
Object readIfExists(Object tmpl,
Transaction txn,
long timeout,
int modifiers)
throws UnusableEntryException,
TransactionException,
InterruptedException,
RemoteException
modifiers) any matching object from
the space, returning null if there currently is none. Matching
and timeouts are done as in read, except that blocking in this
call is done only if necessary to wait for transactional state to settle.
Overloads readIfExists(Object, Transaction, long) by adding a
modifiers parameter. Equivalent when called with the default
modifier - ReadModifiers#REPEATABLE_READ. Modifiers are used
to define the behavior of a read operation.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.timeout - How long the client is willing to wait for a
transactionally proper matching object. A timeout of
JavaSpace.NO_WAIT means to wait no time at all; this is
equivalent to a wait of zero.modifiers - one or a union of ReadModifiers.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
InterruptedException - if the thread in which the read occurs is
interrupted
RemoteException - if a communication error occursreadIfExists(Object, Transaction, long),
read(Object, Transaction, long, int)
Entry[] readMultiple(Entry tmpl,
Transaction txn,
int limit)
throws TransactionException,
UnusableEntryException,
RemoteException
JavaSpace.NO_WAIT). Returns an
array with matches bound by limit. Returns an
empty array if no match was found.
Note: Each matching entry has to be explicitly cast.
Entry[] results = ijspace.readMultiple( new MyEntry(), (Transaction)null, Integer.MAX_VALUE );
for (int i=0; i<results.length; i++)
{
System.out.println( (MyEntry)results[i]) );
}
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.limit - a limit on the number of entries to be returned. Use
Integer.MAX_VALUE for the uppermost limit.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
RemoteException - if a communication error occurs
Entry[] readMultiple(Entry tmpl,
Transaction txn,
int limit,
int modifiers)
throws TransactionException,
UnusableEntryException,
RemoteException
modifiers) any matching entries
from the space. Matching is done as in read without timeout (JavaSpace.NO_WAIT).
Returns an array with matches bound by limit.
Returns an empty array if no match was found.
Overloads readMultiple(Entry, Transaction, int) by adding a
modifiers parameter. Equivalent when called with the default
modifier - ReadModifiers#REPEATABLE_READ. Modifiers are used
to define the behavior of a read operation.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.limit - a limit on the number of entries to be returned. Use
Integer.MAX_VALUE for the uppermost limit.modifiers - one or a union of ReadModifiers.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
RemoteException - if a communication error occursreadMultiple(Entry, Transaction, int)
Object[] readMultiple(Object tmpl,
Transaction txn,
int limit)
throws TransactionException,
UnusableEntryException,
RemoteException
JavaSpace.NO_WAIT). Returns an
array with matches bound by limit. Returns an
empty array if no match was found.
Overloads readMultiple(Entry, Transaction, int) by replacing
the Entry template with Object, to support Plain
Old Java Object templates. Equivalent when called with an Entry[] cast to
Object[].
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.limit - a limit on the number of objects to be returned. Use
Integer.MAX_VALUE for the uppermost limit.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
RemoteException - if a communication error occursreadMultiple(Entry, Transaction, int)
Object[] readMultiple(Object tmpl,
Transaction txn,
int limit,
int modifiers)
throws TransactionException,
UnusableEntryException,
RemoteException
modifiers) any matching objects
from the space. Matching is done as in read without timeout (JavaSpace.NO_WAIT).
Returns an array with matches bound by limit.
Returns an empty array if no match was found.
Overloads readMultiple(Object, Transaction, int) by adding a
modifiers parameter. Equivalent when called with the default
modifier - ReadModifiers#REPEATABLE_READ. Modifiers are used
to define the behavior of a read operation.
tmpl - The template used for matching. Matching is done against
tmpl with null fields being
wildcards ("match anything") other fields being values ("match
exactly on the serialized form").txn - The transaction (if any) under which to work.limit - a limit on the number of objects to be returned. Use
Integer.MAX_VALUE for the uppermost limit.modifiers - one or a union of ReadModifiers.
UnusableEntryException - if any serialized field of the object being
read cannot be deserialized for any reason
TransactionException - if a transaction error occurs
RemoteException - if a communication error occursreadMultiple(Object, Transaction, int)
void clean()
throws RemoteException
IJSpace aSpace = (IJSpace)SpaceFinder.find("jini://lookup-host/container-name/space-name");
aSpace.clean();
RemoteException - if a communication error occurs
Object getAdmin()
throws RemoteException
// get a list of classes and the number of entries of each class
IRemoteJSpaceAdmin spaceAdmin = (IRemoteJSpaceAdmin)space.getAdmin();
Object classList[] = spaceAdmin.getRuntimeInfo().m_ClassNames.toArray();
List numOFEntries = spaceAdmin.getRuntimeInfo().m_NumOFEntries;
RemoteException - if a communication error occurs
void ping()
throws RemoteException
IJSpace aSpace = (IJSpace)SpaceFinder.find("jini://lookup-host/container-name/space-name");
try{
aSpace.ping();
System.out.println("Space alive");
}
catch (java.rmi.RemoteException re) {
System.out.println("Space unreachable");
}
RemoteException - when space was unreachable
Object[] replace(Entry template,
Entry newEntry,
Transaction txn,
long lease)
throws TransactionException,
UnusableEntryException,
RemoteException
update(Entry, Transaction, long, long, int)
IJSpace aSpace = (IJSpace)The replace method is not atomic (unless used with transaction) which means that the former call equals to:SpaceFinder.find("jini://lookup-host/container-name/space-name"); Message tmpl = new Message("Hello World"); Message msg = new Message("Goodbye World"); Object[] result = aSpace.replace(tmpl, msg, null, Lease.FOREVER); Message old = (Message)result[0]; long msgLease = ((Lease)result[1]).getExpiration();Message old = (Message)aSpace.take(tmpl, null,JavaSpace.NO_WAIT); Lease lease = aSpace.write(msg, null,Lease.FOREVER);
template - the template to use for matching.newEntry - the value of the new entry.txn - the transaction under which to perform the operation.lease - the lease time of the new entry
null is returned.
TransactionException - if a transaction error occurs
UnusableEntryException - if any serialized field of the entry being read cannot be deserialized for any reason
RemoteException - if a communication error occurs
IllegalArgumentException - if the lease time requested is not Lease.ANY and is negativeupdate(Entry, Entry, Transaction, long)
Object update(Object updatedEntry,
Transaction transaction,
long lease,
long timeout)
throws TransactionException,
UnusableEntryException,
RemoteException,
InterruptedException
update(Object, Transaction, long, long, int) with
modifiers (if any) set by setUpdateModifiers(int).
updatedEntry - the new value of the entry, must contain the UID.transac