|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.jcosyne.server.JMXServer
This is executable JMX server class that serves as entry point for JMX
Agent (as defined in the JMX specification). The tasks of this class are to:
firstly, initialize server configuration; secondly, instantiate the
JMX server and its RMI connector and RMI Naming object; do all appropriate
initializations of these objects; and finally, to instantiate default
remote tasks, such as the log collector, sentinel, executor and remote
repository.
The server initializes the configuration by resolving, case by case,
the property name. The resolution first checks if the property name is
set in Java system properties; if not, it tries to check if there is
a server configuration file present at location specified by
Constants.SEVER_CONFIG
, if not, tries to look for
server configuration in user's home directory, and lastly, loading defaults
from the JAR resources.
Constants
Constructor Summary | |
JMXServer()
|
Method Summary | |
void |
handleNotification(javax.management.Notification arg0,
java.lang.Object arg1)
Listens to shutdown notifications from the Sentinel remote task. |
void |
initialize()
Starts the server. |
static void |
main(java.lang.String[] args)
Create a new instance of the server and start it. |
void |
run()
Implements the shutdown code that is called out-of-thread by the shutdown() method. |
void |
shutdown()
Start a shutdown thread that will close the connector after some period of time defined in Constants interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JMXServer()
Method Detail |
public static void main(java.lang.String[] args)
args
- parameters are ignoredpublic void initialize() throws java.lang.IllegalArgumentException
Constants
interface, from where it reads server name,
and port. Checks if RMI registry already exists on the local machine: if not,
creates one; if yes, removes stale server entry and adds itself. Then, in turn,
adds the predefined Jcosyne framework remote tasks. If the properties
do not contain server and port name, throws exception.
java.lang.IllegalArgumentException
- if configuration does not contain all
expected itemspublic void shutdown()
Constants
interface.
public void handleNotification(javax.management.Notification arg0, java.lang.Object arg1)
Sentinel
remote task. If
received, the shutdown()
method is invoked on this object.
handleNotification
in interface javax.management.NotificationListener
public void run()
shutdown()
method.
run
in interface java.lang.Runnable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |