org.sapia.ubik.rmi.server
Class RemoteRefReliable

java.lang.Object
  extended by org.sapia.ubik.rmi.server.RemoteRef
      extended by org.sapia.ubik.rmi.server.RemoteRefEx
          extended by org.sapia.ubik.rmi.server.RemoteRefReliable
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.reflect.InvocationHandler, HealthCheck, StubInvocationHandler

public class RemoteRefReliable
extends RemoteRefEx
implements HealthCheck

A stub handler that manages reconnecting to another server instance provided a method call fails.

Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

See Also:
Serialized Form

Field Summary
protected  java.lang.String _url
           
 
Fields inherited from class org.sapia.ubik.rmi.server.RemoteRef
_callBack, _isFirstVoyage, _lock, _oid, _pool, _serverAddress, _vmId
 
Constructor Summary
RemoteRefReliable()
          Constructor for StubHandlerReliable.
RemoteRefReliable(OID oid, ServerAddress serverAddress)
          Creates an instance of this class, with the given object and host identifiers.
 
Method Summary
protected  java.lang.Object doFailOver(java.lang.Object obj, java.lang.reflect.Method toCall, java.lang.Object[] params, java.lang.Throwable err)
          Implements fail-over logic.
 java.lang.Object invoke(java.lang.Object obj, java.lang.reflect.Method toCall, java.lang.Object[] params)
           
protected  java.lang.Object onShutdown(java.lang.Object proxy, java.lang.reflect.Method toCall, java.lang.Object[] params)
           
 void readExternal(java.io.ObjectInput in)
           
 void setUp(java.lang.String url)
          Sets this handler's server URL.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.sapia.ubik.rmi.server.RemoteRef
getOid, getOID, getServerAddress, initPool, isCallBack, isValid, sendCommand, setCallBack, toStubContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sapia.ubik.rmi.server.HealthCheck
isValid
 

Field Detail

_url

protected java.lang.String _url
Constructor Detail

RemoteRefReliable

public RemoteRefReliable()
Constructor for StubHandlerReliable.


RemoteRefReliable

public RemoteRefReliable(OID oid,
                         ServerAddress serverAddress)
Creates an instance of this class, with the given object and host identifiers.

Parameters:
oid - an OID
serverAddress - a ServerAddress
Method Detail

setUp

public void setUp(java.lang.String url)
Sets this handler's server URL.

Parameters:
url - a URL string.

invoke

public java.lang.Object invoke(java.lang.Object obj,
                               java.lang.reflect.Method toCall,
                               java.lang.Object[] params)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Overrides:
invoke in class RemoteRefEx
Throws:
java.lang.Throwable
See Also:
InvocationHandler.invoke(Object, Method, Object[])

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class RemoteRef
Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
Externalizable.readExternal(ObjectInput)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class RemoteRef
Throws:
java.io.IOException
See Also:
Externalizable.writeExternal(ObjectOutput)

onShutdown

protected java.lang.Object onShutdown(java.lang.Object proxy,
                                      java.lang.reflect.Method toCall,
                                      java.lang.Object[] params)
                               throws java.lang.Throwable
Overrides:
onShutdown in class RemoteRefEx
Throws:
java.lang.Throwable
See Also:
RemoteRefEx.onShutdown(Object, Method, Object[])

doFailOver

protected java.lang.Object doFailOver(java.lang.Object obj,
                                      java.lang.reflect.Method toCall,
                                      java.lang.Object[] params,
                                      java.lang.Throwable err)
                               throws java.lang.Throwable
Implements fail-over logic.

Throws:
java.lang.Throwable


Copyright © 2010 Sapia OSS. All Rights Reserved.