users@javaee-spec.java.net

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

From: <reza_rahman_at_lycos.com>
Date: Tue, 6 Mar 2012 15:10:23 +0000 (GMT)

+1. The spec language/Javadocs should be clear about the intent of these annotations.


Mar 6, 2012 04:16:06 AM, jsr342-experts_at_javaee-spec.java.net wrote:

===========================================

I like the idea but I'm just wondering if this is not too generic and that developpers would start using @AdministeredObjectDefinition to define datasources, JMS factories or mail session ?
Antonio

On Tue, Mar 6, 2012 at 02:06, Linda DeMichiel wrote:
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 definition
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

thanks,

-Linda

-------------------------------------------


/**
 *  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.
 *
 */
@Retention(RUNTIME)
@Target({TYPE})
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:


    Sample Admin Object definition
    java:app/MyAdminObject
    com.extraServices.AdminObject
    myESRA
    
      Property1
      10
    
    
      Property2
      20
    






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