|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--de.tu_darmstadt.sp.rmi.RegistryImpl
Class RegistryImpl implements the Registry
interface using an implementation
object obtained from LocateRegistry
.
It is intended for use with secure sockets. The 'traditional' rmiregistry in jdk
has the advantage of using one well defined port and always the same type of sockets.
Additionally, the Naming
class facilitates the access to the standard registry.
In Java 2, a comunity of RMI objects may use their own custom sockets and
therefore need their private 'custom' rmiregistry.
Simply replacing sun's rmiregistry doesn't work, since the Naming
has hardcoded informations to what kind of registry it is
speaking.. On the other hand, creating a new 'MyNaming' class
wouln't solve the problem, since it will work until somebody needs yet another
type of rmiregistry. The 'rmiregistry' provided with JDK 1.2 can communicate using
custom sockets. HOwever, if the factories need additional classes, the normal
rmiregistry does not work well..
This registry simply can register itself on a specified (or anonymous) port on the local registry under a given name like any other remote server. Objects interested in getting a reference to such a secure registry, should use the name to lookup the registry object. Therefore, a local rmiregistry has to run on the local host before starting this registry implementation.
At the present moment, the LocateRegistry.createRegistry
doens't seem to
work. This is the main motivation in using this registry..
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary | |
RegistryImpl(int port)
Create a remote object being a registry, using normal sockets. |
|
RegistryImpl(int port,
java.rmi.server.RMIClientSocketFactory csf,
java.rmi.server.RMIServerSocketFactory ssf)
Create a remote object being a registry, using custom sockets. |
Method Summary | |
void |
bind(java.lang.String name,
java.rmi.Remote obj)
Binds the specified name to a remote object. |
java.lang.String[] |
list()
Returns an array of the names bound in the registry. |
java.rmi.Remote |
lookup(java.lang.String name)
Returns a reference, a stub, for the remote object associated with the specified name. |
void |
rebind(java.lang.String name,
java.rmi.Remote obj)
Rebinds the specified name to a new remote object. |
void |
unbind(java.lang.String name)
Destroys the binding for the specified name that is associated with a remote object. |
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 |
public RegistryImpl(int port) throws java.rmi.RemoteException, java.net.MalformedURLException
port
- the port to listen topublic RegistryImpl(int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf) throws java.rmi.RemoteException, java.net.MalformedURLException
port
- the port to listen tocsf
- client socket factoryssf
- server socket factoryname
is not a correct
URL-like RMI string.Method Detail |
public java.rmi.Remote lookup(java.lang.String name) throws java.rmi.RemoteException, java.rmi.NotBoundException, java.rmi.AccessException
public void bind(java.lang.String name, java.rmi.Remote obj) throws java.rmi.RemoteException, java.rmi.AlreadyBoundException, java.rmi.AccessException
public void unbind(java.lang.String name) throws java.rmi.RemoteException, java.rmi.NotBoundException, java.rmi.AccessException
public void rebind(java.lang.String name, java.rmi.Remote obj) throws java.rmi.RemoteException, java.rmi.AccessException
public java.lang.String[] list() throws java.rmi.RemoteException, java.rmi.AccessException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |