J2EE deployment files (ejb-jar.xml)

The ejb-jar element is the root element of the EJB deployment descriptor. It contains an optional description of the ejb-jar file, optional display name, optional small icon file name, optional large icon file name, mandatory structural information about all included enterprise beans, optional application-assembly descriptor, and an optional name of an ejb-client-jar file for the ejb-jar.

A short description
A short description.

A name
The display-name element contains a short name that is intended to be display by tools.

employee-service-icon16x16.jpg
The small-icon element contains the name of a file containing a small (16 x 16) icon image. The file name is relative path within the ejb-jar file. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg" or ".gif" respectively. The icon can be used by tools.

employee-service-icon32x32.jpg
The large-icon element contains the name of a file containing a large (32 x 32) icon image. The file name is relative path within the ejb-jar file. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg" or ".gif" respectively. The icon can be used by tools.

The enterprise-beans element contains the declarations of one or more enterprise beans.

The session element declares an session bean. The declaration consists of: an optional description; optional display name; optional small icon file name; optional large icon file name; a name assigned to the enterprise bean in the deployment description; the names of the session bean's home and remote interfaces; the session bean's implementation class; the session bean's state management type; the session bean's transaction management type; an optional declaration of the bean's environment entries; an optional declaration of the bean's EJB references; an optional declaration of the security role references; and an optional declaration of the bean's resource factory references. The elements that are optional are "optional" in the sense that they are omitted when if lists represented by them are empty.

A short description
A short description.

A name
The display-name element contains a short name that is intended to be display by tools.

employee-service-icon16x16.jpg
The small-icon element contains the name of a file containing a small (16 x 16) icon image. The file name is relative path within the ejb-jar file. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg" or ".gif" respectively. The icon can be used by tools.

employee-service-icon32x32.jpg
The large-icon element contains the name of a file containing a large (32 x 32) icon image. The file name is relative path within the ejb-jar file. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg" or ".gif" respectively. The icon can be used by tools.

EmployeeService
The ejb-name element specifies an enterprise bean's name. This name is assigned by the ejb-jar file producer to name the enterprise bean in the ejb-jar file's deployment descriptor. The name must be unique among the names of the enterprise beans in the same ejb-jar file. The enterprise bean code does not depend on the name; therefore the name can be changed during the application-assembly process without breaking the enterprise bean's function. There is no architected relationship between the ejb-name in the deployment descriptor and the JNDI name that the Deployer will assign to the enterprise bean's home. The name must conform to the lexical rules for an NMTOKEN.

com.aardvark.payroll.PayrollHome
The home element contains the fully-qualified name of the enterprise bean's home interface.

com.wombat.empl.EmployeeService
The remote element contains the fully-qualified name of the enterprise bean's remote interface.

com.wombat.empl.EmployeeServiceBean
The ejb-class element contains the fully-qualified name of the enterprise bean's class.

Stateful/Stateless
The session-type element describes whether the session bean is a stateful session, or stateless session. The session-type element must be one of the two following: Stateful or Stateless.

Bean/Container
The transaction-type element must be one of the two following: Bean or Container.

The env-entry element contains the declaration of an enterprise bean's environment entries. The declaration consists of an optional description, the name of the environment entry, and an optional value.

A short description
A short description.

minAmount
The env-entry-name element contains the name of an enterprise bean's environment entry.

java.lang.String
The env-entry-type element contains the fully-qualified Java type of the environment entry value that is expected by the enterprise bean's code. The following are the legal values of env-entry-type: java.lang.Boolean, java.lang.String, java.lang.Integer, java.lang.Double, java.lang.Byte, java.lang.Short, java.lang.Long, and java.lang.Float.

100.00
The env-entry-value element contains the value of an enterprise bean's environment entry.

 
The ejb-ref element is used for the declaration of a reference to another enterprise bean's home. The declaration consists of an optional description; the EJB reference name used in the code of the referencing enterprise bean; the expected type of the referenced enterprise bean; the expected home and remote interfaces of the referenced enterprise bean; and an optional ejb-link information. The optional ejb-link element is used to specify the referenced enterprise bean. It is used typically in ejb-jar files that contain an assembled application.

A short description
A short description.

ejb/Payroll
The ejb-ref-name element contains the name of an EJB reference. The EJB reference is an entry in the enterprise bean's environment. It is recommended that name is prefixed with "ejb/".

Entity/Session
The ejb-ref-type element contains the expected type of the referenced enterprise bean. The ejb-ref-type element must be one of the following: EntitySession

com.aardvark.payroll.PayrollHome
The home element contains the fully-qualified name of the enterprise bean's home interface.

