mandala.jacob.remote.gpf
Class AbstractSingletonRemoteProxy
java.lang.Object
mandala.jacob.remote.AbstractRemote
mandala.jacob.remote.AbstractLocalReferenceRetriever
mandala.jacob.remote.gpf.AbstractSingletonRemoteProxy
- All Implemented Interfaces:
- LocalReferenceRetriever, Remote, java.io.Serializable
- Direct Known Subclasses:
- RemoteCollectionProxy, RemoteMapProxy
- public abstract class AbstractSingletonRemoteProxy
- extends AbstractLocalReferenceRetriever
Abstract base class for remote proxy with singleton
implementation.
This class contains two fields:
- the
client
field which is used in subclasses to
communicate whith a remote server;
- the
exporter
field which is used when an object must be
exported.
The singleton pattern for remote instances is defined as
follow:
if proxy(o)
represents a remote proxy on the remote object
o
then,
proxy1(o1)
== proxy2(o2)
if and only if o1
== o2
.
This class manages the singleton property. Any subclass must ensure that
super.readResove()
is invoked.
- Since:
- 2.3
- Version:
- $Revision: 1.2 $
- Author:
- eipi
- See Also:
Client
,
Exporter
,
AbstractRemoteProxy
,
Serialized Form
Method Summary |
protected java.lang.Object |
readResolve()
Ensure singleton on deserialization. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
client
protected final Client client
exporter
protected final Exporter exporter
readResolve
protected java.lang.Object readResolve()
throws java.io.ObjectStreamException
Ensure singleton on deserialization.
Subclasses may overwrite this method, but must call the one of this
class to prevent memory leak!
- Returns:
- an
Object
value
- Throws:
java.io.ObjectStreamException
- if an error occurs
toString
public java.lang.String toString()
- Overrides:
toString
in class AbstractLocalReferenceRetriever
Mandala help mailing list