@ejb Class Level Tag Usage

@ejb.activation-config-property (0..*)

Defines information about the expected configuration properties of the message-driven bean in its operational environment. The properties that are recognized for a particular message-driven bean are determined by the messaging type. The following activation-config-properties are automatically generated from the corresponding parameters in ejb.bean and do not require a ejb.activation-config-property tag: acknowledgeMode, messageSelector, destinationType, subscriptionDurability. Only applicable to EJB 2.1 message-driven beans.

Applies to: EJB 2.1 messge-driven beans

ParameterTypeApplicabilityDescriptionMandatory
nametext Contains the name for an activation configuration property of a message-driven bean.

Default value(s):

false
true
valuetext Contains the value for an activation configuration property of a message-driven bean.

Default value(s):

false
true

@ejb.bean (0..1)

The ejb.bean tag provides information about the EJB. It is the one compulsory tag for all EJBs, however not all parameters are applicable for all types of beans, and some parameters apply differently for different types of beans.

Applies to: Applicable for all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
nametext Provides the name of the bean that will be used in the ejb-jar.xml deployment descriptor. true
descriptiontext A description of the bean. Defaults to the first sentence of the class-level javadoc comment of the bean class. false
display-nametextThe display name of the bean.false
small-icontextThe small icon for the bean.false
large-icontextThe large icon for the bean.false
generatebool Set it to "false" if you want the class be excluded from list of EJBs. This is useful for abstract EJBs that other EJBs are to derive from. So you obviously do not want the abstract EJB be wrongly specified in deployment descriptors as a concrete EJB.

Default value(s):

true
false
jndi-nametextRemote Session and Entity beans. Provides the JNDI name of the bean that will be used in the vendor specific deployment descriptors. false
local-jndi-nametextLocal Session and Entity beans, EJB 2.0 Provides the JNDI name of the bean that will be used in the vendor specific deployment descriptors. It's the JNDI name for the local EJB. false
view-typetextSession and Entity beans, EJB 2.0+ Indicates what view-type(s) is(are) supported by the bean. The types "all", "remote-service-endpoint", "local-service-endpoint" and "service-endpoint" are only applicable to EJB2.1 session beans.
Valid options are:

local

remote

both

service-endpoint

local-service-endpoint

remote-service-endpoint

all

Default value(s):

"remote" for EJB 1.1 or "both" for EJB 2.0+
false
typetextSession and Entity beans Defines the bean's "type".
Valid options are:

CMP

BMP

Stateless

Stateful

Default value(s):

CMP (for javax.ejb.EntityBean)

Stateless (for javax.ejb.SessionBean)
true
transaction-typetextSession and Message-driven beans. Defines the bean's transaction type.
Valid options are:

Container

Bean

Default value(s):

Container
false
reentrantboolEntity beans Defines the entity bean's reentrancy.

Default value(s):

false
false
cmp-versiontextEntity beans, EJB 2.0 Defines the version of the spec the bean is for CMP.
Valid options are:

1.x

2.x

Default value(s):

1.x
false
schematextEntity beans, EJB 2.0 Defines the abstract schema name for the bean. false
primkey-fieldtextEntity beans. Defines the primary key field for the bean as per spec. false
use-soft-lockingboolEntity beans If true, then generate a public int version attribute in the auto-generated concrete class, to form a optimistic locking mechanism. The value of version attribute is incremented in ejbStore. Note: It's applicable to both CMP and BMP, but many containers have optimistic locking capabilities built-in, so you don't need to worry about it locking issues.

Default value(s):

false
false
message-selectortextMessage-driven beans Defines an optional message selector for MDB. false
acknowledge-modetextMessage-driven beans. Defines the acknowledge mode for MDB.
Valid options are:

Auto-acknowledge

Dups-ok-acknowledge

Default value(s):

Auto-acknowledge
false
destination-typetextMessage-driven beans. Defines the type of destination for MDB.
Valid options are:

javax.jms.Queue

javax.jms.Topic

Default value(s):

javax.jms.Queue
false
destination-linktextMessage-driven beans. Used to link the message-driven bean to a message destination. The value must be the message-destination-name of a message destination in the same Deployment File or in another Deployment File in the same J2EE application unit. Alternatively, the value may be composed of a path name specifying a Deployment File containing the referenced message destination with the message-destination-name of the destination appended and separated from the path name by "#". The path name is relative to the Deployment File containing Deployment Component that is referencing the message destination. This allows multiple message destinations with the same name to be uniquely identified. A message-destination-link is automatically generated if you add a message-destination tag to the message-driven bean. This should be used if the message-destination is specified in another bean or in a merge-file. Only applicable to EJB 2.1 message-driven beans. false
subscription-durabilitytextMessage-driven beans. Defines the durability of messages for MDB as per EJB 2.0 spec.
Valid options are:

Durable

NonDurable

Default value(s):

Durable
false
destination-jndi-nametextMessage-driven beans Defines the jndi name of the destination queue/topic. false
connection-factory-jndi-nametextMessage-driven beans Defines the jndi name of the JMS connection factory. false
messaging-typetextEJB 2.1 message-driven beans. The messaging-type element specifies the message listener interface of the message-driven bean. If the messaging-type element is not specified, it is assumed to be javax.jms.MessageListener. Only applicable to EJB 2.1 message-driven beans.

Default value(s):

javax.jms.MessageListener
false
remote-business-interfacetextSession and Entity beans Defines the remote business interface for the bean. If present, ejb.interface-method tags are not required, instead the remote interface will extend the business interface. The business interface must declare all methods as throwing RemoteException as per the business interface pattern. The generated techinical bean class (with thesession, entitycmp or entitybmp subtask) implements this interface (Business Interface Pattern). false
local-business-interfacetextSession and Entity beans Defines the local business interface for the bean. Similar to remote-business-interface, but the interface does not need to declare RemoteException in the throws clause. The generated techinical bean class (with the session, entitycmp or entitybmp subtask) implements this interface (Business Interface Pattern). false
impl-class-nametextAll EJB Types. Provides the fully qualified classname of the bean's implementation class, to be used in the ejb-class element of the ejb-jar.xml deployment descriptor. Its value is only used when the implementation class is not being generated by a subtask (e.g. <session/>, <entitycmp/>, ...) as those subtasks have other ways to determine the classname. This parameter is mainly intended to be used where the bean class itself is generated, and additional code is to be added in a subclass. false
service-endpoint-business-interfacetextSession beans Defines the service-endpoint business interface for the bean. Similar to remote-business-interface. false

@ejb.dao (0..1)