com.wombat.empl.EmployeeService
The remote element contains the fully-qualified name of the enterprise bean's remote interface.

EmployeeRecord
The ejb-link element is used in the ejb-ref element to specify that an EJB reference is linked to another enterprise bean in the ejb-jar file. The value of the ejb-link element must be the ejb-name of an enterprise bean in the same ejb-jar file, or in another ejb-jar file in the same J2EE application unit.

 
The security-role-ref element contains the declaration of a security role reference in the enterprise bean's code. The declaration consists of an optional description, the security role name used in the code, and an optional link to a defined security role. The value of the role-name element must be the String used as the parameter to the EJBContext.isCallerInRole(String roleName) method. The value of the role-link element must be the name of one of the security roles defined in the security-role elements.

A short description
A short description.

name
The role-name element contains the name of a security role. The name must conform to the lexical rules for an NMTOKEN.

name
The role-link element is used to link a security role reference to a defined security role. The role-link element must contain the name of one of the security roles defined in the security-role elements.

 
The resource-ref element contains a declaration of enterprise bean's reference to an external resource. It consists of an optional description, the resource factory reference name, the indication of the resource factory type expected by the enterprise bean code, and the type of authentication (bean or container).

A short description
A short description.

name
The res-ref-name element specifies the name of a resource factory reference.

javax.sql.DataSource
The res-type element specifies the type of the data source. The type is specified by the Java interface (or class) expected to be implemented by the data source.

Application/Container
The res-auth element specifies whether the enterprise bean code signs on programmatically to the resource manager, or whether the Container will sign on to the resource manager on behalf of the bean. In the latter case, the Container uses information that is supplied by the Deployer. The value of this element must be one of the two following: Application or Container

 
 
The entity element declares an entity bean. The declaration consists of: an optional description; optional display name; optional small icon file name; optional large icon file name; a name assigned to the enterprise bean in the deployment descriptor; the names of the entity bean's home and remote interfaces; the entity bean's implementation class; the entity bean's persistence management type; the entity bean's primary key class name; an indication of the entity bean's reentrancy; an optional list of container-managed fields; an optional specification of the primary key field; an optional declaration of the bean's environment entries; an optional declaration of the bean's EJB references; an optional declaration of the security role references; and an optional declaration of the bean's resource factory references. The optional primkey-field may be present in the descriptor if the entity's persistency-type is Container. The other elements that are optional are "optional" in the sense that they are omitted if the lists represented by them are empty. At least one cmp-field element must be present in the descriptor if the entity's persistency-type is Container, and none must not be present if the entity's persistence-type is Bean.

A short description
A short description.

A name
The display-name element contains a short name that is intended to be display by tools.

employee-service-icon16x16.jpg
The small-icon element contains the name of a file containing a small (16 x 16) icon image. The file name is relative path within the ejb-jar file. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg" or ".gif" respectively. The icon can be used by tools.

employee-service-icon32x32.jpg
The large-icon element contains the name of a file containing a large (32 x 32) icon image. The file name is relative path within the ejb-jar file. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg" or ".gif" respectively. The icon can be used by tools.

EmployeeService
The ejb-name element specifies an enterprise bean's name. This name is assigned by the ejb-jar file producer to name the enterprise bean in the ejb-jar file's deployment descriptor. The name must be unique among the names of the enterprise beans in the same ejb-jar file. The enterprise bean code does not depend on the name; therefore the name can be changed during the application-assembly process without breaking the enterprise bean's function. There is no architected relationship between the ejb-name in the deployment descriptor and the JNDI name that the Deployer will assign to the enterprise bean's home. The name must conform to the lexical rules for an NMTOKEN.

com.aardvark.payroll.PayrollHome
The home element contains the fully-qualified name of the enterprise bean's home interface.

com.wombat.empl.EmployeeService
The remote element contains the fully-qualified name of the enterprise bean's remote interface.

com.wombat.empl.EmployeeServiceBean
The ejb-class element contains the fully-qualified name of the enterprise bean's class.

Bean/Container
The persistence-type element specifies an entity bean's persistence management type. The persistence-type element must be one of the two following: Bean or Container.

com.wombat.empl.EmployeeID
The prim-key-class element contains the fully-qualified name of an entity bean's primary key class. If the definition of the primary key class is deferred to deployment time, the prim-key-class element should specify java.lang.Object.

True/False
The reentrant element specifies whether an entity bean is reentrant or not. The reentrant element must be one of the two following: True or False

The cmp-field element describes a container-managed field. The field element includes an optional description of the field, and the name of the field.

A short description
A short description.

