users@glassfish.java.net

Re: sun-resources.xml

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Wed, 14 Nov 2007 14:49:30 +0530

Hi

> I can't find a reference for the sun-resources.xml file. Is it
> possible to use the sun-resources.xml to deploy jms resources? If so

By sun-resources.xml, are you referring to a mechanism to add resources by
declaring resources in an XML file (like asadmin add-resources [1] ) or a
mechanism to bundle the resource-definitions along with the application and
automatically getting the resources created during application deploy?

If it is the former, then [1] should help you in this regard. Please run asadmin
add-resources --help to get complete list of attributes. The XML file should
follow the dtd at $install-root/lib/dtds/sun-resources_1_3.dtd

If it is the latter, unfortunately that feature is not available for public use,
at this point in time.

> can someone provide me with an example that would accomplish the same
> as the following asadmin command?

JMS resources are internally represented as connector resources of the system
resource adapter jmsra. [2] A JMS CF is internally represented as a connector
connection pool and a connector resource and a JMS destination object is
internally a admin-object-resource. The equivalent XML fragment for your
resource-definition your needs would then be:

     <admin-object-resource enabled="true" jndi-name="EmailQueue"
object-type="user" res-adapter="jmsra" res-type="javax.jms.Queue">
       <property name="Name" value="EmailQueue"/>
     </admin-object-resource>

     <connector-connection-pool associate-with-thread="false"
connection-creation-retry-attempts="0"
connection-creation-retry-interval-in-seconds="10"
connection-definition-name="javax.jms.QueueConnectionFactory"
connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0"
fail-all-connections="false" idle-timeout-in-seconds="300"
is-connection-validation-required="false" lazy-connection-association="false"
lazy-connection-enlistment="false" match-connections="true"
max-connection-usage-count="0" max-pool-size="250"
max-wait-time-in-millis="60000" name="MDBQueueConnectionFactory"
pool-resize-quantity="2" resource-adapter-name="jmsra" steady-pool-size="1"
validate-atmost-once-period-in-seconds="0"/>
     <connector-resource enabled="true" jndi-name="MDBQueueConnectionFactory"
object-type="user" pool-name="MDBQueueConnectionFactory"/>

[the trick is: create your resources using asadmin, go to
domains/domain1/config/domain.xml and copy the resource definitions into a XML
document that satisfies the sun-resources-1-3.dtd]

Thanks
--Siva.
[1] http://docs.sun.com/app/docs/doc/819-3662/add-resources-1?a=view
[2]
https://glassfish.dev.java.net/javaee5/integration-tech/glassfish_connectors.html#Java_Connector_Architecture
and
https://glassfish.dev.java.net/javaee5/docs/DG/bealk.html#beall


Kem Elbrader wrote:
> I can't find a reference for the sun-resources.xml file. Is it
> possible to use the sun-resources.xml to deploy jms resources? If so
> can someone provide me with an example that would accomplish the same
> as the following asadmin command?
>
> asadmin create-jms-resource --restype javax.jms.Queue --property
> imqDestinationName=EmailQueue EmailQueue
> asadmin create-jms-resource --restype javax.jms.QueueConnectionFactory
> MDBQueueConnectionFactory
>
> Thanks for any help,
> Kem Elbrader