Defines a data access object for an EJB. If the <dao/> subtask is included, then DAO interfaces will be generated for any EJBs containing this tag, unless a generate="false" parameter is present.

Applies to: Any EJB

ParameterTypeApplicabilityDescriptionMandatory
classtext The fully qualified name of the DAO interface. If absent the interface name will be determined using the pattern and package parameters. false
patterntext Define the pattern (using {0} for the EJB name) to be used for constructing the unqualified (package specific) name of the DAO interface. false
packagetext Define the package the DAO interface is in (generated or not). Use <packageSubstitution/> to configure which package the interface should end up in. false
generatebool Indicate if the DAO interface should be generated.

Default value(s):

true
false
impl-classtext The fully qualified name of a class which implements the DAO interface. If present, the generated code for obtaining a DAO will just create a new instance of this class. false
impl-jnditext Indicates a JNDI environment reference which will contain a String that is the fully qualified name of a class implementing the DAO interface. If present, the generated code for obtaining a DAO will look up this reference, then create a new instance of the class whose name is found there. This allows the actual implementation class to be determined at runtime. false
impl-factorytext The fully qualified name of a factory class which can create DAO instances. If present, the generated code for obtaining a DAO will call a static method getDaoInstance(Class) on this class, which should return an object of the type specified in the class parameter. The call passes in the class to the getDaoInstance method in order to allow a single factory class to be used for multiple DAOs. false
create-methodstext Indicate if create methods should be automatically included in the DAO interface.

Default value(s):

true
false
finder-methodstext Indicate if finder methods should be automatically included in the DAO interface.

Default value(s):

true
false

@ejb.data-object (0..1)

Defines configuration attributes used for data object generation.

Applies to: Applicable only for Entity beans.

ParameterTypeApplicabilityDescriptionMandatory
extendstext Declare which class the generated bulk data class should extend. The class must be java.io.Serializable. This is useful if you want to add some methods that should always be available in bulk data objects.

Default value(s):

java.lang.Object
false

@ejb.destination-ref (0..*)

Contains a declaration of Deployment Component's reference to a message destination associated with a resource in Deployment Component's environment. Only applicable to EJB 2.1.

Applies to: Applicable to all EJB 2.1 beans.

ParameterTypeApplicabilityDescriptionMandatory
nametext Specifies the name of a message destination reference; its value is the environment entry name used in Deployment Component code. The name is a JNDI name relative to the java:comp/env context. true
descriptiontextOptional description of a message destination reference.false
typetext Specifies the type of the destination. The type is specified by the Java interface expected to be implemented by the destination, eg javax.jms.Queue. true
usagetext Specifies the use of the message destination indicated by the reference. The value indicates whether messages are consumed from the message destination, produced for the destination, or both. The Assembler makes use of this information in linking producers of a destination with its consumers.

Default value(s):


Valid options are:

Consumes

Produces

ConsumesProduces

Default value(s):

Produces
false
linktext Used to link a message destination reference to a message destination. The Assembler sets the value to reflect the flow of messages between producers and consumers in the application. The value must be the message-destination-name of a message destination in the same Deployment File or in another Deployment File in the same J2EE application unit. Alternatively, the value may be composed of a path name specifying a Deployment File containing the referenced message destination with the message-destination-name of the destination appended and separated from the path name by "#". The path name is relative to the Deployment File containing Deployment Component that is referencing the message destination. This allows multiple message destinations with the same name to be uniquely identified. false

@ejb.ejb-external-ref (0..*)

Defines an EJB reference to a bean which will be packaged in a different ejb jar file. For field-level tags, the Home-Interface is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the Home-Interface. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicable to all types of EJBs.

ParameterTypeApplicabilityDescriptionMandatory
view-typetextThe view type that the reference uses.
Valid options are:

local

remote

Default value(s):

remote
false
linktext Defines an ejb-link to the referenced EJB. The value of the ejb-link element is the name of the target enterprise bean. (It is the name defined in the ejb-name element of the target enterprise bean.) The target enterprise bean can be in any ejb-jar file in the same J2EE application as the referencing application component. false
jndi-nametext The referenced bean's physical JNDI-Name. false
ref-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer. Mandatory for class-level tags. For field- and method-level tags, the default value is the method or field name. false.
ejb-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer. Deprecated. Use ref-name instead.

Default value(s):

ejb/[ejb-name], where [ejb-name] is the name of the referenced bean.
false
typetextThe type of EJB being referenced.
Valid options are:

Entity

Session
true
hometext The fully qualified class name of the home interface of the referenced bean. true
businesstext The fully qualified class name of the business interface (local or remote interface) of the referenced bean. true
remotetext (Deprecated). Synonym for 'business' parameter. Only works if the view-type is 'remote'. false

@ejb.ejb-ref (0..*)

Defines an EJB-reference to the bean with EJB-name [ejb-name]. ref-name is optional and if not specified then the reference name is [ejb-name] for remote references and [ejb-name]Local for local references. Attention: you have to import the referred class (the ejbdoclet one) even your EJB does not need it. For field-level tags, the Home-Interface is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the Home- or Component-Interface type. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the Home-Object. If the method's return type is the Component-Interface, create() is invoked to return the EJBObject. This is usefull for references to stateless session beans.

ParameterTypeApplicabilityDescriptionMandatory
ejb-nametextThe name of the EJB being referenced.true
view-typetextThe view type that the reference uses.
Valid options are:

local

remote

Default value(s):

The referenced bean's view type if the referenced bean has either view-type 'local' or 'remote'. 'remote' if the referenced bean has view-type 'both'.
false
ref-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer.

Default value(s):

Class-level tags: ejb/[ejb-name] for remote references an ejb/[ejb-name]Local for local references, where [ejb-name] is the name of the referenced bean. Method- and field-level tags: the method or field name.
false

@ejb.ejb-service-ref (0..*)

Defines a (web)service reference for an EJB. This is a EJB2.1 thing. For field-level tags, the service is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the servic-interface. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicatble to all EJB types with EJB-spec 2.1

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextOptional descriptionfalse
nametext The logical name of the component to be looked up. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
interfacetext The fully qualified class name of the JAX-RPC interface. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type. true
wsdl-file-uritextThe URI location of a WSDL-file. This is relative to the module root.false
jaxrpc-mapping-filetextThe name of a JAXRPC-mapping file describing the mapping from Java to Wsdl.false
qnametext Ths service-qname describes the specific wsdl service element that is being refered to. This is only needed if a wsdl file is given. false

@ejb.env-entry (0..*)