firstName
The field-name element specifies the name of a container managed field. The name must be a public field of the enterprise bean class or one of its superclasses.

 
fieldName
The primkey-field element is used to specify the name of the primary key field for an entity with container-managed persistence. The primkey-field must be one of the fields declared in the cmp-field element, and the type of the field must be the same as the primary key type. The primkey-field element is not used if the primary key maps to multiple container-managed fields (i.e. the key is a compound key). In this case, the fields of the primary key class must be public, and their names must correspond to the field names of the entity bean class that comprise the key.

The env-entry element contains the declaration of an enterprise bean's environment entries. The declaration consists of an optional description, the name of the environment entry, and an optional value.

A short description
A short description.

minAmount
The env-entry-name element contains the name of an enterprise bean's environment entry.

java.lang.String
The env-entry-type element contains the fully-qualified Java type of the environment entry value that is expected by the enterprise bean's code. The following are the legal values of env-entry-type: java.lang.Boolean, java.lang.String, java.lang.Integer, java.lang.Double, java.lang.Byte, java.lang.Short, java.lang.Long, and java.lang.Float.

100.00
The env-entry-value element contains the value of an enterprise bean's environment entry.

 
The ejb-ref element is used for the declaration of a reference to another enterprise bean's home. The declaration consists of an optional description; the EJB reference name used in the code of the referencing enterprise bean; the expected type of the referenced enterprise bean; the expected home and remote interfaces of the referenced enterprise bean; and an optional ejb-link information. The optional ejb-link element is used to specify the referenced enterprise bean. It is used typically in ejb-jar files that contain an assembled application.

A short description
A short description.

ejb/Payroll
The ejb-ref-name element contains the name of an EJB reference. The EJB reference is an entry in the enterprise bean's environment. It is recommended that name is prefixed with "ejb/".

Entity/Session
The ejb-ref-type element contains the expected type of the referenced enterprise bean. The ejb-ref-type element must be one of the following: EntitySession

com.aardvark.payroll.PayrollHome
The home element contains the fully-qualified name of the enterprise bean's home interface.

com.wombat.empl.EmployeeService
The remote element contains the fully-qualified name of the enterprise bean's remote interface.

EmployeeRecord
The ejb-link element is used in the ejb-ref element to specify that an EJB reference is linked to another enterprise bean in the ejb-jar file. The value of the ejb-link element must be the ejb-name of an enterprise bean in the same ejb-jar file, or in another ejb-jar file in the same J2EE application unit.

 
The security-role-ref element contains the declaration of a security role reference in the enterprise bean's code. The declaration consists of an optional description, the security role name used in the code, and an optional link to a defined security role. The value of the role-name element must be the String used as the parameter to the EJBContext.isCallerInRole(String roleName) method. The value of the role-link element must be the name of one of the security roles defined in the security-role elements.

A short description
A short description.

name
The role-name element contains the name of a security role. The name must conform to the lexical rules for an NMTOKEN.

name
The role-link element is used to link a security role reference to a defined security role. The role-link element must contain the name of one of the security roles defined in the security-role elements.

 
The resource-ref element contains a declaration of enterprise bean's reference to an external resource. It consists of an optional description, the resource factory reference name, the indication of the resource factory type expected by the enterprise bean code, and the type of authentication (bean or container).

A short description
A short description.

name
The res-ref-name element specifies the name of a resource factory reference.

javax.sql.DataSource
The res-type element specifies the type of the data source. The type is specified by the Java interface (or class) expected to be implemented by the data source.

Application/Container
The res-auth element specifies whether the enterprise bean code signs on programmatically to the resource manager, or whether the Container will sign on to the resource manager on behalf of the bean. In the latter case, the Container uses information that is supplied by the Deployer. The value of this element must be one of the two following: Application or Container

 
 
 
The assembly-descriptor element contains application-assembly information. The application-assembly information consists of the following parts: the definition of security roles, the definition of method permissions, and the definition of transaction attributes for enterprise beans with container-managed transaction demarcation. All the parts are optional in the sense that they are omitted if the lists represented by them are empty. Providing an assembly-descriptor in the deployment descriptor is optional for the ejb-jar file producer.

The security-role element contains the definition of a security role. The definition consists of an optional description of the security role, and the security role name.

A short description
A short description.

name
The role-name element contains the name of a security role. The name must conform to the lexical rules for an NMTOKEN.

 
The method-permission element specifies that one or more security roles are allowed to invoke one or more enterprise bean methods. The method-permission element consists of an optional description, a list of security role names, and a list of method elements. The security roles used in the method-permission element must be defined in the security-role element of the deployment descriptor, and the methods must be methods defined in the enterprise bean's remote and/or home interfaces.

A short description
A short description.

