net.spy.rmi
Class RObjectImpl

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bynet.spy.rmi.RObjectImpl
All Implemented Interfaces:
Remote, RObject, Serializable

public class RObjectImpl
extends UnicastRemoteObject
implements RObject

Implementation for RObjectServer

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RObjectImpl()
          Get an RObjectImpl with the default directory.
RObjectImpl(String basedir)
          Get an RObjectImpl with the given directory.
 
Method Summary
 Object getObject(String name)
          Fetch an object from the object server.
static void main(String[] args)
          main can be invoked to run an RObjectServer.
 boolean ping()
          Make sure the server is available and functioning.
 void storeObject(String name, Object o)
          Store an Object in the object server.
 
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, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RObjectImpl

public RObjectImpl()
            throws RemoteException
Get an RObjectImpl with the default directory.


RObjectImpl

public RObjectImpl(String basedir)
            throws RemoteException
Get an RObjectImpl with the given directory.

Method Detail

storeObject

public void storeObject(String name,
                        Object o)
                 throws RemoteException
Description copied from interface: RObject
Store an Object in the object server.

Specified by:
storeObject in interface RObject
Parameters:
name - Key under which the object will be stored
o - Object to store
Throws:
RemoteException - when something breaks
See Also:
RObject

getObject

public Object getObject(String name)
                 throws RemoteException
Description copied from interface: RObject
Fetch an object from the object server.

Specified by:
getObject in interface RObject
Parameters:
name - Name of the object to fetch.
Returns:
the object
Throws:
RemoteException - when something breaks
See Also:
RObject

ping

public boolean ping()
             throws RemoteException
Description copied from interface: RObject
Make sure the server is available and functioning.

Specified by:
ping in interface RObject
Returns:
true if the server is awake.
Throws:
RemoteException - when something breaks
See Also:
RObject

main

public static void main(String[] args)
                 throws Exception
main can be invoked to run an RObjectServer. It takes as an argument, the path where it will be storing its objects.

Parameters:
args - Uh, yeah, the arguments
Throws:
Exception - if anything blows up