Defines an environment entry for an EJB. For field-level tags, the env-entry's value is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the env-entry's value. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value. If the field type or the method's return type is primitive, the env-entry is generated for the corresponding wrapper class and automatically converted during the lookup. Applicapable for the following field types and method return types: java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.String, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, boolean, int, byte, char, short, int, long, float, double

Applies to: Applicable to all EJB types

ParameterTypeApplicabilityDescriptionMandatory
nametext The name of the env-entry. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
descriptiontextOptional description of the env-entry.false
typetextOnly class level tags The type of the env-entry, eg java.lang.String. Supported types outlined in the EJB spec. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type.
Valid options are:

java.lang.Boolean

java.lang.Byte

java.lang.Character

java.lang.String

java.lang.Short

java.lang.Integer

java.lang.Long

java.lang.Float

java.lang.Double

Default value(s):

java.lang.String
false
valuetextThe value of the env-entry.false

@ejb.facade (0..1)

This tag is optional and allows generation of session facade EJB for entity bean. Facade EJB will provide all finder and creation methods to outside, and also all data setting methods for data and value objects. Finder methods will return collections of data or value objects instead of remote interfaces. Facade bean will connect to EJB using local (if generated) or remote interfaces. Resulting bean needs processing by XDoclet together with all EJB classes.

Applies to: Entity beans.

ParameterTypeApplicabilityDescriptionMandatory
nametext Name of generated facade EJB.

Default value(s):

{0}Facade
false
descriptiontext A description of the bean. Defaults to the first sentence of the class-level javadoc comment of the bean class. false
display-nametextThe display name of the bean.false
small-icontextThe small icon for the bean.false
large-icontextThe large icon for the bean.false
jndi-nametextRemote Session and Entity beans Provides the JNDI name of the bean that will be used in the vendor specific deployment descriptors. false
local-jndi-nametext Provides the JNDI name of the bean that will be used in the vendor specific deployment descriptors. It's the JNDI name for the local EJB. false
view-typetext Indicates what view-type(s) is(are) supported by the bean.
Valid options are:

local

remote

both

Default value(s):

remote
false
typetext Defines the bean's "type".
Valid options are:

Stateless

Stateful

Default value(s):

Stateless
true
transaction-typetext Defines the bean's transaction type.
Valid options are:

Container

Bean

Default value(s):

Container
false

@ejb.finder (0..*)

Defines a finder method for the home interface. An entity bean may have zero or more ejb.finder tags.

Applies to: Applicable only to Entity beans.

ParameterTypeApplicabilityDescriptionMandatory
view-typetext To restrict the home interface in which the finder will be defined.
Valid options are:

local

remote

both

Default value(s):

both
false
descriptiontextDescription of the finder.false
signaturetext Defines the signature of the method. E.g.. "java.util.Collection findAll()". The return type in the signature must be fully qualified. true
uncheckedboolEntity beans, EJB 2.0 Flags the finder as having unchecked permission. If present, role-name must be omitted.

Default value(s):

true
false
role-nametext A comma-separated list of roles that can invoke this finder method. false
querytextEntity beans, EJB 2.0 EJB-QL query for the finder. false
result-type-mappingtextEntity beans, EJB 2.0 Result type mapping (indicates the return type) for the finder method.
Valid options are:

none

Local

Remote

Default value(s):

none
false
transaction-typetext Indicates the transaction type attribute sets to the method. false
method-intftext Indicates the interface (Home or LocalHome) for which the finder permissions should be set. If the permissions should apply to both Home or LocalHome interfaces, this parameter should not be specified.
Valid options are:

Home

LocalHome
false

@ejb.home (0..1)

The @ejb.home tag provides information about an Entity or Session Bean's home interface. All parameters are applicable to both Entity and Session beans.

Applies to: Applicable to Entity and Session beans.

ParameterTypeApplicabilityDescriptionMandatory
extendstext Declare which interface the generated home interface should extend.

Default value(s):

javax.ejb.EJBHome
false
local-extendstextSession and Entity beans, EJB 2.0 Declare which interface the generated local home interface should extend.

Default value(s):

javax.ejb.EJBLocalHome
false
generatetext Which home interfaces should be generated.
Valid options are:

local

remote

Default value(s):

local,remote
false
remote-classtext The fully qualified name of the remote home interface. false
local-classtextSession and Entity beans, EJB 2.0 The fully qualified name of the local home interface. false
remote-patterntext The pattern to be used in determining the unqualified name of the remote home interface - only used if remote-class is not present. false
local-patterntextSession and Entity beans, EJB 2.0 The pattern to be used in determining the unqualified name of the local home interface - only used if local-class is not present. false
patterntext The pattern to be used in determining the unqualified name of either local or remote home interfaces. Used where -class and -pattern tags are absent for the bean. false
remote-packagetext The package the remote home interface should be in - only used where remote-class is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false
local-packagetext The package the local home interface should be in - only used where local-class is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false
packagetext The package the home interfaces to be placed in - only used where -class or -package is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false

@ejb.interface (0..1)

The @ejb.interface tag provides information about an Entity or Session Bean's component interfaces (remote and/or local and/or service-endpoint). It is not applicable to Message-driven beans. The view-type "service-endpoint" is restricted to EJB2.1 Session beans. All parameters are applicable to both Entity and Session beans.

Applies to: Applicable to both Entity and Session beans.

ParameterTypeApplicabilityDescriptionMandatory
extendstext Declare which interface(s) the generated remote interface should extend (comma separated list).

Default value(s):

javax.ejb.EJBObject
false
local-extendstextSession and Entity beans, EJB 2.0 Declare which interface(s) the generated local interface should extend (comma separated list).

Default value(s):

javax.ejb.EJBLocalObject
false
service-endpoint-extendstext Declare which interface(s) the generated service-endpoint interface should extend (comma separated list). Default is "java.rmi.Remote".

Default value(s):

java.rmi.Remote
false
generatetext Which interfaces should be generated. Defaults to true.
Valid options are:

local

remote

service-endpoint

Default value(s):

