|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.services.discovery.DiscoveryService
public class DiscoveryService
The DiscoveryService is the mbean responds to the discovery requests. JMX agent that needs to be discovered must instantiate and register this mbean. When startService is called it broadcasts discoveryPacket in the multicast group
| Field Summary | |
|---|---|
(package private) DiscoverySocket |
dsock
|
(package private) javax.management.MBeanServer |
server
the MBeanServer |
(package private) java.util.Properties |
userData
|
| Constructor Summary | |
|---|---|
DiscoveryService()
Default constructor |
|
DiscoveryService(java.lang.String multicastGroup,
int multicastPort)
Constructor which takes multicast group and multicast port as parameters |
|
DiscoveryService(java.lang.String multicastGroup,
int multicastPort,
java.lang.String hostName)
Constructor which takes multicast group , multicast port and hostName as parameters |
|
| Method Summary | |
|---|---|
java.lang.Object |
getAttribute(java.lang.String attribute)
Gets the value of a specific attribute of this MBean. |
javax.management.AttributeList |
getAttributes(java.lang.String[] attributes)
Enables the values of several attributes of this MBean. |
javax.management.MBeanInfo |
getMBeanInfo()
This method discovers the attributes and operations this MBean exposes for management. |
java.lang.String |
getMulticastGroup()
Gets the multicast group. |
int |
getMulticastPort()
gets the multicast port used by this discovery service. |
java.lang.Integer |
getState()
Returns the state, whether ON_STATE/OFF_STATE, of this service. |
int |
getTimeToLive()
Gets the time to live (hop count). |
java.util.Properties |
getUserData()
Gets the user defined data which will be sent in the discovery packet |
java.lang.Object |
invoke(java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
Invokes an action on the original MBean associated with this MBean. |
void |
postDeregister()
Allows this MBean to perform any operations needed after having been de-registered in the MBeanServer. |
void |
postRegister(java.lang.Boolean registrationDone)
Allows this MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed. |
void |
preDeregister()
Allows this MBean to perform any operations it needs before being de-registered by the MBeanServer. |
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
|
void |
setAttribute(javax.management.Attribute attribute)
Sets the value of a specific attribute of this MBean. |
javax.management.AttributeList |
setAttributes(javax.management.AttributeList attributes)
Sets the values of several attributes of this MBean. |
void |
setHostAddress(java.lang.String host)
This method is used to set the host address on which this service is running. |
void |
setMulticastGroup(java.lang.String multicastGroup)
Sets the multicast group. |
void |
setMulticastPort(int multicastPort)
sets the multicast port used by this discovery service. |
void |
setMulticastPort(java.lang.Integer multicastPort)
sets the multicast port used by this discovery service. |
void |
setTimeToLive(int timeToLive)
Sets the time to live. |
void |
setTimeToLive(java.lang.Integer timeToLive)
Sets the time to live. |
void |
setUserData(java.util.Properties userData)
Sets the user defined data which will be sent in the discovery packet |
void |
startService()
Allows the service to get started. |
void |
stopService()
Allows the service to get stopped. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
DiscoverySocket dsock
transient javax.management.MBeanServer server
java.util.Properties userData
| Constructor Detail |
|---|
public DiscoveryService()
public DiscoveryService(java.lang.String multicastGroup,
int multicastPort)
public DiscoveryService(java.lang.String multicastGroup,
int multicastPort,
java.lang.String hostName)
| Method Detail |
|---|
public javax.management.MBeanInfo getMBeanInfo()
getMBeanInfo in interface javax.management.DynamicMBeanpublic void setHostAddress(java.lang.String host)
public java.lang.Object getAttribute(java.lang.String attribute)
throws javax.management.AttributeNotFoundException,
javax.management.MBeanException,
javax.management.ReflectionException
getAttribute in interface javax.management.DynamicMBeanattribute - A String specifying the name of the
attribute to be retrieved.
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionExceptionpublic javax.management.AttributeList getAttributes(java.lang.String[] attributes)
getAttributes in interface javax.management.DynamicMBeanattributes - A list of attributes to be retrieved.
public java.lang.Object invoke(java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
throws javax.management.MBeanException,
javax.management.ReflectionException
invoke in interface javax.management.DynamicMBeanactionName - The name of the action to be invoked.params - An array containing the parameters to be
set when the action is invokedsignature - An array containing the signature of
the action. The class objects will be loaded using the
same class loader as the one used for loading the MBean
on which the action was invoked.
javax.management.MBeanException
javax.management.ReflectionException
public void setAttribute(javax.management.Attribute attribute)
throws javax.management.AttributeNotFoundException,
javax.management.InvalidAttributeValueException,
javax.management.MBeanException,
javax.management.ReflectionException
setAttribute in interface javax.management.DynamicMBeanattribute - The identification of the attribute to
be set and the value it is to be set to.
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionExceptionpublic javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
setAttributes in interface javax.management.DynamicMBeanattributes - A list of attributes: The identification
of the attributes to be set and the values they are to be set to.
public java.lang.String getMulticastGroup()
public void setMulticastGroup(java.lang.String multicastGroup)
throws java.lang.Exception
java.lang.Exceptionpublic int getMulticastPort()
public void setMulticastPort(int multicastPort)
throws java.lang.Exception
java.lang.Exception
public void setMulticastPort(java.lang.Integer multicastPort)
throws java.lang.Exception
java.lang.Exceptionpublic int getTimeToLive()
public void setTimeToLive(int timeToLive)
public void setTimeToLive(java.lang.Integer timeToLive)
public java.util.Properties getUserData()
public void setUserData(java.util.Properties userData)
public void startService()
public void stopService()
public java.lang.Integer getState()
com.adventnet.adaptors.common.SimpleAdaptor.ON_STATE,
com.adventnet.adaptors.common.SimpleAdaptor.OFF_STATE
public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws java.lang.Exception
preRegister in interface javax.management.MBeanRegistrationjava.lang.Exceptionpublic void postRegister(java.lang.Boolean registrationDone)
postRegister in interface javax.management.MBeanRegistrationregistrationDone - Indicates whether or not the MBean has been successfully
registered in the MBeanServer. The value false means that either the registration phase
has failed.registrationDone - indicates whether the mbean is registered properly
with the server.
public void preDeregister()
throws java.lang.Exception
preDeregister in interface javax.management.MBeanRegistrationjava.langException - This exception should be caught by the MBeanServer and
re-thrown as an MBeanRegistrationException.
java.lang.Exceptionpublic void postDeregister()
postDeregister in interface javax.management.MBeanRegistration
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||