[javaee-spec users] [jsr342-experts] Re: resource definition metadata for administered objects

From: Reza Rahman <>
Date: Thu, 17 May 2012 20:05:56 -0400



From: Antonio Goncalves []
Sent: Tuesday, May 15, 2012 11:21 AM
Subject: [jsr342-experts] Re: resource definition metadata for administered


Hi all,


I'm coming back to this topic because I'm working for a customer's project
and here is what I see in the ejb-jar.xml file :


<ejb-jar xmlns=""










                <description>H2 DataSource</description>










I hadn't pay attention before, but the <data-source> element is nested into
the <session> element. Which is not the case in the web.xml where the
<data-source> element is at the root. Why is not <data-source> defined at
the root ? It should be "the datasource is defined for all EJBs so it's at
the root of the xml file", no ?




On Tue, Mar 6, 2012 at 2:06 AM, Linda DeMichiel <>

We've gotten feedback from our internal team, including connector lead,
that we should also include metadata for connector administered objects.

While I had initially thought that the proposed connector resource
metadata was flexible enough to accommodate this (especially since we
had already covered the most important administered object case, JMS
destination objects), I agree that it would be clearer for developers if we
separate out this additional case.

I plan to add a subsection to the spec to cover this in the EDR we submit
to the JCP. Please let me know asap if you disagree with this.

Draft annotation and XML element are below. I propose that the annotation
should be added to javax.resource




 * Annotation used to define a Connector administered object to be
 * registered in JNDI.
 * Once defined, an administered object may be referenced
 * by a component using the lookup element of the
 * Resource annotation.
public @interface AdministeredObjectDefinition {

    * Description of the administered object.
   String description() default "";

    * JNDI name of the administered object being defined.
   String name();

    * Type of the administered object.
   String className();

    * Name of the resource adapter.
   String resourceAdapterName() default "";

    * Properties of the administered object. These may be
    * vendor-specific properties.
   String[] properties() default {};

XML example:

   <description>Sample Admin Object definition</description>


Antonio Goncalves 
Software architect and Java Champion
Web site <>  | Twitter
<>  | Blog
<>  | LinkedIn
<>  | Paris JUG <>