local,remote
false
remote-classtext The fully qualified name of the remote interface. false
local-classtextSession and Entity beans, EJB 2.0 The fully qualified name of the local interface. false
service-endpoint-classtextSession beans, EJB 2.1 The fully qualified name of the service endpoint interface. false
remote-patterntext The pattern to be used in determining the unqualified name of the remote interface - only used if remote-class is not present. false
local-patterntextSession and Entity beans, EJB 2.0 The pattern to be used in determining the unqualified name of the local interface - only used if local-class is not present. false
service-endpoint-patterntextSession beans, EJB 2.1 The pattern to be used in determining the unqualified name of the service-endpoint interface - only used if service-endpoint-class is not present. false
patterntext The pattern to be used in determining the unqualified name of either local or remote interfaces. Used where -class and -pattern tags are absent for the bean. false
remote-packagetext The package the remote interface should be in - only used where remote-class is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false
local-packagetextSession and Entity beans, EJB 2.0 The package the local interface should be in - only used where local-class is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false
service-endpoint-packagetextSession beans, EJB 2.1 The package the service-endpoint interface should be in - only used where service-endpoint-class is not present. Use <packageSubstitution/> to configure which package the interface should end up in. false
packagetext The package for the interfaces to be placed in. Only used where -class and -package are not present. Use <packageSubstitution/> to configure which package the interface should end up in. false

@ejb.message-destination (0..*)

The message-destinationType specifies a message destination. The logical destination described by this element is mapped to a physical destination by the Deployer. Only applicable to EJB 2.1 message-driven beans.

Applies to: EJB 2.1 messge-driven beans

ParameterTypeApplicabilityDescriptionMandatory
nametext Contains the name of the message-destination. true
display-nametext Contains the display name of the message-destination. false
descriptiontext Contains the description of the message-destination. false
jndi-nametext Contains the jndi-name of the message-destination. false

@ejb.permission (0..1)

Defines the transactional behaviour for this method. Applicable to methods with @ejb.create-method and @ejb.interface-method tags. When used on class level applies to all interface methods cumulatively.

Applies to: Session and Entity beans

ParameterTypeApplicabilityDescriptionMandatory
role-nametext Comma-separated list of roles allowed to call this method false
uncheckedboolEntity beans, EJB 2.0 Flags the method as having unchecked permission. If present, role-name must be omitted

Default value(s):

true
false
view-typetextSession and Entity beans, EJB 2.0+ Indicates the view-type(s) for which this permission applies. The types "all", "remote-service-endpoint", "local-service-endpoint" and "service-endpoint" are only applicable to EJB2.1 session beans. This parameter must not be set if "method-intf" is set.
Valid options are:

local

remote

both

service-endpoint

local-service-endpoint

remote-service-endpoint

all

Default value(s):

the view-type for the bean / method
false
method-intftextSession and Entity beans, EJB 2.0+ Indicates the method-interfaces for which this permission applies. The type "ServiceEndpoint" is only applicable to EJB2.1 session beans. This parameter is only applicable to class-level permission. It must not be set if "view-type" is set.
Valid options are:

Remote

Home

Local

LocalHome

ServiceEndpoint

Default value(s):

all interfaces which are supported by the bean / method
false

@ejb.persistence (0..1)

The @ejb.persistence tag provides information about the persistence of a CMP Entity bean.

Applies to: CMP entity bean

ParameterTypeApplicabilityDescriptionMandatory
table-nametext Declare the table to which the CMP will be mapped. If table-name is not specified, the name of the class will be used, and it will be up to the container to create the tables. false
read-onlybool Configures a bean as read-only. Many app servers can optimise access to such beans (e.g. better caching, bypassing checks for changes, etc.) false

@ejb.pk (0..1)

Defines the primary key of an entity bean. If the <entitypk/> subtask is included, then primary key classes will be generated for all entity beans unless a generate="false" parameter is present, or the primary class is in the java.lang package.

Applies to: Entity beans

ParameterTypeApplicabilityDescriptionMandatory
classtext The fully qualified name of the primary key class. If absent the primary key class name will be determined using the pattern and package parameters. false
patterntext Define the pattern (using {0} for the EJB name) to be used for constructing the unqualified (package specific) name of the primary key class. false
packagetext Define the package the pk class is in (generated or not). Use <packageSubstitution/> to configure which package the PK class should end up in. false
generatebool Indicate if the primary key class should be generated. Defaults to true.

Default value(s):

true
false
extendstext Define which class the generated pk must extend. false
implementstext Define which interface the generated pk must implement. false
role-nametext A comma-separated list of roles that can execute findByPrimaryKey. false
uncheckedboolEntity beans, EJB 2.0 Flags the PK-finder as having unchecked permission. If present, role-name must be omitted.

Default value(s):

true
false
method-intftext Indicates the interface (Home or LocalHome) for which the findByPrimaryKey permissions should be set. Applies only if role-name or unchecked is specified. If the permissions should apply to both Home or LocalHome interfaces, this parameter should not be specified.
Valid options are:

Home

LocalHome
false

@ejb.remote-facade (0..1)

Generate remote facade class for entity beans. This class will provide convenient view on session bean and perform all the necessary lookups. Session Bean methods marked with @ejb.facade-method will be included and transparently proxied. Generated class name will follow pattern: {0}Remote

Applies to: Session beans.

@ejb.resource-env-ref (0..*)

Defines a resource environment reference with the specified name and type. For field-level tags, the resource is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the resource's type. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicable to all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextA optional description for the resource.false
nametext The name of the resource. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
typetextOnly class level tags The resource type. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type. true
jndi-nametext The physical jndi-name of the resource. Note: it currently is used only in 1-2 of the app server modules, but those modules will also support this consolidated standard tag soon. false

@ejb.resource-ref (0..*)

Defines a resource reference with the name res-ref-name to a resource of type res-type, and the authentication is done by the one specified in res-auth. For field-level tags, the resource is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the resource's type. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicable to all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextA optional description for the resource.false
res-ref-nametext The name of the environment entry used in the enterprise bean's code. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
res-typetextOnly class level tags The resource type. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type. true
res-authtextThe resource authentication type.
Valid options are:

Container

Application

Default value(s):

Container
true
res-sharing-scopetextThe resource sharing scope
Valid options are:

Shareable

Unshareable

Default value(s):

Shareable
false
jndi-nametext The physical jndi-name of the resource. Note: it currently is used only in 1-2 of the app server modules, but those modules will also support this consolidated standard tag soon. false

@ejb.security-identity (0..1)

The security-identity element specifies whether the caller's security identity is to be used for the execution of the methods of the enterprise bean or whether a specific run-as identity is to be used. It contains an optional description and a specification of the security identity to be used.

Applies to: Session, Entity and Message Driven beans, EJB 2.0

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextThe description of the security identity.false
use-caller-identitybool The use-caller-identity element specifies that the caller's security identity be used as the security identity for the execution of the enterprise bean's methods.

Default value(s):

false
false
run-astext The run-as element specifies the run-as identity to be used for the execution of the methods of an enterprise bean. It contains the name of a security role. false

