ESDL - Enterprise Service Description Language

  Status: implemented,  2005-12-21 15:08:18
  • Created: 2005-12-16 15:56:44+0100
  • Categories: remote
  • Author: friebe

Scope of Change

A new API will be added to programmatically discover an Enterprise Bean's functionality.


Rationale

With this new API, Enterprise Bean client logic can be auto-generated.

Functionality



A) Client Side

Short: Like WSDL, only not in XML.

The ESDL will be realized via a new MBean so it is separated from the invocation API. The TCP/IP server will also run on a different port to make it easily divideable (both availability- and accessibility-wise) from the invocation server.

The entry point class (remote.Remote) will remain the same, though.

Example

  $remote= &Remote::forName('xp://localhost:6449/');
$services= &$remote->lookup('Services');

// 1. List all Enterprise Beans available
foreach ($services->beans() as $bean) {
// ...
}

// 2. Acquire information about a certain service by passing
// its JNDI name
$bean= &$services->bean('Calculator');

The bean object

Contains information about a single Enterprise Java Bean.

  • Type (Session / Entity)
  • Name (remote JNDI-name for use in Remote::lookup())
  • Remote methods - Arguments and their types if available - Return value if available - Transaction types (Required, RequiresNew, ...)


B) Server Side

Short: Same as EASC MBean but deploys some helper services at startup.

Uses JMX operations to find out about an EJB's metadata.

Discovering the deployed applications

Notes:

  • mbeanServer is an instance of the javax.management.MBeanServer class
  • deployments is a Iterator
<org.jboss.deployment.DeploymentInfo>

  deployments= mbeanServer.invoke(
deployer,
"listDeployedApplications",
new Object[] { },
new String[] { }
);

The DeploymentInfo objects contain a list of mbeans that are deployed in the ejb-jar it represents. By iterating over those, instances of org.jboss.metadata.BeanMetaData can be retrieved by querying their "BeanMetaData" attribute (also via JMX). The metadata objects contain everything we want to know on the beans.

Notification-driven

The list of deployed applications is not read whenever a client requests this information but whenever it is necessary to update this list, that is, when an ejb-jar is deployed or undeployed.

  filter= new NotificationFilter() {
public boolean isNotificationEnabled(Notification notification) {
return (
(SubDeployer.START_NOTIFICATION.equals(notification.getType())) ||
(SubDeployer.DESTROY_NOTIFICATION.equals(notification.getType()))
);
}
};

deployer=
new ObjectName("jboss.ejb:service=EJBDeployer");
mbeanServer.addNotificationListener
(
deployer,
// Listen on
this, // Handler, must implement NotificationListener
filter // Filter notifications irrelevant for us
null // Handback object (user data)
);

Security considerations

The description will only describe remote methods. No internals about the Bean are revealed.

Speed impact

The ESDL should not be used at runtime but to generate classes once and then use those.

Dependencies

n/a

Related documents

- Client classes code generator experiment http://xp-framework.net/downloads/stubclassesfor.phps http://xp-framework.net/downloads/xp.xsl

Comments



<EOF>


Table of contents