|
Ejb tags
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.
Parameter |
Type |
Applicability |
Description |
Mandatory |
name |
text |
|
Provides the name of the bean that will be used in the ejb-jar.xml
deployment descriptor.
|
true
|
description |
text |
|
A description of the bean. Defaults to the first sentence of the
class-level javadoc comment of the bean class.
|
false |
display-name |
text |
|
The display name of the bean. |
false |
small-icon |
text |
|
The small icon for the bean. |
false |
large-icon |
text |
|
The large icon for the bean. |
false |
generate |
bool |
|
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 is "true".
|
false |
jndi-name |
text |
Remote Session and Entity beans |
Provides the JNDI name of the
bean that will be used in the
vendor specific deployment descriptors.
|
false |
local-jndi-name |
text |
Local 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-type |
text |
Session and Entity beans, EJB 2.0 |
Indicates what view-type(s) is(are)
supported by the bean.
|
false |
type |
text |
Session and Entity beans |
Defines the bean's "type".
|
true
|
transaction-type |
text |
Session and Message-driven beans |
Defines the bean's transaction type.
|
false |
reentrant |
bool |
Entity beans |
Defines the entity bean's reentrancy.
|
false |
cmp-version |
text |
Entity beans, EJB 2.0 |
Defines the version of the spec
the bean is for CMP.
|
false |
schema |
text |
Entity beans, EJB 2.0 |
Defines the abstract schema name for the bean.
|
false |
primkey-field |
text |
Entity beans |
Defines the primary key field for
the bean as per spec.
|
false |
use-soft-locking |
bool |
Entity 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.
The default is false.
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.
|
false |
message-selector |
text |
Message-driven beans |
Defines an optional message selector for MDB.
|
false |
acknowledge-mode |
text |
Message-driven beans |
Defines the acknowledge mode for MDB.
|
false |
destination-type |
text |
Message-driven beans |
Defines the type of destination for MDB.
|
false |
subscription-durability |
text |
Message-driven beans |
Defines the durability of messages
for MDB as per EJB 2.0 spec
|
false |
remote-business-interface |
text |
Session 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.
|
false |
local-business-interface |
text |
Session 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.
|
false |
Defines the data access object of an entity bean. If the subtask is
included, then DAO interfaces will be generated for any entity beans
containing this tag, unless a generate="false" parameter is present.
Parameter |
Type |
Applicability |
Description |
Mandatory |
class |
text |
|
The fully qualified name of the DAO interface. If
absent the interface name will be determined using
the pattern and package parameters.
|
false |
pattern |
text |
|
Define the pattern (using {0} for the EJB name) to
be used for constructing the unqualified (package
specific) name of the DAO interface.
|
false |
package |
text |
|
Define the package the DAO interface is in
(generated or not). Use to
configure which package the interface should end
up in.
|
false |
generate |
bool |
|
Indicate if the DAO interface should be generated.
Defaults to true.
|
false |
impl-class |
text |
|
The fully qualified name of a class which
implements the DAO interface. If present, then
generated code for obtaining a DAO will just
create a new instance of this class.
|
false |
impl-jndi |
text |
|
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,
then 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 |
create-methods |
text |
|
Indicate if create methods should be automatically
included in the DAO interface. Defaults to true.
|
false |
finder-methods |
text |
|
Indicate if finder methods should be automatically
included in the DAO interface. Defaults to true.
|
false |
create-methods |
text |
|
Indicate if create methods should be automatically
included in the DAO interface. Defaults to true.
|
false |
finder-methods |
text |
|
Indicate if finder methods should be automatically
included in the DAO interface. Defaults to true.
|
false |
Defines configuration attributes used for data object generation. Applicable only for
Entity beans.
Parameter |
Type |
Applicability |
Description |
Mandatory |
extends |
text |
|
Declare which class the generated bulk data class should
extend. Default is "java.lang.Object". 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.
|
false |
Defines an EJB reference to a bean which will be packaged in a different
ejb jar file. Applicable to all types of EJBs.
Parameter |
Type |
Applicability |
Description |
Mandatory |
view-type |
text |
|
The view type of the referenced bean. Legal values are local and remote.
|
true
|
link |
text |
|
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.
|
true
|
ref-name |
text |
|
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. Defaults to ejb/[ejb-name], where
[ejb-name] is the named of the referenced bean
(Customer) prefixed by "ejb/".
|
true
|
ejb-name |
text |
|
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. Defaults to ejb/[ejb-name], where
[ejb-name] is the named of the referenced bean
(Customer) prefixed by "ejb/". Deprecated. Use ref-name instead.
|
false |
type |
text |
|
The type of EJB being referenced. |
true
|
home |
text |
|
The fully qualified class name of the home interface of the referenced bean.
|
true
|
business |
text |
|
The fully qualified class name of the business interface (local or remote
interface) of the referenced bean.
|
true
|
remote |
text |
|
(Deprecated). Synonym for 'business' parameter. Only works if the view-type is 'remote'
|
false |
Defines an EJB-reference. Applicable to all EJB types. Attention: you have
to import the referred class (the ejbdoclet one) even your EJB does not need it.
to the bean with EJB-name [ejb-name]. ref-name is optional and if not
specified then the reference name is [ejb-name] prefixed by a ejb/
Parameter |
Type |
Applicability |
Description |
Mandatory |
ejb-name |
text |
|
The name of the EJB being referenced. |
true
|
view-type |
text |
|
The view type that the reference uses. |
true
|
ref-name |
text |
|
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. Defaults to
ejb/[ejb-name], where [ejb-name] is the named of
the referenced bean (Customer) prefixed by
"ejb/".
|
false |
Defines an environment entry for an EJB.
Parameter |
Type |
Applicability |
Description |
Mandatory |
name |
text |
|
The name of the env-entry |
true
|
description |
text |
|
Optional description of the env-entry |
false |
type |
text |
|
The type of the env-entry, eg
java.lang.String. Supported types outlined in
the EJB spec.
"type" is optional, the default is java.lang.Sting.
|
false |
value |
text |
|
The value of the env-entry |
false |
Defines a finder method for the home interface. An entity bean may have zero or more
ejb.finder tags.
Parameter |
Type |
Applicability |
Description |
Mandatory |
view-type |
text |
|
To restrict the home interface in witch the finder will be defined.
|
false |
description |
text |
|
Description of the finder |
false |
signature |
text |
|
Defines the signature of the
method. E.g.. "java.util.Collection
findAll()". The return type in the
signature must be fully qualified.
|
true
|
unchecked |
bool |
Entity beans, EJB 2.0 |
Flags the finder as having
unchecked permission.
If present, role-name must be
omitted
|
false |
role-name |
text |
|
A comma-separated list of roles that can invoke this finder method.
|
false |
query |
text |
Entity beans, EJB 2.0 |
EJB-QL query for the finder.
|
false |
result-type-mapping |
text |
Entity beans, EJB 2.0 |
Result type mapping (indicates the return type) for the finder
method.
|
false |
transaction-type |
text |
|
Indicates the transaction type attribute sets to the method.
|
false |
method-intf |
text |
|
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. |
false |
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.
Parameter |
Type |
Applicability |
Description |
Mandatory |
extends |
text |
|
Declare which interface the generated
home interface should extend. Default is
"javax.ejb.EJBHome".
|
false |
local-extends |
text |
Session and Entity beans, EJB 2.0 |
Declare which interface the generated
local home interface should extend.
Default is "javax.ejb.EJBLocalHome".
|
false |
generate |
bool |
|
Which home interfaces should be
generated. Defaults to true.
|
false |
remote-class |
text |
|
The fully qualified name of the remote
home interface.
|
false |
local-class |
text |
Session and Entity beans, EJB 2.0 |
The fully qualified name of the local
home interface.
|
false |
remote-pattern |
text |
|
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-pattern |
text |
Session 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 |
pattern |
text |
|
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-package |
text |
|
The package the remote home interface
should be in - only used where
remote-class is not present. Use
to configure
which package the interface should end
up in.
|
false |
local-package |
text |
|
The package the local home interface
should be in - only used where
local-class is not present. Use
to configure
which package the interface should end
up in.
|
false |
package |
text |
|
The package the home interfaces to be
placed in - only used where
-class or -package is not present. Use
to configure
which package the interface should end
up in.
|
false |
The @ejb.interface tag provides information about an Entity or
Session Bean's component interfaces (remote and/or local). It is not
applicable to Message-driven beans. All parameters are applicable to both
Entity and Session beans.
Parameter |
Type |
Applicability |
Description |
Mandatory |
extends |
text |
|
Declare which interface the generated
remote interface should extend. Default is
"javax.ejb.EJBObject".
|
false |
local-extends |
text |
Session and Entity beans, EJB 2.0 |
Declare which interface the generated local
interface should extend. Default is
"javax.ejb.EJBLocalObject".
|
false |
generate |
text |
|
Which interfaces should be generated.
Defaults to true.
|
false |
remote-class |
text |
|
The fully qualified name of the remote
interface.
|
false |
local-class |
text |
Session and Entity beans, EJB 2.0 |
The fully qualified name of the local
interface.
|
false |
remote-pattern |
text |
|
The pattern to be used in determining the
unqualified name of the remote interface -
only used if remote-class is not present.
|
false |
local-pattern |
text |
Session 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 |
pattern |
text |
|
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-package |
text |
|
The package the remote interface should be
in - only used where remote-class is not
present. Use to
configure which package the interface
should end up in.
|
false |
local-package |
text |
Session and Entity beans, EJB 2.0 |
The package the local interface should be in
- only used where local-class is not
present. Use
to configure which
package the interface should end up in.
|
false |
package |
text |
|
The package for the interfaces to be placed
in. Only used where -class and -package
are not present. Use
to configure which
package the interface should end up in.
|
false |
The @ejb.persistence tag provides information about the persistence
of a CMP Entity bean.
Parameter |
Type |
Applicability |
Description |
Mandatory |
table-name |
text |
|
Declare the table-name to which the CMP will
be mapped.
|
true
|
$1
Defines the primary key of an entity bean. If the 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.
Parameter |
Type |
Applicability |
Description |
Mandatory |
class |
text |
|
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 |
pattern |
text |
|
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 |
package |
text |
|
Define the package the pk class is in (generated
or not). Use to
configure which package the PK class should
end up in.
|
false |
generate |
bool |
|
Indicate if the primary key class should be
generated. Defaults to true.
|
false |
extends |
text |
|
Define which class the generated pk must
extend.
|
false |
implements |
text |
|
Define which interface the generated pk must
implement.
|
false |
role-name |
text |
|
A comma-separated list of roles that can
execute findByPrimaryKey
|
false |
unchecked |
bool |
Entity beans, EJB 2.0 |
Flags the PK-finder as having unchecked
permission. If present, role-name
must be omitted
|
false |
method-intf |
text |
|
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.
|
false |
Defines a resource environment reference with the name name to a resource
of type type.
Parameter |
Type |
Applicability |
Description |
Mandatory |
name |
text |
|
The name of the resource. |
true
|
type |
text |
|
The type of the resource. |
true
|
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.
Parameter |
Type |
Applicability |
Description |
Mandatory |
res-ref-name |
text |
|
The name of the environment entry used in the enterprise bean's code. |
true
|
res-type |
text |
|
The resource type. |
true
|
res-auth |
text |
|
The resource authentication type. |
true
|
jndi-name |
text |
|
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 |
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.
Parameter |
Type |
Applicability |
Description |
Mandatory |
description |
text |
|
The description of the security identity. |
false |
use-caller-identity |
bool |
|
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.
|
false |
run-as |
text |
|
The run-as element specifies the run-as
identity to be used for the execution of
the methods of an enterprise bean. It
contains an optional description, and the
name of a security role.
|
false |
Defines a security role reference with the name role-name to a security
role link named role-link.
Parameter |
Type |
Applicability |
Description |
Mandatory |
role-name |
text |
|
The name of the role reference |
true
|
role-link |
text |
|
The name of the role link. |
true
|
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
subtask is used)
Parameter |
Type |
Applicability |
Description |
Mandatory |
generate |
text |
|
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.
|
true
|
Please write usage description!!!!!
Parameter |
Type |
Applicability |
Description |
Mandatory |
name |
text |
|
please provide usage descirption!!!!! |
false |
match |
text |
|
please provide usage descirption!!!!! |
false |
extends |
text |
Class level |
please provide usage descirption!!!!! |
false |
implements |
text |
Class level |
Interfaces to be implemented |
false |
type |
text |
|
please provide usage descirption!!!!! |
false |
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.
Parameter |
Type |
Applicability |
Description |
Mandatory |
name |
text |
|
Name of generated facade ejb. Default is {0}Facade
|
false |
description |
text |
|
A description of the bean. Defaults to the first sentence of the
class-level javadoc comment of the bean class.
|
false |
display-name |
text |
|
The display name of the bean. |
false |
small-icon |
text |
|
The small icon for the bean. |
false |
large-icon |
text |
|
The large icon for the bean. |
false |
jndi-name |
text |
Remote Session and Entity beans |
Provides the JNDI name of the
bean that will be used in the
vendor specific deployment descriptors.
|
false |
local-jndi-name |
text |
|
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-type |
text |
|
Indicates what view-type(s) is(are)
supported by the bean.
|
false |
type |
text |
|
Defines the bean's "type".
|
true
|
transaction-type |
text |
|
Defines the bean's transaction type.
|
false |
Generate remote facade class for entity beans.
This class will provide convenient view on session bean
and perform all the necesary lookups.
Session Bean methods marked with @ejb.facade-method
will be included and transparently proxied.
Generated class name will follow pattern: {0}Remote
Ejb tags
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.
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.
Parameter |
Type |
Applicability |
Description |
Mandatory |
view-type |
text |
|
Optionally specify which view-type the method will be exposed in.
|
false |
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).
Parameter |
Type |
Applicability |
Description |
Mandatory |
view-type |
text |
|
Optionally specify which view-type the
method will be exposed in.
|
false |
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.
Parameter |
Type |
Applicability |
Description |
Mandatory |
view-type |
text |
|
Optionally specify which view-type the
method will be exposed in. The value
"local" or "both" is only applicable to
EJB 2.0 beans.
|
false |
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.
Parameter |
Type |
Applicability |
Description |
Mandatory |
role-name |
text |
|
Comma-separated list of roles allowed to call this
method
|
false |
unchecked |
bool |
Entity beans, EJB 2.0 |
Flags the method as having unchecked
permission. If present, role-name
must be omitted
|
false |
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.
Applicable for entity beans.
Parameter |
Type |
Applicability |
Description |
Mandatory |
column-name |
text |
|
Declare the column-name to which the CMP
field will be mapped.
|
true
|
jdbc-type |
text |
|
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.
|
false |
sql-type |
text |
|
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 |
Deprecated. Use the ejb.persistence tag instead.
Use this for methods with the following pattern: public abstract Foo getX().
This will denote the persistent field "X" as a primary key field, which will
be included in the generated primary key class. Must be used with the
persistent-field tag. This tag is only valid for EntityBeans. It has no
parameters.
Defines a relationship between Entity beans.
Parameter |
Type |
Applicability |
Description |
Mandatory |
name |
text |
|
Name of the relation. For bidirectional relationships, specify the same name on both sides.
|
true
|
role-name |
text |
|
Name of the relationship role.
|
true
|
cascade-delete |
text |
|
Indicates whether or not the app server should perform cascade deletes. If yes, specify cascade-delete="yes".
|
false |
target-ejb |
text |
|
Name of the EJB on the other side of the relation. Should *only* occur if the relation is unidirectional.
|
false |
target-role-name |
text |
|
Name of the relationship role on the other side of the relation. Should *only* occur if the relation is unidirectional.
|
false |
target-cascade-delete |
text |
|
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-multiple |
text |
|
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 |
Defines a select method. This tag is placed on the ejbSelect methods.
Parameter |
Type |
Applicability |
Description |
Mandatory |
query |
text |
|
EJB-QL query for the select method. |
true
|
result-type-mapping |
text |
|
Result type mapping for the select method. |
false |
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
Parameter |
Type |
Applicability |
Description |
Mandatory |
type |
text |
|
Define the type of transactional behaviour. |
true
|
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.
Parameter |
Type |
Applicability |
Description |
Mandatory |
name |
text |
|
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 |
Marks session bean method for inclusion in remote facade.
Parameter |
Type |
Applicability |
Description |
Mandatory |
invalidate |
bool |
|
Mark this method as invalidating. Remote Facade will fire
callbacks and zap caches. Use on methods which change ejb
or create/remove entities.
|
false |
|