@ejb.security-role-ref (0..*)

Defines a security role reference with the name role-name to a security role link named role-link.

Applies to: Applicable to Entity and Session beans.

ParameterTypeApplicabilityDescriptionMandatory
role-nametextThe name of the role referencetrue
role-linktextThe name of the role link.true

@ejb.security-roles (0..1)

List additional security roles that are not yet listes by method level @ejb.permission role-name tags. This is useful in conjunction with the @ejb.security-role-ref tag.

ParameterTypeApplicabilityDescriptionMandatory
role-namestextComma separated list of rolestrue

@ejb.transaction (0..1)

Defines the transactional behaviour for this method. Applicable to methods with @ejb.create-method and @ejb.interface-method tags. If used on class level applies to all interface methods unless overridden. Note: To set the transaction type for Message Driven Beans, use the class level tag for now.

Applies to: Entity & Session beans

ParameterTypeApplicabilityDescriptionMandatory
typetextDefine the type of transactional behaviour.
Valid options are:

NotSupported

Supports

Required

RequiresNew

Mandatory

Never

Default value(s):

Supports
true

@ejb.util (0..1)

This tag is optional, and lets you define whether or not a util class should be generated, and whether to use the logical component name (java:comp/env) or the physical JNDI name to do the lookup. If this tag is not specified, the util class will be generated using logical lookups (provided the <utilobject/> subtask is used)

Applies to: Applies to Entity Beans and Session Beans

ParameterTypeApplicabilityDescriptionMandatory
generatetext false or no will omit the generation of the util class. logical will generate a util class that uses the component name for lookup, and physical will generate a class that uses the JNDI name for lookups. Default is logical.
Valid options are:

false

no

logical

physical

Default value(s):

logical
true

@ejb.value-object (0..*)

Definition for ValueObjects that follow the TransferObject pattern from http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html. ValueObjects can 'link' to other objects (of a relation) in two ways: aggregation and composition. Aggregation means that the other object is loosely coupled, while in Composition, the other object is 'embedded'. Note that aggregation and composition are mutually exclusive. See also http://xdoclet.sourceforge.net/xdoclet/valueobjects.html for more info.

Applies to: entity beans

ParameterTypeApplicabilityDescriptionMandatory
nametext The name for this value object. The name will be used to form the generated class name. Using the default pattern, for example, if name is 'User', an 'UserValue' class will be generated. false
matchtext An identifier that can be used to select groups of attributes to be included in this value object. You can repeat this identifier in the method-level @ejb.value-object tag to add a property to a value object. You can use '*' as an special value, indicating that all entity properties will be included in this value object. false
extendstext The name of the class the generated value object class should extend, if any. false
implementstext A comma-separated list of interfaces the generated value object should implements, if any. Please note that XDoclet won't generate methods to implement these interfaces, so use this only if the interfaces doesn't contains any methods, or if the value object superclass (indicated in the 'extends' parameter) already implements all interface methods. false
orderingtext Alters the relationships between value objects. Strict ordering requires that all primary key field in the object are java.lang.Comparable. In return, the value object itself becomes java.lang.Comparable, and has very well defined ordering and equality semantics. Strictly ordered objects are only equal if they each have all their primary key fields set (even to null), and each of these corresponding keys is equal. None indicates that these objects can only be loosly compared. Equality is not as strictly defined, and the objects are not java.lang.Comparable. When ordering is not strict, objects are considered equal if and only if all of their members are themselves equal. In either case the hashCode() is consistent with equals.
Valid options are:

strict

none

Default value(s):

none
false
synchronizationtext Indicates the level of synchronization of the value object. Full synchronization is just what it sounds like, all methods are synchronized. Partial synchronization indicates that only collections are synchronized. None indicates that nothing is synchronized.
Valid options are:

full

partial

none

Default value(s):

partial
false
abstractbool Set if this value object is intended to be an abstract object which other value objects extend. false
generatePKConstructorbool Set if this value object should have a single argument constructor that sets the PK only. It's useful when using aggregation and you want to create a relationship between a new object and an existing object with the form of obj.addSomeObjectRelation(new SomeObject(pk)); false

@ejb Method Level Tag Usage

@dao.call (0..1)

The method is a call to a data access object; the method will be included in the DAO interface, and the EJB's generated subclass will contain a call to the DAO's method.

Applies to: Entity beans

ParameterTypeApplicabilityDescriptionMandatory
nametext Optionally specify the method's name in the DAO (it need not be the same as the calling method in the EJB). If not specified, the default is the usual interface equivalent of the method's name (i.e. generally the same, but ejbFindByX becomes findByX etc.) false

@ejb.aggregate (0..1)

Mark a persistent field containing a reference to another entity bean as being aggregated in this bean. The data object will contain accessor methods for the aggregated entity's data object instead of a reference to the entity itself. The aggregated entity will also be removed when this entity is removed. For example, aggregates are useful for sending graphs of data to the client. This is only applicable to entity beans and has no parameters.

Applies to: Entity bean methods

ParameterTypeApplicabilityDescriptionMandatory
view-typetext Specifies the view-type of the referenced entity bean. Default is remote.
Valid options are:

local

remote

Default value(s):

remote
false

@ejb.create-method (0..*)

The method is an ejbCreate method and will be included in the home interface. It is applicable to Session and Entity beans. In Stateless Session beans the ejbCreate will be created if it is not in the code.

Applies to: Applicable to session and entity beans. Method has to be called ejbCreate

ParameterTypeApplicabilityDescriptionMandatory
view-typetext Optionally specify which view-type the method will be exposed in.
Valid options are:

local

remote

Default value(s):

remote
false

@ejb.ejb-external-ref (0..*)

Defines an EJB reference to a bean which will be packaged in a different ejb jar file. For field-level tags, the Home-Interface is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the Home-Interface. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicable to all types of EJBs.

ParameterTypeApplicabilityDescriptionMandatory
view-typetextThe view type that the reference uses.
Valid options are:

local

remote

Default value(s):

remote
false
linktext Defines an ejb-link to the referenced EJB. The value of the ejb-link element is the name of the target enterprise bean. (It is the name defined in the ejb-name element of the target enterprise bean.) The target enterprise bean can be in any ejb-jar file in the same J2EE application as the referencing application component. false
jndi-nametext The referenced bean's physical JNDI-Name. false
ref-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer. Mandatory for class-level tags. For field- and method-level tags, the default value is the method or field name. false.
ejb-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer. Deprecated. Use ref-name instead.

Default value(s):

