jxl.peermi
Class PeerRemoteObject

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by jxl.peermi.PeerRemoteObject
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, PeerRemote
Direct Known Subclasses:
ModuleServer, PeerRegistry

public abstract class PeerRemoteObject
extends java.rmi.server.UnicastRemoteObject
implements PeerRemote

PeerRemoteObject must be extended to create a custom Peermi remote object. The subclass must implement at lease one PeerRemote interface.

Author:
Alex Lynch
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
PeerRemoteObject()
          Just creates a PeerRemoteObject ready to use Peermi.
PeerRemoteObject(boolean registerByClass)
          Creates a PeerRemoteObject.
PeerRemoteObject(int port)
          Creates a new instance of PeerRemoteObject on a specified 'port.' This option is included to support the 'normal' client-server view of rmi.
 
Method Summary
 void checkAlive()
          Always returns true.
static boolean isAlive(PeerRemote r)
          Calls r.checkAlive().
static PeerRemote toStub(java.rmi.Remote r)
           
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PeerRemoteObject

public PeerRemoteObject()
                 throws java.rmi.RemoteException
Just creates a PeerRemoteObject ready to use Peermi.

Throws:
java.rmi.RemoteException

PeerRemoteObject

public PeerRemoteObject(boolean registerByClass)
                 throws java.rmi.RemoteException
Creates a PeerRemoteObject. If registerByClass is true then, bind this object in the local PeerRegistry like so PeerRegistry.getLocalInstance().bind(this, this.getClass().getName());

Parameters:
registerByClass - if true register by class name
Throws:
java.rmi.RemoteException

PeerRemoteObject

public PeerRemoteObject(int port)
                 throws java.rmi.RemoteException
Creates a new instance of PeerRemoteObject on a specified 'port.' This option is included to support the 'normal' client-server view of rmi.

Throws:
java.rmi.RemoteException
Method Detail

isAlive

public static final boolean isAlive(PeerRemote r)
Calls r.checkAlive(). If a RemoteException occurs, return false, else true.

Parameters:
r - The PeerRemote object to check.

toStub

public static PeerRemote toStub(java.rmi.Remote r)
                         throws java.rmi.NoSuchObjectException
Throws:
java.rmi.NoSuchObjectException

checkAlive

public final void checkAlive()
                      throws java.rmi.RemoteException
Always returns true. This method is called by isAlive(PeerRemote)

Specified by:
checkAlive in interface PeerRemote
Throws:
java.rmi.RemoteException