de.kosi.rmi
Class KosiRMI

java.lang.Object
  |
  +--de.kosi.rmi.KosiRMI

public abstract class KosiRMI
extends java.lang.Object

This class exports an RMI-object using the custom reference classes in order to identify the client

Author:
Rickard Öberg

Constructor Summary
KosiRMI()
          Default Constructor
 
Method Summary
static java.rmi.server.RemoteStub exportObject(java.rmi.Remote obj)
          Export the object on an arbitrary port.
static java.rmi.Remote exportObject(java.rmi.Remote obj, int port)
          Export the object on an given port.
static void init()
          Initalize KosiRMI for client operation.
static void init(boolean server)
          Create security provider.
static boolean isServer()
          Return wether the currently running application is a server.
static boolean unexportObject(java.rmi.Remote obj, boolean force)
          Unexport object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KosiRMI

public KosiRMI()
Default Constructor
Method Detail

isServer

public static boolean isServer()
Return wether the currently running application is a server.
Returns:
True, if the current application is a server.

init

public static void init(boolean server)
Create security provider.
Parameters:
server - True, if the current application is a server.

init

public static void init()
Initalize KosiRMI for client operation.

exportObject

public static java.rmi.server.RemoteStub exportObject(java.rmi.Remote obj)
                                               throws java.rmi.RemoteException
Export the object on an arbitrary port.
Parameters:
obj - the Remote implementation
Returns:
a stub to the object
Throws:
java.rmi.RemoteException - thrown if the export fails

exportObject

public static java.rmi.Remote exportObject(java.rmi.Remote obj,
                                           int port)
                                    throws java.rmi.RemoteException
Export the object on an given port.
Parameters:
obj - the Remote implementation
port - the port to export to.
Returns:
a stub to the object
Throws:
java.rmi.RemoteException - thrown if the export fails

unexportObject

public static boolean unexportObject(java.rmi.Remote obj,
                                     boolean force)
                              throws java.rmi.NoSuchObjectException
Unexport object
Parameters:
obj - the remote object to unexport
force - force unexport
Returns:
if it succeeded
Throws:
java.rmi.NoSuchObjectException - thrown if the object is ont exported