ejb/[ejb-name], where [ejb-name] is the name of the referenced bean.
false
typetextThe type of EJB being referenced.
Valid options are:

Entity

Session
true
hometext The fully qualified class name of the home interface of the referenced bean. true
businesstext The fully qualified class name of the business interface (local or remote interface) of the referenced bean. true
remotetext (Deprecated). Synonym for 'business' parameter. Only works if the view-type is 'remote'. false

@ejb.ejb-ref (0..*)

Defines an EJB-reference to the bean with EJB-name [ejb-name]. ref-name is optional and if not specified then the reference name is [ejb-name] for remote references and [ejb-name]Local for local references. Attention: you have to import the referred class (the ejbdoclet one) even your EJB does not need it. For field-level tags, the Home-Interface is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the Home- or Component-Interface type. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the Home-Object. If the method's return type is the Component-Interface, create() is invoked to return the EJBObject. This is usefull for references to stateless session beans.

ParameterTypeApplicabilityDescriptionMandatory
ejb-nametextThe name of the EJB being referenced.true
view-typetextThe view type that the reference uses.
Valid options are:

local

remote

Default value(s):

The referenced bean's view type if the referenced bean has either view-type 'local' or 'remote'. 'remote' if the referenced bean has view-type 'both'.
false
ref-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer.

Default value(s):

Class-level tags: ejb/[ejb-name] for remote references an ejb/[ejb-name]Local for local references, where [ejb-name] is the name of the referenced bean. Method- and field-level tags: the method or field name.
false

@ejb.ejb-service-ref (0..*)

Defines a (web)service reference for an EJB. This is a EJB2.1 thing. For field-level tags, the service is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the servic-interface. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicatble to all EJB types with EJB-spec 2.1

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextOptional descriptionfalse
nametext The logical name of the component to be looked up. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
interfacetext The fully qualified class name of the JAX-RPC interface. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type. true
wsdl-file-uritextThe URI location of a WSDL-file. This is relative to the module root.false
jaxrpc-mapping-filetextThe name of a JAXRPC-mapping file describing the mapping from Java to Wsdl.false
qnametext Ths service-qname describes the specific wsdl service element that is being refered to. This is only needed if a wsdl file is given. false

@ejb.env-entry (0..*)

Defines an environment entry for an EJB. For field-level tags, the env-entry's value is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the env-entry's value. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value. If the field type or the method's return type is primitive, the env-entry is generated for the corresponding wrapper class and automatically converted during the lookup. Applicapable for the following field types and method return types: java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.String, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, boolean, int, byte, char, short, int, long, float, double

Applies to: Applicable to all EJB types

ParameterTypeApplicabilityDescriptionMandatory
nametext The name of the env-entry. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
descriptiontextOptional description of the env-entry.false
typetextOnly class level tags The type of the env-entry, eg java.lang.String. Supported types outlined in the EJB spec. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type.
Valid options are:

java.lang.Boolean

java.lang.Byte

java.lang.Character

java.lang.String

java.lang.Short

java.lang.Integer

java.lang.Long

java.lang.Float

java.lang.Double

Default value(s):

java.lang.String
false
valuetextThe value of the env-entry.false

@ejb.facade-method (0..1)

Marks session bean method for inclusion in remote facade.

Applies to: Interface methods of session bean.

ParameterTypeApplicabilityDescriptionMandatory
invalidatebool Mark this method as invalidating. Remote Facade will fire callbacks and zap caches. Use on methods which change ejb or create/remove entities. NOTE: setting this to true will have no effect for facade methods which cache their result.

Default value(s):

false
false
cachebool Setup result caching for this method result. No effect on void methods.

Default value(s):

false
false
immutablebool If value is immutable it will be never invalidated. No effect on void methods.

Default value(s):

false
false

@ejb.home-method (0..1)

Define this method as a home method (e.g. its name is "ejbHomefoo", and the corresponding home method should be defined in the home interface).

Applies to: Session and Entity beans, EJB 2.0

ParameterTypeApplicabilityDescriptionMandatory
view-typetext Optionally specify which view-type the method will be exposed in.
Valid options are:

local

remote

Default value(s):

local
false

@ejb.interface-method (0..1)

Declare in which interface (local/remote) this method must appear. If the view-type parameter is absent then the method will be added to whatever component interfaces are defined in @ejb.bean.

ParameterTypeApplicabilityDescriptionMandatory
view-typetext Optionally specify which view-type the method will be exposed in. The value "local" or "both" is only applicable to EJB 2.0 beans. The values "service-endpoint", "local-service-endpoint", "remote-service-endpoint", and "all" are only applicable to EJB 2.1 beans.
Valid options are:

local

remote

both

service-endpoint

remote-service-endpoint

local-service-endpoint

all

Default value(s):

remote
false

@ejb.permission (0..1)

Defines the transactional behaviour for this method. Applicable to methods with @ejb.create-method and @ejb.interface-method tags. When used on class level applies to all interface methods cumulatively.

Applies to: Session and Entity beans

ParameterTypeApplicabilityDescriptionMandatory
role-nametext Comma-separated list of roles allowed to call this method false
uncheckedboolEntity beans, EJB 2.0 Flags the method as having unchecked permission. If present, role-name must be omitted

Default value(s):

true
false
view-typetextSession and Entity beans, EJB 2.0+ Indicates the view-type(s) for which this permission applies. The types "all", "remote-service-endpoint", "local-service-endpoint" and "service-endpoint" are only applicable to EJB2.1 session beans. This parameter must not be set if "method-intf" is set.
Valid options are:

local

remote

both

service-endpoint

local-service-endpoint

remote-service-endpoint

all

Default value(s):

the view-type for the bean / method
false
method-intftextSession and Entity beans, EJB 2.0+ Indicates the method-interfaces for which this permission applies. The type "ServiceEndpoint" is only applicable to EJB2.1 session beans. This parameter is only applicable to class-level permission. It must not be set if "view-type" is set.
Valid options are:

Remote

Home

Local

LocalHome

ServiceEndpoint

Default value(s):

all interfaces which are supported by the bean / method
false

@ejb.persistence (0..1)

The @ejb.persistence tag provides information about the persistence of a CMP Entity bean's fields. Use this for methods with the following patterns: public abstract Foo getX(); public abstract boolean isX(); public abstract void setX(Foo newVal); This will create the CMP field "X" in the generated CMP layer of type "Foo", and concrete implementations of the getX/setX methods. For BMP, it will generate getX/setX methods that keep track of a dirty flag (so that ejbStore is only called if necessary). If the type is boolean it is ok to have the get method prefixed "is" instead of "get". If you don't define the setter method, no setter method is generated for the concrete BMP/CMP class (concrete CMP class is generated only if EJB 1.1 or EJB 2.0 but using CMP 1.x). This is useful for cases where for example nothing is set programmatically but via external sources such as a stored procedure. Note that some application servers require jdbc-type and sql-type to be applied together to work correctly; have a look at the respective subtask for your application server.

Applies to: EJB entity bean fields. On the persistent fields getter methods.

ParameterTypeApplicabilityDescriptionMandatory
column-nametext Declare the column-name to which the CMP field will be mapped. false
jdbc-typetext Declare the JDBC Type. Its value must be one of the fields of java.sql.Types (e.g. BIT, CHAR...). This jdbc type will be used by the CMP provider to determine which method to call on PreparedStatement and ResultSet for INSERT / UPDATE / SELECT queries.
Valid options are:

ARRAY

BIGINT

BINARY

BIT

BLOB

BOOLEAN

CHAR

CLOB

DATALINK

DATE

DECIMAL

DISTINCT

DOUBLE

FLOAT

INTEGER

JAVA_OBJECT

LONGVARBINARY

LONGVARCHAR

NULL

NUMERIC

OTHER

REAL

REF

SMALLINT

STRUCT

TIME

TIMESTAMP

TINYINT

VARBINARY

VARCHAR

Default value(s):

VARCHAR
false
sql-typetext Declare the actual type of the field in the database. This value will only be used when the CMP container creates your table (if possible). false
read-onlybool Indicates that a field is read-only. false

@ejb.persistent-field (0..1)

Deprecated. Use the ejb.persistence tag instead.

Applies to: Methods which follow patterns: public abstract Foo getX(); public abstract boolean isX(); public abstract void setX(Foo newVal);

@ejb.pk-field (0..1)

Use this for methods with the following pattern: public abstract Foo getX(). This will denote the persistent field "X" as a primary key field. The use of this tag requires that a primary key class is generated using the entitypk subtask. A primary key class must be used even if only one persistent field is marked with the ejb.pk-field tag. Must be used with the persistent-field tag. This tag is only valid for EntityBeans. It has no parameters.

Applies to: Methods with the following pattern: public abstract Foo getX(). Entity beans only.

@ejb.relation (0..1)

Defines a relationship between Entity beans.

Applies to: Entity beans, EJB 2.0 (CMP2.x)

ParameterTypeApplicabilityDescriptionMandatory
nametext Name of the relation. For bidirectional relationships, specify the same name on both sides. true
role-nametext Name of the relationship role. true
cascade-deletetext Indicates whether or not the app server should perform cascade deletes. If yes, specify cascade-delete="yes". false
target-ejbtext Name of the EJB on the other side of the relation. Should *only* occur if the relation is unidirectional. false
target-role-nametext Name of the relationship role on the other side of the relation. Should *only* occur if the relation is unidirectional. false
target-cascade-deletetext Indicates whether or not the app server should perform cascade deletes for the other side of the relation. If yes, specify cascade-delete="yes". Should *only* occur if the relation is unidirectional. false
target-multipletext If this EJB represents a many-side of the other side of the relation, specify target-multiple="yes". If not, just don't use this parameter, or specify "no". Should *only* occur if the relation is unidirectional. false

@ejb.resource-env-ref (0..*)

Defines a resource environment reference with the specified name and type. For field-level tags, the resource is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the resource's type. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicable to all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextA optional description for the resource.false
nametext The name of the resource. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
typetextOnly class level tags The resource type. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type. true
jndi-nametext The physical jndi-name of the resource. Note: it currently is used only in 1-2 of the app server modules, but those modules will also support this consolidated standard tag soon. false

@ejb.resource-ref (0..*)

Defines a resource reference with the name res-ref-name to a resource of type res-type, and the authentication is done by the one specified in res-auth. For field-level tags, the resource is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the resource's type. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicable to all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextA optional description for the resource.false
res-ref-nametext The name of the environment entry used in the enterprise bean's code. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
res-typetextOnly class level tags The resource type. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type. true
res-authtextThe resource authentication type.
Valid options are:

Container

Application

Default value(s):

Container
true
res-sharing-scopetextThe resource sharing scope
Valid options are:

Shareable

Unshareable

Default value(s):

Shareable
false
jndi-nametext The physical jndi-name of the resource. Note: it currently is used only in 1-2 of the app server modules, but those modules will also support this consolidated standard tag soon. false

@ejb.select (0..*)

Defines a select method. This tag is placed on the ejbSelect methods.

Applies to: Entity beans, EJB 2.0

ParameterTypeApplicabilityDescriptionMandatory
querytextEJB-QL query for the select method.true
result-type-mappingtextResult type mapping for the select method.
Valid options are:

none

Local

Remote

Default value(s):

none
false

@ejb.transaction (0..1)

Defines the transactional behaviour for this method. Applicable to methods with @ejb.create-method and @ejb.interface-method tags. If used on class level applies to all interface methods unless overridden. Note: To set the transaction type for Message Driven Beans, use the class level tag for now.

Applies to: Entity & Session beans

ParameterTypeApplicabilityDescriptionMandatory
typetextDefine the type of transactional behaviour.
Valid options are:

NotSupported

Supports

Required

RequiresNew

Mandatory

Never

Default value(s):

Supports
true

@ejb.value-object (0..*)

For a description have a look at the class level @ejb.value-object description.

Applies to: Entity beans.

ParameterTypeApplicabilityDescriptionMandatory
matchtext Repeat here the 'match' attribute declared in a class-level @ejb.value-object tag to link this property to the declared value object. false
composetext Tell XDoclet which should be the type of items contained in the multi valued property. This should be a fully qualified class name. false
compose-nametext Tell XDoclet how the accessor methods to this property in the value object should be called. The value of this parameter should be the method name, without get or set. false
composes-nametext Tell XDoclet how the accessor to collections of this property in the value object should be called. The value of this parameter should be the method name, without get or set. Default is [aggregate-name]s.

Default value(s):

[compose-name]s
false
aggregatetext Tell XDoclet which should be the type of items contained in the multi valued property. This should be a fully qualified class name. false
aggregate-nametext Tell XDoclet how the accessor methods to this property in the value object should be called. The value of this parameter should be the method name, without get or set. false
aggregates-nametext Tell XDoclet how the accessor to collections of this property in the value object should be called. The value of this parameter should be the method name, without get or set. Default is [aggregate-name]s.

Default value(s):

