mandala.jacob.remote
Class AbstractLocalReferenceRetriever

java.lang.Object
  extended bymandala.jacob.remote.AbstractRemote
      extended bymandala.jacob.remote.AbstractLocalReferenceRetriever
All Implemented Interfaces:
LocalReferenceRetriever, Remote, java.io.Serializable
Direct Known Subclasses:
AbstractSingletonRemoteProxy, mandala.jacob.remote.rmi.RMISingletonRemoteProxy

public abstract class AbstractLocalReferenceRetriever
extends AbstractRemote
implements LocalReferenceRetriever

Abstract base class for local reference retriever remote objects implementation.

This class manage the behaviour of the getLocalReference() method through its constructors and its finalize() method. Hence, subclasses must ensure that super.finalize() is called in order to prevent memory leak.

Since:
2.3
Version:
1.0
Author:
eipi
See Also:
Serialized Form

Field Summary
 
Fields inherited from class mandala.jacob.remote.AbstractRemote
defaultExceptionHandler, exceptionHandler, syslog
 
Constructor Summary
protected AbstractLocalReferenceRetriever(java.lang.Object localReference)
          Creates a new AbstractLocalReferenceRetriever.
protected AbstractLocalReferenceRetriever(java.lang.Object localReference, ExceptionHandler exceptionHandler)
          Creates a new LocalReferenceRetriever.
 
Method Summary
protected  void finalize()
           
 java.lang.Object getID()
          Returns the global unique identifier of this remote instance.
 java.lang.Object getLocalReference()
          Returns a local reference on the object this remote reference is refering to.
 java.lang.String toString()
           
 
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
 

Constructor Detail

AbstractLocalReferenceRetriever

protected AbstractLocalReferenceRetriever(java.lang.Object localReference)

Creates a new AbstractLocalReferenceRetriever.

The ExceptionHandler to use when an exception occurs is set to a new SyslogExceptionHandler instance.

Parameters:
localReference - the local reference this object is referring to
Throws:
java.lang.IllegalArgumentException - if localReference is an ExceptionHandler or is null
See Also:
SyslogExceptionHandler

AbstractLocalReferenceRetriever

protected AbstractLocalReferenceRetriever(java.lang.Object localReference,
                                          ExceptionHandler exceptionHandler)

Creates a new LocalReferenceRetriever.

Parameters:
localReference - the local reference this object is referring to
exceptionHandler - The ExceptionHandler to use when a remote exception occurs.
See Also:
ExceptionHandler, if localReference is null
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

getLocalReference

public java.lang.Object getLocalReference()
Description copied from interface: LocalReferenceRetriever

Returns a local reference on the object this remote reference is refering to.

Note that the caller must be on the same JVM than the local object in order to get a valid return, otherwise, null is returned.

Specified by:
getLocalReference in interface LocalReferenceRetriever
Returns:
the local reference if available

getID

public java.lang.Object getID()
Description copied from interface: LocalReferenceRetriever

Returns the global unique identifier of this remote instance.

Specified by:
getID in interface LocalReferenceRetriever
Returns:
the global identifier of this remote instance

toString

public java.lang.String toString()
Overrides:
toString in class AbstractRemote


Mandala help mailing list