name
The role-name element contains the name of a security role. The name must conform to the lexical rules for an NMTOKEN.

	1.  
			EJBNAME
			*
		

		This style is used to refer to all the methods of the specified
		enterprise bean's home and remote interfaces.

	2.  
			EJBNAME
			METHOD
		>

		This style is used to refer to the specified method of the
		specified enterprise bean. If there are multiple methods with
		the same overloaded name, the element of this style refers to
		all the methods with the overloaded name.

	3.  
			EJBNAME
			METHOD
			
				PARAM-1
				PARAM-2
				...
				PARAM-n
			
		

		This style is used to refer to a single method within a set of
		methods with an overloaded name. PARAM-1 through PARAM-n are the
		fully-qualified Java types of the method's input parameters (if
		the method has no input arguments, the method-params element
		contains no method-param elements). Arrays are specified by the
		array element's type, followed by one or more pair of square
		brackets (e.g. int[][]).
	


A short description
A short description.

EmployeeService
The ejb-name element specifies an enterprise bean's name. This name is assigned by the ejb-jar file producer to name the enterprise bean in the ejb-jar file's deployment descriptor. The name must be unique among the names of the enterprise beans in the same ejb-jar file. The enterprise bean code does not depend on the name; therefore the name can be changed during the application-assembly process without breaking the enterprise bean's function. There is no architected relationship between the ejb-name in the deployment descriptor and the JNDI name that the Deployer will assign to the enterprise bean's home. The name must conform to the lexical rules for an NMTOKEN.

Home/Remote
The method-intf element allows a method element to differentiate between the methods with the same name and signature that are defined in both the remote and home interfaces. The method-intf element must be one of the following: Home or Remote.

nameOfMethod
The method-name element contains a name of an enterprise bean method, or the asterisk (*) character. The asterisk is used when the element denotes all the methods of an enterprise bean's remote and home interfaces.

The method-params element contains a list of the fully-qualified Java type names of the method parameters.

int[]
The method-param element contains the fully-qualified Java type name of a method parameter.

 
 
 
The container-transaction element specifies how the container must manage transaction scopes for the enterprise bean's method invocations. The element consists of an optional description, a list of method elements, and a transaction attribute.The transaction attribute is to be applied to all the specified methods.

A short description
A short description.

1. >method< >ejb-name/ejb-name< >method-name<*>/method-name< >/method< This style is used to refer to all the methods of the specified enterprise bean's home and remote interfaces. 2. >method< >ejb-name/ejb-name< >method-name/method-name< >/method<< This style is used to refer to the specified method of the specified enterprise bean. If there are multiple methods with the same overloaded name, the element of this style refers to all the methods with the overloaded name. 3. >method< >ejb-name/ejb-name< >method-name/method-name< >method-params< >method-param/method-param< >method-param/method-param< ... >method-param/method-param< >/method-params< >method< This style is used to refer to a single method within a set of methods with an overloaded name. PARAM-1 through PARAM-n are the fully-qualified Java types of the method's input parameters (if the method has no input arguments, the method-params element contains no method-param elements). Arrays are specified by the array element's type, followed by one or more pair of square brackets (e.g. int[][]).

A short description
A short description.

EmployeeService
The ejb-name element specifies an enterprise bean's name. This name is assigned by the ejb-jar file producer to name the enterprise bean in the ejb-jar file's deployment descriptor. The name must be unique among the names of the enterprise beans in the same ejb-jar file. The enterprise bean code does not depend on the name; therefore the name can be changed during the application-assembly process without breaking the enterprise bean's function. There is no architected relationship between the ejb-name in the deployment descriptor and the JNDI name that the Deployer will assign to the enterprise bean's home. The name must conform to the lexical rules for an NMTOKEN.

Home/Remote
The method-intf element allows a method element to differentiate between the methods with the same name and signature that are defined in both the remote and home interfaces. The method-intf element must be one of the following: Home or Remote.

nameOfMethod
The method-name element contains a name of an enterprise bean method, or the asterisk (*) character. The asterisk is used when the element denotes all the methods of an enterprise bean's remote and home interfaces.

The method-params element contains a list of the fully-qualified Java type names of the method parameters.

int[]
The method-param element contains the fully-qualified Java type name of a method parameter.

 
 
Supports
The trans-attribute element specifies how the container must manage the transaction boundaries when delegating a method invocation to an enterprise bean's business method. The value of trans-attribute must be one of the following: NotSupported, Supports, Required, RequiresNew, Mandatory or Never

 
 
employee_service_client.jar
The optional ejb-client-jar element specifies a JAR file that contains the class files necessary for a client program to access the enterprise beans in the ejb-jar file. The Deployer should make the ejb-client JAR file accessible to the client's class-loader.

你可能感兴趣的:(Java)