[aggregate-name]s
false
memberstextThe class of the local or remote interface of the associated or composed bean.false
members-nametextThe Bean Name of the associated or composed Bean.false
relationtext This tells XDoclet that this property can be updated outside of the scope of this value object, so the generated method should always retrieve the property value. For relations, this is a no brainer: always include the relation="external" parameter. false
concrete-typetext This tells XDoclet which Collection implementation to use for storing the related objects from a aggregation or composition.

Default value(s):

java.util.ArrayList for Collections and java.util.HashSet for Sets
false

@ejb Field Level Tag Usage

@ejb.ejb-external-ref (0..*)

Defines an EJB reference to a bean which will be packaged in a different ejb jar file. For field-level tags, the Home-Interface is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the Home-Interface. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicable to all types of EJBs.

ParameterTypeApplicabilityDescriptionMandatory
view-typetextThe view type that the reference uses.
Valid options are:

local

remote

Default value(s):

remote
false
linktext Defines an ejb-link to the referenced EJB. The value of the ejb-link element is the name of the target enterprise bean. (It is the name defined in the ejb-name element of the target enterprise bean.) The target enterprise bean can be in any ejb-jar file in the same J2EE application as the referencing application component. false
jndi-nametext The referenced bean's physical JNDI-Name. false
ref-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer. Mandatory for class-level tags. For field- and method-level tags, the default value is the method or field name. false.
ejb-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer. Deprecated. Use ref-name instead.

Default value(s):

ejb/[ejb-name], where [ejb-name] is the name of the referenced bean.
false
typetextThe type of EJB being referenced.
Valid options are:

Entity

Session
true
hometext The fully qualified class name of the home interface of the referenced bean. true
businesstext The fully qualified class name of the business interface (local or remote interface) of the referenced bean. true
remotetext (Deprecated). Synonym for 'business' parameter. Only works if the view-type is 'remote'. false

@ejb.ejb-ref (0..*)

Defines an EJB-reference to the bean with EJB-name [ejb-name]. ref-name is optional and if not specified then the reference name is [ejb-name] for remote references and [ejb-name]Local for local references. Attention: you have to import the referred class (the ejbdoclet one) even your EJB does not need it. For field-level tags, the Home-Interface is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the Home- or Component-Interface type. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the Home-Object. If the method's return type is the Component-Interface, create() is invoked to return the EJBObject. This is usefull for references to stateless session beans.

ParameterTypeApplicabilityDescriptionMandatory
ejb-nametextThe name of the EJB being referenced.true
view-typetextThe view type that the reference uses.
Valid options are:

local

remote

Default value(s):

The referenced bean's view type if the referenced bean has either view-type 'local' or 'remote'. 'remote' if the referenced bean has view-type 'both'.
false
ref-nametext The name that the referenced bean will be referred to by. For example, to refer to the bean Customer as java:comp/env/ejb/Customer name should be ejb/Customer.

Default value(s):

Class-level tags: ejb/[ejb-name] for remote references an ejb/[ejb-name]Local for local references, where [ejb-name] is the name of the referenced bean. Method- and field-level tags: the method or field name.
false

@ejb.ejb-service-ref (0..*)

Defines a (web)service reference for an EJB. This is a EJB2.1 thing. For field-level tags, the service is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the servic-interface. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicatble to all EJB types with EJB-spec 2.1

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextOptional descriptionfalse
nametext The logical name of the component to be looked up. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
interfacetext The fully qualified class name of the JAX-RPC interface. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type. true
wsdl-file-uritextThe URI location of a WSDL-file. This is relative to the module root.false
jaxrpc-mapping-filetextThe name of a JAXRPC-mapping file describing the mapping from Java to Wsdl.false
qnametext Ths service-qname describes the specific wsdl service element that is being refered to. This is only needed if a wsdl file is given. false

@ejb.env-entry (0..*)

Defines an environment entry for an EJB. For field-level tags, the env-entry's value is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the env-entry's value. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value. If the field type or the method's return type is primitive, the env-entry is generated for the corresponding wrapper class and automatically converted during the lookup. Applicapable for the following field types and method return types: java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.String, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, boolean, int, byte, char, short, int, long, float, double

Applies to: Applicable to all EJB types

ParameterTypeApplicabilityDescriptionMandatory
nametext The name of the env-entry. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
descriptiontextOptional description of the env-entry.false
typetextOnly class level tags The type of the env-entry, eg java.lang.String. Supported types outlined in the EJB spec. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type.
Valid options are:

java.lang.Boolean

java.lang.Byte

java.lang.Character

java.lang.String

java.lang.Short

java.lang.Integer

java.lang.Long

java.lang.Float

java.lang.Double

Default value(s):

java.lang.String
false
valuetextThe value of the env-entry.false

@ejb.resource-env-ref (0..*)

Defines a resource environment reference with the specified name and type. For field-level tags, the resource is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the resource's type. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicable to all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextA optional description for the resource.false
nametext The name of the resource. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
typetextOnly class level tags The resource type. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type. true
jndi-nametext The physical jndi-name of the resource. Note: it currently is used only in 1-2 of the app server modules, but those modules will also support this consolidated standard tag soon. false

@ejb.resource-ref (0..*)

Defines a resource reference with the name res-ref-name to a resource of type res-type, and the authentication is done by the one specified in res-auth. For field-level tags, the resource is automatically looked up and assigned to the field before setSessionContext, setEntityContext or setMessageDrivenContext is called when generating the technical bean with the session, entitybmp, entitycmp or mdb subtask. Therefore, the field must have the protected access modifier. The tag may also be used on abstract methods which return the resource's type. Those methods are implemented in the object generated by the session, entitybmp, entitycmp or mdb subtasks. The implementation performs a caching for the value.

Applies to: Applicable to all EJB types.

ParameterTypeApplicabilityDescriptionMandatory
descriptiontextA optional description for the resource.false
res-ref-nametext The name of the environment entry used in the enterprise bean's code. Mandatory for class level tags. The default for method- and field-level tags is the method or field name. false
res-typetextOnly class level tags The resource type. It is automatically set for method- and field-level tags. For method-level tags, it is set to the method's return type. For field-level tags, it is set to the field's type. true
res-authtextThe resource authentication type.
Valid options are:

Container

Application

Default value(s):

Container
true
res-sharing-scopetextThe resource sharing scope
Valid options are:

Shareable

Unshareable

Default value(s):

Shareable
false
jndi-nametext The physical jndi-name of the resource. Note: it currently is used only in 1-2 of the app server modules, but those modules will also support this consolidated standard tag soon. false