The following is a list of all annotations and their attributes, the xml tags that correspond to them (for overriding), and what the default values are when left unspecified.

Annotation

xml element(s)

default value

@Stateless

  • <session>
  • <ejb-class>
  • <session-type>Stateless</session-type>

 

  • name

<ejb-name>

The simple name of the bean class. For org.acme.superfun.WidgetBean the ejb-name will be WidgetBean

  • description

<description>

 

  • mappedName

<mapped-name>

 

@Stateful

  • <session>
  • <ejb-class>
  • <session-type>Stateful</session-type>

 

  • name

<ejb-name>

The simple name of the bean class. For org.acme.superfun.WidgetBean the ejb-name will be WidgetBean

  • description

<description>

 

  • mappedName

<mapped-name>

 

@MessageDriven

  • <message-driven>
  • <ejb-class>
  • <session-type>Stateful</session-type>

 

  • name

<ejb-name>

The simple name of the bean class. For org.acme.superfun.WidgetBean the ejb-name will be WidgetBean

  • description

<description>

 

  • mappedName

<mapped-name>

 

  • messageListenerInterface

<messaging-type>

The interface the bean class implements. When relying upon the default is illegal for the bean to implement more than one interface

  • activationConfig[]

<activation-config>

 

@ActivationConfigProperty

<activation-config-property>

 

  • propertyName

<activation-config-property-name>

 

  • propertyValue

<activation-config-property-value>

 

@RemoteHome

  • <home>
  • <remote>

The home is inspected to determine the value of <remote>

@LocalHome

  • <local-home>
  • <local>

The local-home is inspected to determine the value of <local>

@TransactionManagement

<transaction-type>

TransactionManagementType.CONTAINER (xml value "Container")

@TransactionAttribute

  • <container-transaction>
  • <transaction-attribute>

All method default to TransactionAttributeType.REQUIRED (xml value "Required")

@RolesAllowed

  • <method-permission>
  • <role-name>

 

@PermitAll

  • <method-permission>
  • <unchecked>

All methods default to unchecked

@DenyAll

<exclude-list>

 

@RunAs

  • <security-identity>
  • <run-as>
  • <role-name>

 

@DeclareRoles

<security-role-ref>

 

@Interceptors

  • <interceptor>
  • <interceptor-binding>
  • <interceptor-class>

 

@ExcludeDefaultInterceptors

  • <interceptor-binding>
  • <exclude-default-interceptors>

 

@ExcludeClassInterceptors

  • <interceptor-binding>
  • <exclude-class-interceptors>

 

@AroundInvoke

<around-invoke>

 

@PostConstruct

<post-construct>

 

@PreDestroy

<pre-destroy>

 

@PrePassivate

<pre-passivate>

 

@PostActivate

<post-activate>

 

@Init

<init-method>

 

@Remove

<remove-method>

 

  • retainIfException

<retain-if-exception>

false

@Timeout

<timeout-method>

 

@ApplicationException

  • <application-exception>
  • <exception-class>

 

  • rollback

<rollback>

false

@EJB

  • <ejb-ref>
  • <ejb-local-ref>
  • <injection-target>

 

  • name
  • <ejb-ref-name>
  • on class: illegal to leave undefined
  • on field: {className}/{fieldName} as in org.superbiz.Widget/myEjb
  • on setter: {className}/{propertyName} as in setMyEjb() defaults to org.superbiz.Widget/myEjb
  • beanInterface
  • <home>
  • <local-home>
  • <remote>
  • <local>
  • on class: illegal to leave undefined
  • on field: the data type of the field
  • on setter: the data type of the first method param
  • beanName

<ejb-link>

 

  • description

<description>

 

  • mappedName

<mapped-name>

 

@Resource

  • <env-entry>
  • <resource-ref>
  • <resource-env-ref>
  • <injection-target>

 

  • name
  • <env-entry-name>
  • <res-ref-name>
  • <resource-env-ref-name>
  • on class: illegal to leave undefined
  • on field: {className}/{fieldName} as in org.superbiz.Widget/myDataSource
  • on setter: {className}/{propertyName} as in setMyDataSource() defaults to org.superbiz.Widget/myDataSource
  • type
  • <env-entry-type>
  • <res-type>
  • <resource-env-ref-type>
  • on class: illegal to leave undefined
  • on field: the data type of the field
  • on setter: the data type of the first method param
  • description

<description>

 

  • mappedName

<mapped-name>

 

  • shareable

<res-sharing-scope>

true (xml value "Shareable")

  • authenticationType

<res-auth>

AuthenticationType.CONTAINER (xml value "Container")

@PersistenceUnit

  • <persistence-unit-ref>
  • <injection-target>

 

  • name

<persistence-unit-ref-name>

on class: illegal to leave undefined

  • on field: {className}/{fieldName} as in org.superbiz.Widget/myUnit
  • on setter: {className}/{propertyName} as in setMyUnit() defaults to org.superbiz.Widget/myUnit
  • unitName

<persistence-unit-name>

vendor specific

@PersistenceContext

  • <persistence-context-ref>
  • <injection-target>

 

  • name

<persistence-context-ref-name>

on class: illegal to leave undefined

  • on field: {className}/{fieldName} as in org.superbiz.Widget/myContext
  • on setter: {className}/{propertyName} as in setMyContext() defaults to org.superbiz.Widget/myContext
  • unitName

<persistence-unit-name>

vendor specific

  • type

<persistence-context-type>

PersistenceContextType.TRANSACTION (xml value "Transaction")

  • properties[]

 

 

@PersistenceProperty

<persistence-property>

 

  • name

<name>

 

  • value

<value>

 

  • No labels