All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class vnet.local.VirtualNet

java.lang.Object
   |
   +----java.util.Observable
           |
           +----vnet.NetLayout
                   |
                   +----vnet.local.VirtualNet

public class VirtualNet
extends NetLayout
Local implementation of a virtual net, that is, a net layout with abilities to bind, unbind or lookup servers. Local means that this virtual net can only be used inside the same java machines it is executed The servers written for the local virtual net have the next requirements:

- They have to implement an interface that extends the VirtualRemote interface (it is an empty interface)

- Each of the methods of the interface has to throw the VirtualNetException - They need to have a Virtual Net stub, that is generated automatically by the local vnet compiler: vnc.

Version:
0.1, august-1997
Author:
LuisM Pena
See Also:
VirtualNet, vnc

Constructor Index

 o VirtualNet()
Default constructor
 o VirtualNet(long)
This constructor allows to specify the default delay that will apply for the nodes and links in the net.

Method Index

 o bind(NodeId, String, VirtualRemote)
Binds a server with the serverName specified to the node with identity id;
 o lookup(NodeId, String)
Looks the net for a server binded with the serverName specified.
 o lookup(NodeId, String, NodeId)
Looks the net for a server binded with the serverName specified in the node given.
 o rebind(NodeId, String, VirtualRemote)
Binds a server with the serverName specified to the node with identity id, no matter if the servername is already in use
 o unbind(NodeId, String)
Unbinds the server that is binded with the serverName specified from the node given

Constructors

 o VirtualNet
 public VirtualNet()
Default constructor

 o VirtualNet
 public VirtualNet(long delay)
This constructor allows to specify the default delay that will apply for the nodes and links in the net.

Parameters:
delay - the delay that will apply by default to the nodes and links

Methods

 o bind
 public synchronized void bind(NodeId host,
                               String serverName,
                               VirtualRemote server) throws VNException, AlreadyBoundException
Binds a server with the serverName specified to the node with identity id;

Parameters:
host - the identity of the node on which the server is to be binded
hostToBind - the identity of the node on which the server is to be binded
serverName - the name for the server
server - the VirtualRemote server
Throws: VNException
if the NodeId doesn't exist in the net
Throws: AlreadyBoundException
if the node specified has already another server binded with the same serverName
See Also:
bind
 o rebind
 public synchronized void rebind(NodeId host,
                                 String serverName,
                                 VirtualRemote server) throws VNException
Binds a server with the serverName specified to the node with identity id, no matter if the servername is already in use

Parameters:
host - the identity of the node on which the server is hosted
hostToBind - the identity of the node on which the server is to be binded
serverName - the name for the server
server - the VirtualRemote server
Throws: VNException
if the NodeId doesn't exist in the net
See Also:
rebind
 o unbind
 public synchronized void unbind(NodeId host,
                                 String serverName) throws VNException, NotBoundException
Unbinds the server that is binded with the serverName specified from the node given

Parameters:
host - the identity of the node on which the server is hosted
serverName - the name for the server
Throws: VNException
if the NodeId doesn't exist in the net
Throws: NotBoundException
if the node specified doesn't have any server binded with the same serverName given
See Also:
unbind
 o lookup
 public synchronized VirtualRemote lookup(NodeId host,
                                          String serverName) throws VNException, ClassVNetException
Looks the net for a server binded with the serverName specified. The search starts from a node (the node where the client is suposed to be hosted).

Parameters:
host - the identity of the node on which the server is binded
serverName - the name of the server
Returns:
a reference to the server (an stub of it), or null if it is not found
Throws: VNException
if the NodeId doesn't exist in the net
Throws: ClassVNetException
if the stub class of the server can not be loaded
See Also:
lookup
 o lookup
 public synchronized VirtualRemote lookup(NodeId host,
                                          String serverName,
                                          NodeId hostServer) throws VNException, ClassVNetException, CommException
Looks the net for a server binded with the serverName specified in the node given. The search starts from a node (the node where the client is suposed to be hosted).

Parameters:
host - the identity of the node on which the server is binded
serverName - the name of the server
hostServer - the node where the server is binded
Returns:
a reference to the server (an stub of it), or null if it is not found
Throws: VNException
if the NodeId id or host don't exist in the net.
Throws: CommException
if the host can not be accesed from the id
Throws: ClassVNetException
if the stub class of the server can not be loaded
See Also:
lookup

All Packages  Class Hierarchy  This Package  Previous  Next  Index