nathan.middleware
Class Naming

java.lang.Object
  extended by nathan.middleware.Naming

public class Naming
extends java.lang.Object

Naming is used to communicate with the Registry. The main features of the class is to lookup and bind remote object.

Author:
Nathan Balon
Advance Operating Systems CIS 578
University of Michigan Dearborn
Remote Method Invocation Middleware Project

Constructor Summary
Naming()
           
 
Method Summary
static RemoteObjectMapping createFrontEnd(java.lang.String name, java.lang.String registryIP, int registryPort, int portToBind)
          Create an entry in the registry for the active replication front end server.
static java.lang.Object lookup(java.lang.String name, java.lang.String ip, int port)
          Lookup looks an object up in the registry and the creates a new stub.
static java.lang.Object rebind(java.lang.String objectName, java.lang.Object objectToBind, java.lang.String registryIP, int registryPort, int portToBind)
          Binds an object to the registry then creates a skeleton object.
static void remove(java.lang.String registryIP, int registryPort, RemoteObjectReference ror)
          Remove an entry from the registry when no longer needed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Naming

public Naming()
Method Detail

lookup

public static java.lang.Object lookup(java.lang.String name,
                                      java.lang.String ip,
                                      int port)
Lookup looks an object up in the registry and the creates a new stub.

Parameters:
name - The name of the object to lookup.
ip - The ip address of the registry
port - The port number of the registry
Returns:
Object A stub object to use by the client.

rebind

public static java.lang.Object rebind(java.lang.String objectName,
                                      java.lang.Object objectToBind,
                                      java.lang.String registryIP,
                                      int registryPort,
                                      int portToBind)
Binds an object to the registry then creates a skeleton object.

Parameters:
objectName - The name to be used to lookup the object.
registryIP - The IP address of the registry used to bind the object.
registryPort - The port number of the registry.
portToBind - The port number of the server that the object will be bound to.
Returns:
RemoteObjectReference The RemoteObjectReference used to access a remote object.

remove

public static void remove(java.lang.String registryIP,
                          int registryPort,
                          RemoteObjectReference ror)
Remove an entry from the registry when no longer needed.

Parameters:
registryIP - The IP address of the registry.
registryPort - The port number of the registry.
ror - The RemoteObjectReference to be removed from the registry.

createFrontEnd

public static RemoteObjectMapping createFrontEnd(java.lang.String name,
                                                 java.lang.String registryIP,
                                                 int registryPort,
                                                 int portToBind)
Create an entry in the registry for the active replication front end server.

Parameters:
name - The name to be used to look up the servie
registryIP - The IP address of the registry.
registryPort - The port number of the registry.
portToBind - The port to bind the Front End to.
Returns:
The RemoteObjectMapping to be used with the FrontEnd.