Skip to end of metadata
Go to start of metadata

This chapter details the extensions that are available when developing Enterprise Java Beans tm on JBoss Application Server 7.

Currently there is no support for configuring the extensions using an implementation specific descriptor file.

Resource Adapter for Message Driven Beans

Each Message Driven Bean must be connected to a resource adapter.

Specification of Resource Adapter using Metadata Annotations

The ResourceAdapter annotation is used to specify the resource adapter with which the MDB should connect.

The value of the annotation is the name of the deployment unit containing the resource adapter. For example jms-ra.rar.

For example:

Run-as Principal

Whenever a run-as role is specified for a given method invocation the default anonymous principal is used as the caller principal. This principal can be overridden by specifying a run-as principal.

Specification of Run-as Principal using Metadata Annotations

The RunAsPrincipal annotation is used to specify the run-as principal to use for a given method invocation.

The value of the annotation specifies the name of the principal to use. The actual type of the principal is undefined and should not be relied upon.

Using this annotation without specifying a run-as role is considered an error.

For example:

Security Domain

Each Enterprise Java Bean tm can be associated with a security domain. Only when an EJB is associated with a security domain will authentication and authorization be enforced.

Specification of Security Domain using Metadata Annotations

The SecurityDomain annotation is used to specify the security domain to associate with the EJB.

The value of the annotation is the name of the security domain to be used.

For example:

Transaction Timeout

For any newly started transaction a transaction timeout can be specified in seconds.

When a transaction timeout of 0 is used, then the actual transaction timeout will default to the domain configured default.
TODO: add link to tx subsystem

Although this is only applicable when using transaction attribute REQUIRED or REQUIRES_NEW the application server will not detect invalid setups.

New Transactions
Take care that even when transaction attribute REQUIRED is specified, the timeout will only be applicable if a new transaction is started.

Specification of Transaction Timeout with Metadata Annotations

The TransactionTimeout annotation is used to specify the transaction timeout for a given method.

The value of the annotation is the timeout used in the given unit granularity. It must be a positive integer or 0. Whenever 0 is specified the default domain configured timeout is used.

The unit specifies the granularity of the value. The actual value used is converted to seconds. Specifying a granularity lower than SECONDS is considered an error, even when the computed value will result in an even amount of seconds.

For example:

Specification of Transaction Timeout in the Deployment Descriptor

The trans-timeout element is used to define the transaction timeout for business, home, component, and message-listener interface methods; no-interface view methods; web service endpoint methods; and timeout callback methods.

The trans-timeout element resides in the urn:trans-timeout namespace and is part of the standard container-transaction element as defined in the jboss namespace.

For the rules when a container-transaction is applicable please refer to EJB 3.1 FR 13.3.7.2.1.

Example of trans-timeout

jboss-ejb3.xml
Labels:
ejb ejb Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jul 27, 2012

    How to lookup remote EJB deployed in this JBoss 7.0.x server???