org.newsclub.net.unix.rmi
Class AFUNIXNaming

java.lang.Object
  extended by org.newsclub.net.unix.rmi.AFUNIXNaming

public final class AFUNIXNaming
extends java.lang.Object

The AFUNIXSocket-compatible equivalent of Naming. Use this class for accessing RMI registries that are reachable by AFUNIXSocket s.

Author:
Christian Kohlsch??tter

Method Summary
 void bind(java.lang.String name, java.rmi.Remote obj)
           
 java.rmi.registry.Registry createRegistry()
           
static AFUNIXNaming getInstance()
          Returns the default instance of AFUNIXNaming.
static AFUNIXNaming getInstance(java.io.File socketDir)
          Returns the
static AFUNIXNaming getInstance(java.io.File socketDir, int registryPort)
           
 PortAssigner getPortAssigner()
           
 java.rmi.registry.Registry getRegistry()
           
 int getRegistryPort()
           
 java.io.File getRegistrySocketDir()
           
static AFUNIXNaming getSingleFileInstance(java.io.File socketFile)
          Returns an AFUNIXNaming instance which only supports one file.
 AFUNIXRMISocketFactory getSocketFactory()
           
 java.rmi.Remote lookup(java.lang.String name)
           
 void rebind(java.lang.String name, java.rmi.Remote obj)
           
 void shutdownRegistry()
          Shuts this RMI Registry down.
 void unbind(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AFUNIXNaming getInstance()
                                throws java.io.IOException
Returns the default instance of AFUNIXNaming. Sockets are stored in java.io.tmpdir.

Returns:
Throws:
java.io.IOException

getSingleFileInstance

public static AFUNIXNaming getSingleFileInstance(java.io.File socketFile)
                                          throws java.io.IOException
Returns an AFUNIXNaming instance which only supports one file. (Probably only useful when you want/can access the exported UnicastRemoteObject directly)

Parameters:
socketFile -
Returns:
Throws:
java.io.IOException

getInstance

public static AFUNIXNaming getInstance(java.io.File socketDir)
                                throws java.rmi.RemoteException
Returns the

Parameters:
socketDir -
Returns:
Throws:
java.rmi.RemoteException

getInstance

public static AFUNIXNaming getInstance(java.io.File socketDir,
                                       int registryPort)
                                throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getSocketFactory

public AFUNIXRMISocketFactory getSocketFactory()

getRegistrySocketDir

public java.io.File getRegistrySocketDir()

getRegistryPort

public int getRegistryPort()

getPortAssigner

public PortAssigner getPortAssigner()
                             throws java.rmi.RemoteException,
                                    java.rmi.NotBoundException
Throws:
java.rmi.RemoteException
java.rmi.NotBoundException

getRegistry

public java.rmi.registry.Registry getRegistry()
                                       throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

lookup

public java.rmi.Remote lookup(java.lang.String name)
                       throws java.rmi.NotBoundException,
                              java.net.MalformedURLException,
                              java.rmi.RemoteException
Throws:
java.rmi.NotBoundException
java.net.MalformedURLException
java.rmi.RemoteException

unbind

public void unbind(java.lang.String name)
            throws java.rmi.RemoteException,
                   java.rmi.NotBoundException,
                   java.net.MalformedURLException
Throws:
java.rmi.RemoteException
java.rmi.NotBoundException
java.net.MalformedURLException

bind

public void bind(java.lang.String name,
                 java.rmi.Remote obj)
          throws java.rmi.AlreadyBoundException,
                 java.net.MalformedURLException,
                 java.rmi.RemoteException
Throws:
java.rmi.AlreadyBoundException
java.net.MalformedURLException
java.rmi.RemoteException

rebind

public void rebind(java.lang.String name,
                   java.rmi.Remote obj)
            throws java.net.MalformedURLException,
                   java.rmi.RemoteException
Throws:
java.net.MalformedURLException
java.rmi.RemoteException

shutdownRegistry

public void shutdownRegistry()
                      throws java.rmi.AccessException,
                             java.rmi.RemoteException,
                             java.io.IOException
Shuts this RMI Registry down. Before calling this method, you have to unexport all existing bindings, otherwise the "RMI Reaper" thread will not be closed.

Throws:
java.rmi.AccessException
java.rmi.RemoteException
java.io.IOException

createRegistry

public java.rmi.registry.Registry createRegistry()
                                          throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException