The Source for Java Technology Collaboration
User: Password:



Eamonn McManus's Blog

Community: Java Web Services and XML Archives


JMX Web Services Connector available in Early Access

Posted by emcmanus on May 04, 2007 at 08:43 AM | Permalink | Comments (1)

The Web Services Connector for Agents being defined by JSR 262 is available in Early Access.

I described the background to this JSR in an earlier blog entry. In short, it serves two purposes:

  • Provide an alternative to the RMI connector for JMX-aware clients (such as JConsole). Because the JSR 262 connector uses SOAP over HTTP, it can reuse a web server configuration you have already established; for example it can reuse the authentication you have defined. It can also function better across firewalls.
  • Interoperate with non-JMX-aware clients. Because the JSR 262 connector is based on the WS-Management standard, it can interoperate with other software that also respects that standard. For example, it can interoperate with WinRM, Microsoft's WS-Management implementation in Windows Vista.

This Early Access Release is part of a formal Early Draft Review in the Java Community Process. The draft specification is available for study and comment. Send any comments to jsr-262-comments@jcp.org. The formal review period ends on the 23rd of May, but feel free to send comments at any time. Of course the sooner you send comments, the more likely you will be able to influence the final specification.

An early version of the Reference Implementation (RI) is also available for download. We are very interested in your experiences with it. The best address to send questions and comments on the RI is users@ws-jmx-connector.dev.java.net. You'll need to join this list before you can send messages to it.

Jean-François Denise did most of the engineering work on the RI and also much of the specification. He will be talking about JSR 262 in our talk at JavaOne next Thursday, and demonstrating how it can interoperate with software not running on the Java platform, including Windows management software.

[Technorati: , , , .]

JSR-262 and WS-Management

Posted by emcmanus on November 06, 2006 at 08:53 AM | Permalink | Comments (5)

JSR-262 is defining "A Web-Services Connector for JMX Agents", and I'm the Spec Lead. The Expert Group recently decided to replace the custom protocol that was defined in the Early Draft document with a protocol that builds on the WS-Management standard. Here's the background to that decision.

WS-Management and WSDM

Ideally a Web Services Connector for the JMX world would build on some existing and standard Web Services protocol. The problem we faced early on in JSR-262 is that there were two such protocols, WS-Management and WSDM. Without getting into the details, the protocols were incompatible and support for them was about evenly split between the major industry players. So rather than choosing one of them arbitrarily, which would have been politically very difficult, we defined a custom protocol.

A custom protocol

The custom protocol is defined in the Early Draft document. It is conceptually very simple, and very specific to JMX technology. Basically we defined two XML document schemas, one representing an MBeanServer request, such as getAttribute or queryNames, and the other representing the corresponding reply. Then the protocol basically consisted of a trivial WSDL that defined an operation taking an MBeanServerRequest parameter and returning an MBeanServerResponse.

Original (custom) JSR-262 protocol used document exchange

(This is simple only conceptually, because it becomes massively complicated once you start getting into the details of how Java objects are serialized into XML inside the requests and responses.)

Convergence between WS-Management and WSDM

The picture changed with the publication of the white paper Toward Converging Web Service Standards for Resources, Events, and Management, co-signed by key players in each of the two camps. With this paper, an approach based on an existing standard rather than a custom protocol became possible. Furthermore, we had begun getting feedback that defining a new and arguably rival standard was leading to confusion.

From a practical perspective, it is not expected that the converged standard will be finalized before about 2008. JSR-262 is targeted for Java SE 7, which is also scheduled for 2008, but given the necessary lead time to integrate into Java SE, we cannot reasonably wait for the converged protocol to be ready. However, studying the convergence proposal, we can see that its bottom layers are the existing standards WS-Transfer, WS-Enumeration, and WS-Eventing. WS-Management is basically just a definition of how to use these three specifications for management.

So if we include WS-Management in version 1.0 of JSR-262, we can plan to support the converged protocol in a later version, and that should be an incremental and compatible change. It will add the new specifications discussed in the convergence document: WS-ResourceTransfer, WS-Transfer Addendum, WS-MetadataExchange 1.1, and WS-EventingNotification.

A further advantage of including WS-Management is that we have a much better story for integration into heterogeneous network environments. Previous JMX standards defined a sort of "JMX island". They were very useful provided everything was based around JMX technology. But if parts of your network didn't use JMX technology, then they were cast out of the island.

Client use cases for JSR-262

Rather than launching straight into a deeply technical exploration of what this change implies for the JSR-262 protocol, I think it is useful to look at what we see as being the client use cases driving our choices.

Client use case: JMX Connector Client

This is a Java client that is using the JMX Remote API to access the server. Ideally, this client should look exactly like a client using another protocol (such as the RMI connector defined by JSR-160). The only difference should be the URL it specifies. So in particular there should not need to be any configuration of XML schemas or the like on the client or server for this use case.

Use case: JMX Connector Client

The switch to WS-Management will be completely invisible to this sort of client. It still establishes its connection with JMXConnectorFactory.connect, using code something like this:

JMXServiceURL url = new JMXServiceURL("service:jmx:ws://blah:8888/blah");
JMXConnector cc = JMXConnectorFactory.connect(url);
MBeanServerConnection mbsc = cc.getMBeanServerConnection();
String osName = mbsc.getAttribute(
    new ObjectName("java.lang:type=OperatingSystem"), "Name");

This code is exactly the same as if we were using the RMI connector that is already part of the Java SE platform, except that we have replaced :rmi: in the JMXServiceURL by :ws:. We could deploy both an RMI connector and a WS connector for the same MBean Server, and then clients could connect with either.

The details of exactly what gets sent over the wire do change compared to the Early Draft, of course, since the protocol is now based on WS-Management. But both the client and the server will be updated to reflect the change.

Client use case: JMX-aware client

This is a client, probably not running on the Java platform, that is interacting with JMX resources. For example, suppose you have an app server that exposes the JSR-77 MBeans, and you deploy a JSR-262 connector server on top of it. Then you could write a perl or ruby or C# client that is able to display the various statistics exposed by those MBeans.

Use case: JMX-aware client

It might be more accurate to call this client "JMX-model-aware". It probably doesn't know what the MBeanServer interface looks like, but it does know the details of one or more JMX models. In the example, it knows what the names of the MBeans in the JSR-77 model are, even if it calls them "Resource Instances" rather than MBeans. It knows what attributes it can expect to find in those MBeans, even if it calls them "properties".

Client use case: Specific WS-Management client

This is a client that is expecting a particular schema or set of schemas for the WS-Management resources it is interacting with. For example, a client that knows about a CIM model and that accesses that model using the standard WS-CIM mapping. In this use case, JMX is just an implementation technology and the client interaction is exactly the same as if it were interacting with a C# agent implementing the same model.

Use case: WS-Man client

Not a client use case: using the JMX API to access WS-Management

We do not intend to address the use case of a JMX Connector Client that is using the JMX Remote API to interact with arbitrary WS-Management instrumentation. The connector client we define expects the WS-Management agent it interacts with to implement the exact schemas we define. If you need to interact with WS-Management, then you should use a WS-Management client API, such as the one defined by the Wiseman project. The JMX Remote API is not a good fit for this case.

XML schemas for WS-Management content

To understand the WS-Management client use case, you need to know that WS-Management does not specify the XML schema to be used for "Management Resources". Suppose you want to GET the properties of a certain physicalDisk resource, equivalent to getting the attributes of the physicalDisk MBean in JMX parlance. WS-Management says what the SOAP envelope for the request and reply must look like, but it doesn't specify what XML schema will be used for the contents -- the actual attributes. In this example from the WS-Management spec, the SOAP body of the reply might look like this:

<s:Body>
  <PhysicalDisk xmlns="http://schemas.acme.com/2005/02/samples/physDisk">
    <Manufacturer> Acme, Inc. </Manufacturer>
    <Model> 123-SCSI 42 GB Drive </Model>
    <LUN> 2 </LUN>
    <Cylinders> 16384 </Cylinders>
    <Heads> 80 </Heads>
    <Sectors> 63 </Sectors>
    <OctetsPerSector> 512 </OctetsPerSector>
    <BootPartition> 0 </BootPartition>
  </PhysicalDisk>
</s:Body>

The client had better be prepared to deal with the http://schemas.acme.com/2005/02/samples/physDisk namespace, <PhysicalDisk>, <Manufacturer>, and so on. Conversely, the server has to know what schema the client is expecting.

So to be useful in a general WS-Management context, JSR-262 will have to provide an adaptor in the JMX sense of the word. An adaptor takes a standard protocol such as SNMP or WS-Management and converts it into operations on the JMX MBean Server.

In the case of a WS-Management adaptor, it will need to take SOAP headers like these (excerpted)...

<wsman:ResourceURI>http://samples.org/2005/02/physicalDisk</wsman:ResourceURI>
<wsa:Action>
  http://schemas.xmlsoap.org/ws/2004/09/transfer/Get
</wsa:Action>
<wsman:SelectorSet>
  <wsman:Selector Name="LUN"> 2 </wsman:Selector>
</wsman:SelectorSet>

...and derive a JMX ObjectName like org.samples.2005.02:type=physicalDisk,LUN=2. And it will need to convert the AttributeList that it gets back from MBeanServer.getAttributes into an XML fragment like the one above.

We will define some JMX-specific rules that say how an arbitrary ObjectName is represented in the SOAP headers of a WS-Management request, and how the contents of an arbitrary MBean are represented in the SOAP body of a request or a reply. This will allow the connector use case to work without any explicit customization of the client or the server.

We will also define a plug-in mechanism that will allow you to customize these rules for a particular environment, in the WS-Management use case. So you could could tell the adaptor how to convert <wsman:ResourceURI>http://samples.org/2005/02/physicalDisk</wsman:ResourceURI> etc into org.samples.2005.02:type=physicalDisk,LUN=2, and how to convert between an AttributeList and <PhysicalDisk xmlns="http://schemas.acme.com/2005/02/samples/physDisk"> etc.

A particular application of this plug-in mechanism would apply to the WS-CIM mapping, as illustrated above. However, to be complete we would also need to specify how CIM classes are translated into JMX MBeans, which is beyond the scope of the JSR. It's definitely something we'll investigate in order to validate the proposed plug-in mechanism.

Another way to look at this is that the first two use cases correspond to a situation where you are starting from an existing JMX model such as the JSR-77 MBeans. The third use case corresponds to a situation where you are starting from an existing WS-Management model such as one you might get from applying WS-CIM to a CIM model.

So what happens now?

We need to rework the specification and the Reference Implementation to take these changes into account. Luckily the work of implementing the WS-Management protocol in the Java language has already been done in the Wiseman project on java.net, which we intend to build on.

Once the changes have been made to the specification, we plan to release another Early Draft. That's probably going to take a few months, though. In the meantime, comments on this change are welcome either in public on this blog or in private to jsr-262-comments@jcp.org. (And now I'll start getting spam at that address!)





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds