Friday Sep 19, 2008

Java Remote Job Execution System

This paper describes a Remote Job Execution (RJE) System developed on the JavaTM platform. This system not only allows users to group multiple remote calls into a single job, it also allows calls to use the results of previous calls grouped in the same job as their method input parameters, before the job is sent to a server. With functions to treat communication failures more easily and to handle exceptions directly in the server, the system is designed for developing distributed applications that are more efficient and more reliable than applications developed using the Java platform's Remote Method Invocation (RMI) APIs.

The prototype we developed showed encouraging results for our objectives, and identified some limitations to implement the RJE System on the current JDK version (1.6). Using this prototype allowed us to believe that the Remote Job Execution system is an important and interesting area for research, and to identify some new directions to explore in the distributed application domain.

[Read More]

Tuesday Sep 16, 2008

Event Service: subscribe to a set of MBeans (registered or non-registered)

Event Service allows to subscribe a listener to a set of MBeans, this simplifies user code by grouping multi requests in one, it also reduces obviously communication between a client and its server.

An MBean to add a listener is usually already registered in an MBeanServer, the Event Service allows to subscribe a listener to a non-registered MBean, or one which will be registered/unregistered time to time. This is very useful, let's see an example:

A manager is monitoring Java VMs running on several hosts, an MBeanServer is running on each host, an VM MBean will be registered to the MBeanServer to represent a new coming VM, the MBean will be unregistered when the VM stops, the ObjectName of a VM MBean starts the fixed ObjectName domain like "vm:". The manager adds a notification listener to each VM MBean to be informed of any change in a VM.

  •  The Event Service allows to register a listener to an MBean without know when the MBean appears:
        ObjectName pattern = new ObjectName("vm:\*");
	eventClient.subscribe(pattern, listener, filter, handback);

Without the Event Service, the manager needs to find a VM MBean himself, there are two things he needs to do:

    1) finding all registered VM MBeans when connecting to an MBeanServer running on a host, this can be done by sending a query request:

        ObjectName pattern = new ObjectName("vm:\*");


	Set<ObjectName> names = hostMBeanServerConnection.getNames(pattern, null);

    and then registering a listener to each found MBean:

	for (ObjectName name : names) {

hostMBeanServerConnection.addNotificationListener(name, listener, filter, handback);

}

 2) registering a special listener to receive MBeanServerNotifications from MBeanServerDelegate, if a received MBeanServerNotifications is about a VM MBean registration, adding a listener to the new registered VM MBean.
Considering that some VM MBeans will come or disappear during 1), the manager should pay attention to not miss any new coming VM MBean or to not add a listener to a VM MBean more than one time. This is not an easy job.

 

  • The Event Service helps avoid missing notifications. After a VM MBean is registered, it may send out immediately notifications. If the manager needs to wait at first an MBeanServerNotifications from MBeanServerDelegate to be informed of a new MBean registration and then add a listener to the MBean, he may miss some notifications sent out before his listener is added. With the Event Service, this problem will not appear if the VM MBean implements the interface MBeanRegistration and ensures to not send out notification before the method MBeanRegistration.postRegister(Boolean registrationDone)) is called. It is always a good practice to not send out notification before MBean registration is finished.


Wednesday Sep 10, 2008

Event Service in version 7 of the Java SE platform

Event driven management is powerful and efficient, it allows management decisions to be made at each event occurrence instead of at each discrete time interval, thus saving power and giving higher performance. JMX specifies and provides a very useful notification service allowing to realize event driven management. In our recent work in version 7 of the Java SE platform, we have specified a new Event Service for JMX, it contains:

  1. An Open Architecture. By separating the notification delivering mechanics from a JMX connector, it allows to use a user-specific notification transport from a server to a client, to specify a thread pool for notification transporting and distributing notifications, to recover from a disconnected connector ...
  2. Enhancement of Event Management. It allows to subscribe a listener to an MBean which is not yet registered, or to a set of MBeans whose ObjectNames are matched by an ObjectName pattern. I will talk these new features in my following blogs, and give some examples showing how to use the new features.
About

Shanliang Jiang

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today