For information on how to set up a node and server, please refer to the JPPF documentation.
Once you have installed a server and node, perform the following steps:
- open a command prompt in JPPF-x.y-samples-pack/NodeConnectionEvents
- build the sample: type "ant jar"; this will create a file named NodeConnectionEvents.jar
- copy NodeConnectionEvents.jar in the "lib" folder of the JPPF driver installation, to add it to the driver's classpath.
- start the server, in its console you should see the following message:
[java] *** MyNodeConnectionListener instance successfully loaded *** - start the node
- in the driver console, you should see the following message:
[java] *** Node host:port is now connected *** - get back to the node's shell console and kill the node (for instance with CTRL+C)
- in the driver console, you should now see the following message:
[java] *** Node host:port is disconnected ***
- Pluggable startup classes for JPPF nodes and servers
- Dynamic code deployment from the server to a node
- Receiving node connection events in the server
If you need more insight into the code of this demo, you can consult the Java source files located in the CustomMBeans/src folder.
In addition, There are 2 privileged places you can go to: