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, 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()
and super.finalize()
are
invoked.
- Since:
- 2.3
- Version:
- $Revision: 1.1 $
- Author:
- eipi
- See Also:
Client
,
Exporter
,
AbstractRemoteProxy
,
Serialized Form
client
protected final Client client
exporter
protected final Exporter exporter
readResolve
protected Object readResolve()
throws 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:
ObjectStreamException
- if an error occurs
finalize
protected void finalize()
throws Throwable
- Overrides:
finalize
in class AbstractLocalReferenceRetriever
- Throws:
Throwable
toString
public String toString()
- Overrides:
toString
in class AbstractLocalReferenceRetriever
Mandala help mailing list