public class EntryRep extends Object implements StorableResource<EntryRep>, LeasedResource, Serializable
EntryRep
object contains a packaged
Entry
object for communication between the client and a
JavaSpace
.JavaSpace
,
Entry
,
Serialized FormConstructor and Description |
---|
EntryRep()
Used in recovery
|
EntryRep(net.jini.core.entry.Entry entry)
Create a serialized form of the entry with our object's
relevant fields set.
|
Modifier and Type | Method and Description |
---|---|
String |
classFor() |
net.jini.core.entry.Entry |
entry() |
boolean |
equals(Object o)
To be equal, the other object must by an
EntryRep for
an object of the same class with the same values for each field. |
net.jini.id.Uuid |
getCookie() |
long |
getExpiration() |
long |
getHash() |
long[] |
getHashes() |
int |
hashCode() |
net.jini.id.Uuid |
id() |
boolean |
isAtLeastA(String otherClass) |
static String |
matchAnyClassName() |
static EntryRep |
matchAnyEntryRep()
The
EntryRep that marks a ``match any'' request. |
boolean |
matches(EntryRep other)
See if the other object matches the template object this
represents.
|
int |
numFields() |
void |
pickID()
Pick a random
Uuid and set our id field to it. |
EntryRep |
restore(ObjectInputStream in)
Restore the persistent fields and return new instance.
|
void |
setExpiration(long newExpiration) |
void |
shareWith(EntryRep other)
Set this entry's generic data to be shared with the
other
object. |
void |
store(ObjectOutputStream out)
Store the persistent fields
|
String[] |
superclasses() |
String |
toString() |
net.jini.io.MarshalledInstance |
value(int fieldNum) |
public EntryRep(net.jini.core.entry.Entry entry) throws MarshalException
MarshalException
public EntryRep()
public void shareWith(EntryRep other)
other
object. Those fields that are object references that will be the same
for all objects of the same type are shared this way.
Note that codebase
is not shared. If it were,
then the failure of one codebase could make all entries inaccessible.
Each entry is usable insofar as the codebase under which it was
written is usable.
other
- object to share this entry's generic data with.public static EntryRep matchAnyEntryRep()
EntryRep
that marks a ``match any'' request.
This is used to represent a null
template.public static String matchAnyClassName()
public net.jini.core.entry.Entry entry() throws net.jini.core.entry.UnusableEntryException
Entry
object built out of this
EntryRep
This is used by the client-side proxy to
convert the EntryRep
it gets from the space server
into the actual Entry
object it represents.net.jini.core.entry.UnusableEntryException
- One or more fields in the entry cannot be
deserialized, or the class for the entry type
itself cannot be deserialized.public boolean equals(Object o)
EntryRep
for
an object of the same class with the same values for each field.
This is not a template match -- see matches
.equals
in class Object
matches(org.apache.river.outrigger.proxy.EntryRep)
public net.jini.id.Uuid id()
public void pickID()
Uuid
and set our id field to it.IllegalStateException
- if this method has already
been called.public net.jini.io.MarshalledInstance value(int fieldNum)
MarshalledObject
for the given field.public int numFields()
public String classFor()
public String[] superclasses()
public long getHash()
public long[] getHashes()
public boolean matches(EntryRep other)
other
- object to check if it matches this objects template.public boolean isAtLeastA(String otherClass)
otherClass
- class name of class or interface this is the same or
superclass of the object that this EntryRep represents.true
if this entry represents an object that
is at least the type of the otherClass
.public void setExpiration(long newExpiration)
setExpiration
in interface LeasedResource
public long getExpiration()
getExpiration
in interface LeasedResource
public net.jini.id.Uuid getCookie()
getCookie
in interface LeasedResource
public void store(ObjectOutputStream out) throws IOException
StorableObject
store
in interface StorableObject<EntryRep>
out
- ObjectOutputStream in which to store the object.IOException
- if an IO related exception occurs.public EntryRep restore(ObjectInputStream in) throws IOException, ClassNotFoundException
StorableObject
restore
in interface StorableObject<EntryRep>
in
- ObjectInputStream from which to read the object.IOException
- if an IO related exception occurs.ClassNotFoundException
- if class of object is not found.Copyright © 2016–2018. All rights reserved.