cgl.narada.node
Class MultipleClientNode

java.lang.Object
  extended by cgl.narada.node.MultipleClientNode
All Implemented Interfaces:
NodeDebugFlags

public class MultipleClientNode
extends Object
implements NodeDebugFlags

This class helps us setup multiple client nodes within one process. Each of the these client node's thus setup, can maintain connections to different server nodes within the network. In addition to this, they can also have specific subscription predicates. This class is very useful especially in the testing scenario where we have multiple clients being attached to multiple server nodes within the server network. The sockets are assigned assigned automatically to the client.

Version:
$Revision$ $Date$

Field Summary
 
Fields inherited from interface cgl.narada.node.NodeDebugFlags
BrokerNode_Debug, BrokerPropertiesReader_Debug, ClientNode_Debug, ServerNode_Debug
 
Constructor Summary
MultipleClientNode()
          The multiple client node constructor
 
Method Summary
 void createMultipleClientNodesToServer(String serverName, int portNum, int numOfNodes, String subscription)
          This method sets up multiple client nodes with a specific subscription to a given node.
static void main(String[] args)
          The test fucntion for the multiple client node
 void setClientPortNum(int portNum)
          This sets the initial portNum for a muli-client node, individual clients listen to sockets at portNums (which are incremented by 1 for every new client created)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipleClientNode

public MultipleClientNode()
The multiple client node constructor

Method Detail

setClientPortNum

public void setClientPortNum(int portNum)
This sets the initial portNum for a muli-client node, individual clients listen to sockets at portNums (which are incremented by 1 for every new client created)

Parameters:
portNum - The starting port number

createMultipleClientNodesToServer

public void createMultipleClientNodesToServer(String serverName,
                                              int portNum,
                                              int numOfNodes,
                                              String subscription)
This method sets up multiple client nodes with a specific subscription to a given node.

Parameters:
serverName - The name of the machine the server node is hosted on.
portNum - The port number that the server node listens to for connections either from clients or servers.
numOfNodes - The number of client nodes that must have a connection to the server.
subscription - The subscription predicate for the client nodes created by this invocation

main

public static void main(String[] args)
The test fucntion for the multiple client node



For comments and suggestions please send e-mail to The NaradaBrokering Project