All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class vnet.remote.HostImpl

java.lang.Object
   |
   +----java.rmi.server.RemoteObject
           |
           +----java.rmi.server.RemoteServer
                   |
                   +----java.rmi.server.UnicastRemoteObject
                           |
                           +----vnet.remote.HostImpl

public class HostImpl
extends UnicastRemoteObject
implements Host
Implementation Class to represent a machine -a node- in the remote VirtualNet Every server or client, to interact with any other in the virtual net has to be previously 'attached'to a host. Once attached, it is able to do the general operations bind, rebind, unbind and lookup

All the operations needs to have a serverName. This string may be the plain server Name, or a qualified one, specifying the host for the server; in this last case, the string starts with '/', and the expected format is:

/name of the virtualNet/HostN/name of the server.

For example, to look for the server "Server" in the Host B of the virtualNet called "ExampleNet", the serverName would be: /ExampleNet/HostB/Server

Version:
0.1, august-1997
Author:
LuisM Pena

Constructor Index

 o HostImpl(VirtualNet, NetNode)
Create a host for the specified Node

Method Index

 o bind(String, Remote)
Binds a server with the serverName specified
 o list(String)
Gives the complete list of servers binded.
 o lookup(String)
Looks the net for a server binded with the serverName specified.
 o rebind(String, Remote)
Rebinds a server with the serverName specified If it would exist other server with the same serverName, it is first unbinded
 o unbind(String)
Unbinds the server that is binded with the serverName specified

Constructors

 o HostImpl
 public HostImpl(VirtualNet vNet,
                 NetNode node) throws RemoteException
Create a host for the specified Node

Parameters:
virtualNetName - The name of the virtualNet holding this HostImpl
NetNode - The node represented by this host
Throws: RemoteException
mandatory in any remote object
See Also:
NetNode

Methods

 o bind
 public void bind(String serverName,
                  Remote server) throws AlreadyBoundException, MalformedURLException, UnknownHostException, RemoteException
Binds a server with the serverName specified

Parameters:
serverName - the name for the server (can be qualified)
server - the Remote server
Throws: AlreadyBoundException
if there is already another server binded with the same serverName
Throws: MalformedURLException
if the name is not valid
Throws: UnknownHostException
if the serverName is qualified, and refers to a node that is not accesible from the cuurent Host
Throws: RemoteException
mandatory in any remote object
See Also:
bind
 o rebind
 public void rebind(String serverName,
                    Remote server) throws MalformedURLException, UnknownHostException, RemoteException
Rebinds a server with the serverName specified If it would exist other server with the same serverName, it is first unbinded

Parameters:
serverName - the name for the server (can be qualified)
server - the Remote server
Throws: MalformedURLException
if the name is not valid
Throws: UnknownHostException
if the serverName is qualified, and refers to a node that is not accesible from the cuurent Host
Throws: RemoteException
mandatory in any remote object
See Also:
rebind
 o unbind
 public void unbind(String serverName) throws NotBoundException, MalformedURLException, UnknownHostException, RemoteException
Unbinds the server that is binded with the serverName specified

Parameters:
serverName - the name for the server
serverName - the name for the server
Throws: NotBoundException
if it is not bound such a serverName
Throws: MalformedURLException
if the name is not valid
Throws: UnknownHostException
if the serverName is qualified, and refers to a node that is not accesible from the cuurent Host
Throws: RemoteException
mandatory in any remote object
See Also:
unbind
 o lookup
 public Remote lookup(String serverName) throws NotBoundException, MalformedURLException, UnknownHostException, RemoteException
Looks the net for a server binded with the serverName specified.

Parameters:
serverName - the name of the server
Returns:
a reference to the server (an stub of it)
Throws: NotBoundException
if it is not bound such a serverName
Throws: MalformedURLException
if the name is not valid
Throws: UnknownHostException
if the serverName is qualified, and refers to a node that is not accesible from the cuurent Host
Throws: RemoteException
mandatory in any remote object
See Also:
lookup
 o list
 public String[] list(String name) throws MalformedURLException, UnknownHostException, RemoteException
Gives the complete list of servers binded. The parameter name is here for compatibility with the RMI signature FOR PROBLEMS WITH THE RMIC COMPILER (INVOLVING THE STRING[] RETURN), THIS FUNCTION IS NOT READY.

Parameters:
name - it is not used
Returns:
the list of servers, in the format /VirtualNet/HostX/Name
Throws: MalformedURLException
not possible, only for compatibility with the RMI signature
Throws: UnknownHostException
not possible, only for compatibility with the RMI signature
Throws: RemoteException
mandatory in any remote object

All Packages  Class Hierarchy  This Package  Previous  Next  Index