Resource Environment References; Ejb References - Red Hat APPLICATION SERVER - JONAS Manual

Jonas
Hide thumbs Also See for APPLICATION SERVER - JONAS:
Table of Contents

Advertisement

142
In the standard deployment descriptor, the declaration of a resource reference to a JDBC connection
factory is:
resource-ref
res-ref-name jdbc/AccountExplDs /res-ref-name
res-type javax.sql.DataSource /res-type
res-auth Container /res-auth
/resource-ref
And the bean accesses the datasource as in the following:
InitialContext ictx = new InitialContext();
DataSource ds = ictx.lookup("java:comp/env/jdbc/AccountExplDs");
Binding of the resource references to the actual resource manager connection factories that are
configured in the EJB server is done in the JOnAS-specific deployment descriptor using the
element.
jonas-resource
jonas-resource
res-ref-name jdbc/AccountExplDs /res-ref-name
jndi-name jdbc_1 /jndi-name
/jonas-resource

12.4. Resource Environment References

The resource environment references are another example of environment entries. They allow the
Bean Provider to refer to administered objects that are associated with resources (for example, JMS
destinations), by using logical names. Resource environment references are defined in the standard
deployment descriptor.
resource-env-ref
resource-env-ref-name jms/stockQueue /resource-env-ref-name
resource-env-ref-type javax.jms.Queue /resource-env-ref-type
/resource-env-ref
Binding of the resource environment references to administered objects in the target operational en-
vironment is done in the JOnAS-specific deployment descriptor using the
element.
jonas-resource-env
resource-env-ref-name jms/stockQueue /resource-env-ref-name
jndi-name myQueue jndi-name
/jonas-resource-env

12.5. EJB References

The EJB reference is another special entry in the Enterprise Bean's environment. EJB references allow
the Bean Provider to refer to the homes of other enterprise beans using logical names. For such entries,
using the subcontext
The declaration of an EJB reference used for accessing the bean through its remote home and compo-
nent interfaces in the standard deployment descriptor is shown in the following example:
ejb-ref
ejb-ref-name ejb/ses1 /ejb-ref-name
ejb-ref-type session /ejb-ref-type
java:comp/env/ejb
Chapter 12. Enterprise Bean Environment
is recommended.
jonas-resource-env

Advertisement

Table of Contents
loading

This manual is also suitable for:

Application server

Table of Contents