org.jmx4odp.j4oNet
Class J4ONet

java.lang.Object
  extended by org.jmx4odp.j4oNet.J4ONet
All Implemented Interfaces:
javax.management.MBeanRegistration, J4ONetMBean

public class J4ONet
extends java.lang.Object
implements javax.management.MBeanRegistration, J4ONetMBean

This is the basic Peer to Peer network module. It contains all the basic p2p attributes. It will start up a server that will listen for UDP packets broadcast out requesting JSO resolution. It will then translate these into jso objects and send them to the configure JsRegistryManager for local resolution, and respond to the request.

It will also register a BroadcastResolver so that this servers JsResolutionManager will be able to see JSO's in the p2p network.

Author:
Lucas McGregor

Constructor Summary
J4ONet()
          Creates new DiscoveryService
 
Method Summary
 int getBroadcastReplyTimeout()
          Access timeount in ms for broadcast replies.
 JmxServiceObj getConfig()
          Access the JSO configuration for this agent.
 int getHashcode()
           
 java.net.InetAddress getMultiCastGroup()
          Access the multicast group address for this agent
 java.lang.String getMultiCastGroupName()
           
 int getMultiCastListenPort()
          Access the multicast port for this agent
 java.lang.String getNameSpace()
           
 java.lang.String getNetworkDomain()
           
 int getRating()
          Access the rating for this agent
 java.lang.String getRegistryManager()
           
 java.lang.String getRemoteAdaptorAddress()
          Access the remote adaptor address fro this agent.
 int getRemoteAdaptorPort()
          Access the remote adaptor address fro this agent.
 int getType()
          Access the type for this agent.
 boolean isActive()
          Return true if thsi MBean is handling requests
 void postDeregister()
           
 void postRegister(java.lang.Boolean booleanParam)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer mBeanServer, javax.management.ObjectName obj)
           
 void setBroadcastReplyTimeout(int i)
           
 void setConfig(JmxServiceObj jso)
           
 void setMultiCastGroup(java.net.InetAddress ia)
           
 void setMultiCastGroupName(java.lang.String s)
           
 void setMultiCastListenPort(int i)
           
 void setNameSpace(java.lang.String s)
          Access the namespace for this agent.
 void setNetworkDomain(java.lang.String s)
          Access the network domain for this agent.
 void setRating(int i)
           
 void setRegistryManager(java.lang.String name)
          Given a name, try to find this object in the local agent and use it as the JsRegistryManager
 void setRemoteAdaptorAddress(java.lang.String s)
           
 void setRemoteAdaptorPort(int i)
           
 void setType(int i)
           
 void start()
          Start handling requests.
 void stop()
          Stop handling requests.
 java.lang.String testLookup()
          Looks up all the agents it can find and returns them as a formated string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

J4ONet

public J4ONet()
Creates new DiscoveryService

Method Detail

testLookup

public java.lang.String testLookup()
                            throws java.lang.Exception
Looks up all the agents it can find and returns them as a formated string. This is intended for quick testing.

Specified by:
testLookup in interface J4ONetMBean
Throws:
java.lang.Exception

setRegistryManager

public void setRegistryManager(java.lang.String name)
                        throws java.lang.Exception
Given a name, try to find this object in the local agent and use it as the JsRegistryManager

Specified by:
setRegistryManager in interface J4ONetMBean
Throws:
java.lang.Exception

getRegistryManager

public java.lang.String getRegistryManager()
Specified by:
getRegistryManager in interface J4ONetMBean

getConfig

public JmxServiceObj getConfig()
Access the JSO configuration for this agent.

Specified by:
getConfig in interface J4ONetMBean

setConfig

public void setConfig(JmxServiceObj jso)
Specified by:
setConfig in interface J4ONetMBean

setNameSpace

public void setNameSpace(java.lang.String s)
Access the namespace for this agent.

Specified by:
setNameSpace in interface J4ONetMBean

getNameSpace

public java.lang.String getNameSpace()
Specified by:
getNameSpace in interface J4ONetMBean

setNetworkDomain

public void setNetworkDomain(java.lang.String s)
Access the network domain for this agent.

Specified by:
setNetworkDomain in interface J4ONetMBean

getNetworkDomain

public java.lang.String getNetworkDomain()
Specified by:
getNetworkDomain in interface J4ONetMBean

setRemoteAdaptorAddress

public void setRemoteAdaptorAddress(java.lang.String s)
                             throws java.net.UnknownHostException
Specified by:
setRemoteAdaptorAddress in interface J4ONetMBean
Throws:
java.net.UnknownHostException

getRemoteAdaptorAddress

public java.lang.String getRemoteAdaptorAddress()
Access the remote adaptor address fro this agent. In this implementation, this is the RMI address.

Specified by:
getRemoteAdaptorAddress in interface J4ONetMBean

setRemoteAdaptorPort

public void setRemoteAdaptorPort(int i)
Specified by:
setRemoteAdaptorPort in interface J4ONetMBean

getRemoteAdaptorPort

public int getRemoteAdaptorPort()
Access the remote adaptor address fro this agent. In this implementation, this is the RMI port.

Specified by:
getRemoteAdaptorPort in interface J4ONetMBean

setMultiCastGroup

public void setMultiCastGroup(java.net.InetAddress ia)
Specified by:
setMultiCastGroup in interface J4ONetMBean

setMultiCastGroupName

public void setMultiCastGroupName(java.lang.String s)
                           throws java.net.UnknownHostException
Specified by:
setMultiCastGroupName in interface J4ONetMBean
Throws:
java.net.UnknownHostException

getMultiCastGroup

public java.net.InetAddress getMultiCastGroup()
Access the multicast group address for this agent

Specified by:
getMultiCastGroup in interface J4ONetMBean

getMultiCastGroupName

public java.lang.String getMultiCastGroupName()
Specified by:
getMultiCastGroupName in interface J4ONetMBean

setMultiCastListenPort

public void setMultiCastListenPort(int i)
Specified by:
setMultiCastListenPort in interface J4ONetMBean

getMultiCastListenPort

public int getMultiCastListenPort()
Access the multicast port for this agent

Specified by:
getMultiCastListenPort in interface J4ONetMBean

setType

public void setType(int i)
Specified by:
setType in interface J4ONetMBean

getType

public int getType()
Access the type for this agent.

Specified by:
getType in interface J4ONetMBean

setRating

public void setRating(int i)
Specified by:
setRating in interface J4ONetMBean

getRating

public int getRating()
Access the rating for this agent

Specified by:
getRating in interface J4ONetMBean

setBroadcastReplyTimeout

public void setBroadcastReplyTimeout(int i)
Specified by:
setBroadcastReplyTimeout in interface J4ONetMBean

getBroadcastReplyTimeout

public int getBroadcastReplyTimeout()
Access timeount in ms for broadcast replies.

Specified by:
getBroadcastReplyTimeout in interface J4ONetMBean

getHashcode

public int getHashcode()
Specified by:
getHashcode in interface J4ONetMBean

isActive

public boolean isActive()
Return true if thsi MBean is handling requests

Specified by:
isActive in interface J4ONetMBean

start

public void start()
           throws java.lang.Exception
Start handling requests.

Specified by:
start in interface J4ONetMBean
Throws:
java.lang.Exception

stop

public void stop()
Stop handling requests.

Specified by:
stop in interface J4ONetMBean

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

postRegister

public void postRegister(java.lang.Boolean booleanParam)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer mBeanServer,
                                               javax.management.ObjectName obj)
                                        throws java.lang.Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception