mandala.jacob.remote.gpf
Class AbstractSingletonRemoteProxy

java.lang.Object
  extended bymandala.jacob.remote.AbstractRemote
      extended bymandala.jacob.remote.AbstractLocalReferenceRetriever
          extended bymandala.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 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

Nested Class Summary
 
Nested classes inherited from class mandala.jacob.remote.AbstractRemote
AbstractRemote.ExceptionInfo
 
Field Summary
protected  Client client
           
protected  Exporter exporter
           
 
Fields inherited from class mandala.jacob.remote.AbstractRemote
defaultExceptionHandler, exceptionHandler, syslog
 
Method Summary
protected  void finalize()
           
protected  Object readResolve()
          Ensure singleton on deserialization.
 String toString()
           
 
Methods inherited from class mandala.jacob.remote.AbstractLocalReferenceRetriever
getID, getLocalReference
 
Methods inherited from class mandala.jacob.remote.AbstractRemote
getDefaultExceptionHandler, getExceptionHandler, getSyslog, handleException, setDefaultExceptionHandler, setExceptionHandler, setSyslog
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mandala.jacob.remote.Remote
getExceptionHandler, setExceptionHandler
 

Field Detail

client

protected final Client client

exporter

protected final Exporter exporter
Method Detail

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