weblogic-application.xml Deployment Descriptor

来源:互联网 发布:sjf调度算法例题 编辑:程序博客网 时间:2024/05/16 19:23
 The following sections describe the weblogic-application.xmlfile. The weblogic-application.xml file is the BEA WebLogicServer-specific deployment descriptor extension for the application.xmldeployment descriptor from Sun Microsystems. This is where youconfigure features such as application-scoped JDBC pools and EJBcaching.

The file is located in the META-INF subdirectory of the application archive. It must begin with the following DOCTYPE declaration:

<!DOCTYPE weblogic-application PUBLIC "-//BEA Systems, Inc.//DTD WebLogic Application 8.1.0//EN"

"http://www.bea.com/servers/wls810/dtd/weblogic-application_2_0.dtd">

The following sections describe each element that can appear in the file.

weblogic-application

The weblogic-application element is the root element of the application deployment descriptor.

The following table describes the elements you can define within a weblogic-application element.

Element

Required
Optional

Description

<ejb>

Optional

Contains information that is specific to the EJB modules that are part of a WebLogic application. Currently, one can use the ejb element to specify one or more application level caches that can be used by the application's entity beans.

For more information on the elements you can define within the ejb element, refer to ejb.

<xml>

Optional

Contains information about parsers and entity mappings for XML processing that is specific to this application.

For more information on the elements you can define within the xml element, refer to xml.

<jdbc-connection-pool>


Deprecated

Zero or more. Specifies an application-scoped JDBC connection pool.

For more information on the elements you can define within the jdbc-connection-pool element, refer to jdbc-connection-pool.

<security>

Optional

Specifies security information for the application.

For more information on the elements you can define within the security element, refer to security.

<application-param>


Zero or more. Used to specifyun-typed parameters that affect the behavior of container instancesrelated to the application. The parameters listed here are currentlysupported. Also, these parameters in weblogic-application.xml candetermine the default encoding to be used for requests and forresponses.

  • webapp.encoding.default—Canbe set to a string representing an encoding supported by the JDK. Ifset, this defines the default encoding used to process servlet requestsand servlet responses. This setting is ignored ifwebapp.encoding.usevmdefault is set to true. This value is alsooverridden for request streams by the input-charset element ofweblogic.xml.

  • webapp.encoding.usevmdefault—Canbe set to true or false. If true, the system property file.encoding isused to define the default encoding.

The following parameter is used to affect the behavior of Web applications that are contained in this application.

  • webapp.getrealpath.accept_context_path—Thisis a compatibility switch that may be set to true or false. If set totrue, the context path of Web applications is allowed in calls to theservlet API getRealPath.

Example:

<application-param>

<param-name>

webapp.encoding.default

</param-name>

<param-value>UTF8</param-value>

</application-param>

For more information on the elements you can define within the application-param element, refer to application-param.

<classloader-structure>

Optional

A classloader-structure elementallows you to define the organization of classloaders for thisapplication. The declaration represents a tree structure thatrepresents the classloader hierarchy and associates specific moduleswith particular nodes. A module's classes are loaded by the classloaderthat its associated with this element.

Example:

<classloader-structure>

<module-ref>

<module-uri>ejb1.jar</module-uri>

</module-ref>

</classloader-structure>
<classloader-structure>

<module-ref>

<module-uri>ejb2.jar</module-uri>

</module-ref>

</classloader-structure>

For more information on the elements you can define within the classloader-structure element, refer to classloader-structure.

<listener>


Zero or more. Used to registeruser defined application lifecycle listeners. These are classes thatextend the abstract base classweblogic.application.ApplicationLifecycleListener.

For more information on the elements you can define within the listener element, refer to listener.

<startup>


Zero or more. Used to register user-defined startup classes.

For more information on the elements you can define within the startup element, refer to startup.

<shutdown>


Zero or more. Used to register user defined shutdown classes.

For more information on the elements you can define within the shutdown element, refer to shutdown.

ejb

The following table describes the elements you can define within an ejb element.

Element

Required
Optional

Description

<entity-cache>


Zero or more. The entity-cacheelement is used to define a named application level cache that is usedto cache entity EJB instances at runtime. Individual entity beans referto the application-level cache that they must use, referring to thecache name. There is no restriction on the number of different entitybeans that may reference an individual cache.

Application-level caching isused by default whenever an entity bean does not specify its own cachein the weblogic-ejb-jar.xml descriptor. Two default caches namedExclusiveCache and MultiVersionCache are used for this purpose. Anapplication may explicitly define these default caches to specifynon-default values for their settings. Note that the caching-strategycannot be changed for the default caches. By default, a cache usesmax-beans-in-cache with a value of 1000 to specify its maximum size.

Example:

<entity-cache> 
<entity-cache-name>ExclusiveCache</entity-cache-name> 
<max-cache-size> 
<megabytes>50</megabytes> 
</max-cache-size> 

</entity-cache>


For more information on the elements you can define within the entity-cache element, refer to entity-cache.

<start-mbds-with- application

Optional

Allows you to configure the EJBcontainer to start Message Driven BeanS (MDBS) with the application. Ifset to true, the container starts MDBS as part of the application. Ifset to false, the container keeps MDBS in a queue and the server startsthem as soon as it has started listening on the ports.

entity-cache

The following table describes the elements you can define within a entity-cache element.

Element

Required
Optional

Description

<entity-cache-name>


Specifies a unique name for an entity bean cache. The name must be unique within an ear file and may not be the empty string.

Example:

<entity-cache-name>ExclusiveCache</entity-cache-name>

<max-beans-in-cache>

Optional

Specifies the maximum number ofentity beans that are allowed in the cache. If the limit is reached,beans may be passivated. This mechanism does not take into account theactual amount of memory that different entity beans require. Thiselement can be set to a value of 1 or greater.

Default Value: 1000

<max-cache-size>

Optional

Used to specify a limit on thesize of an entity cache in terms of memory size—expressed either interms of bytes or megabytes. A bean provider should provide an estimateof the average size of a bean in the weblogic-ejb-jar.xml descriptor ifthe bean uses a cache that specifies its maximum size using themax-cache-size element. By default, a bean is assumed to have anaverage size of 100 bytes.

bytes | megabytes—The size of an entity cache in terms of memory size, expressed in bytes or megabytes. Used in the max-cache-size element.

<caching-strategy>

Optional

Specifies the general strategythat the EJB container uses to manage entity bean instances in aparticular application level cache. A cache buffers entity beaninstances in memory and associates them with their primary key value.

The caching-strategy element can only have one of the following values:

  • Exclusive—Cachesa single bean instance in memory for each primary key value. Thisunique instance is typically locked using the EJB container's exclusivelocking when it is in use, so that only one transaction can use theinstance at a time.

  • MultiVersion—Cachesmultiple bean instances in memory for a given primary key value. Eachinstance can be used by a different transaction concurrently.

Default Value: MultiVersion

Example:

<caching-strategy>Exclusive</caching-strategy>

xml

The following table describes the elements you can define within an xml element.

Element

Required
Optional

Description

<parser-factory>

Optional

The parent element used to specify a particular XML parser or transformer for an enterprise application.

For more information on the elements you can define within the parser-factory element, refer to parser-factory.

<entity-mapping>

Optional

Zero or More. Specifies theentity mapping. This mapping determines the alternative entity URI fora given public or system ID. The default place to look for this entityURI is the lib/xml/registry directory.

For more information on the elements you can define within the entity-mapping element, refer to entity-mapping.

parser-factory

The following table describes the elements you can define within a parser-factory element.

Element

Required
Optional

Description

<saxparser-factory>

Optional

Allows you to set the SAXParserFactory for the XML parsing required in this application only. Thiselement determines the factory to be used for SAX style parsing. If youdo not specify the saxparser-factory element setting, the configured SAXParser Factory style in the Server XML Registry is used.

Default Value: Server XML Registry setting

<document-builder-factory>

Optional

Allows you to set the DocumentBuilder Factory for the XML parsing required in this application only.This element determines the factory to be used for DOM style parsing.If you do not specify the document-builder-factory element setting, the configured DOM style in the Server XML Registry is used.

Default Value: Server XML Registry setting

<transformer-factory>

Optional

Allows you to set theTransformer Engine for the style sheet processing required in thisapplication only. If you do not specify a value for this element, thevalue configured in the Server XML Registry is used.

Default value: Server XML Registry setting.

entity-mapping

The following table describes the elements you can define within an entity-mapping element.

Element

Required
Optional

Description

<entity-mapping-name>


Specifies the name for this entity mapping.

<public-id>

Optional

Specifies the public ID of the mapped entity.

<system-id>

Optional

Specifies the system ID of the mapped entity.

<entity-uri>

Optional

Specifies the entity URI for the mapped entity.

<when-to-cache>

Optional

Legal values are:

  • cache-on-reference
  • cache-at-initialization
  • cache-never

The default value is cache-on-reference.

<cache-timeout-interval>

Optional

Specifies the integer value in seconds.

jdbc-connection-pool

The following table describes the elements you can define within a jdbc-connection-pool element.

Element

Required
Optional

Description

<data-source-name>


Specifies the JNDI name in the application-specific JNDI tree.

<connection-factory>


Specifies the connection parameters that define overrides for default connection factory settings.

  • user-name—Optional. The user-name element is used to override UserName in the JDBCDataSourceFactoryMBean.

  • url—Optional. The url element is used to override URL in the JDBCDataSourceFactoryMBean.

  • driver-class-name—Optional. The driver-class-name element is used to override DriverName in the JDBCDataSourceFactoryMBean.

  • connection-params—Zero or more.

  • parameter+ (param-value, param-name)—One or more

For more information on the elements you can define within the connection-factory element, refer to connection-factory.

<pool-params>

Optional

Defines parameters that affect the behavior of the pool.

For more information on the elements you can define within the pool-params element, refer to pool-params.

<driver-params>

Optional

Sets behavior on WebLogic Server drivers.

For more information on the elements you can define within the driver-params element, refer to driver-params.

connection-factory

The following table describes the elements you can define within a connection-factory element.

Element

Required
Optional

Description

<factory-name>

Optional

Specifies the name of a JDBCDataSourceFactoryMBean in the config.xml file.

<connection-properties>

Optional

Specifies the connection properties for the connection factory. Elements that can be defined for the connection-properties element are:

  • user-name—Optional. Used to override UserName in the JDBCDataSourceFactoryMBean.

  • password—Optional. Used to override Password in the JDBCDataSourceFactoryMBean.

  • url—Optional. Used to override URL in the JDBCDataSourceFactoryMBean.

  • driver-class-name—Optional. Used to override DriverName in the JDBCDataSourceFactoryMBean

  • connection-params—Zero or more. Used to set parameters which will be passed to the driver when making a connection. Example:

<connection-params>

<parameter>

<param-name>foo</param-name>

<param-value>xyz</param-value>

</parameter>

pool-params

The following table describes the elements you can define within a pool-params element.

Element

Required
Optional

Description

<size-params>

Optional

Defines parameters that affect the number of connections in the pool.

  • initial-capacity—Optional.The initial-capacity element defines the number of physical databaseconnections to create when the pool is initialized. The default valueis 1.

  • max-capacity—Optional.The max-capacity element defines the maximum number of physicaldatabase connections that this pool can contain. Note that the JDBCDriver may impose further limits on this value. The default value is 1.

  • capacity-increment—Optional.The capacity-increment element defines the increment by which the poolcapacity is expanded. When there are no more available physicalconnections to service requests, the pool creates this number ofadditional physical database connections and adds them to the pool. Thepool ensures that it does not exceed the maximum number of physicalconnections as set by max-capacity. The default value is 1.

  • shrinking-enabled—Optional.The shrinking-enabled element indicates whether or not the pool canshrink back to its initial-capacity when connections are detected tonot be in use.

  • shrink-period-minutes—Optional.The shrink-period-minutes element defines the number of minutes to waitbefore shrinking a connection pool that has incrementally increased tomeet demand. The shrinking-enabled element must be set to true forshrinking to take place.

  • shrink-frequency-seconds—Optional.

  • highest-num-waiters—Optional.

  • highest-num-unavailable—Optional.

<xa-params>

Optional

Defines the parameters for the XA DataSources.

  • debug-level—Optional. Integer. The debug-level element defines the debugging level for XA operations. The default value is 0.

  • keep-conn-until-tx-complete-enabled—Optional. Boolean. If you set the keep-conn-until-tx-complete-enabledelement to true, the XA connection pool associates the same XAconnection with the distributed transaction until the transactioncompletes.

  • end-only-once-enabled—Optional.Boolean. If you set the end-only-once-enabled element to true, theXAResource.end() method is only called once for each pending XAResource.start() method.

  • recover-only-once-enabled—Optional.Boolean. If you set the recover-only-once-enabled element to true,recover is only called one time on a resource.

  • tx-context-on-close-needed—Optional. Set the tx-context-on-close-neededelement to true if the XA driver requires a distributed transactioncontext when closing various JDBC objects (for example, result sets,statements, connections, and so on). If set to true, the SQL exceptionsthat are thrown while closing the JDBC objects in no transactioncontext are swallowed.

  • new-conn-for-commit-enabled—Optional.Boolean. If you set the new-conn-for-commit-enabled element to true, adedicated XA connection is used for commit/rollback processing of aparticular distributed transaction.

  • prepared-statement-cache-sizeDeprecated.Optional. Use the prepared-statement-cache-size element to set the sizeof the prepared statement cache. The size of the cache is a number ofprepared statements created from a particular connection and stored inthe cache for further use. Setting the size of the prepared statementcache to 0 turns it off.

Note: Prepared-statement-cache-size is deprecated. Use cache-size in driver-params/prepared-statement. See driver-params for more information.

<xa-params> Continued...

Optional

  • keep-logical-conn-open-on-release—Optional.Boolean. Set the keep-logical-conn-open-on-release element to true, tokeep the logical JDBC connection open when the physical XA connectionis returned to the XA connection pool. The default value is false.

  • local-transaction-supported—Optional.Boolean. Set the local-transaction-supported to true if the XA driversupports SQL with no global transaction; otherwise, set it to false.The default value is false.

  • resource-health-monitoring-enabled—Optional.Set the resource-health-monitoring-enabled element to true to enableJTA resource health monitoring for this connection pool.

  • xa-set-transaction-timeout—Optional.

Used in: xa-params

Example:

<xa-set-transaction-timeout>

true

</xa-set-transaction-timeout>

  • xa-transaction-timeout—Optional.

When the xa-set-transaction-timeout value is set to true, the transaction manager invokes setTransactionTimeout on the resource before calling XAResource.start. The Transaction Manager passes the global transaction timeout value. If this attribute is set to a value greater than 0, then this value is used in place of the global transaction timeout.

Default value: 0

Used in: xa-params

Example:

<xa-transaction-timeout>

30

</xa-transaction-timeout>

<login-delay-seconds>

Optional

Sets the number of seconds todelay before creating each physical database connection. Some databaseservers cannot handle multiple requests for connections in rapidsuccession. This property allows you to build in a small delay to letthe database server catch up. This delay occurs both during initialpool creation and during the lifetime of the pool whenever a physicaldatabase connection is created.

<leak-profiling-enabled>

Optional

Enables JDBC connection leakprofiling. A connection leak occurs when a connection from the pool isnot closed explicitly by calling the close() method on that connection.When connection leak profiling is active, the pool stores the stacktrace at the time the connection object is allocated from the pool andgiven to the client. When a connection leak is detected (when theconnection object is garbage collected), this stack trace is reported.

This element uses extraresources and will likely slowdown connection pool operations, so it isnot recommended for production use.

<connection-check-params>

Optional

  • Defines whether, when, and how connections in a pool is checked to make sure they are still alive.

  • table-name—Optional. The table-name element defines a table in the schema that can be queried.

  • check-on-reserve-enabled—Optional.If the check-on-reserve-enabled element is set to true, then theconnection will be tested each time before it is handed out to a user.

  • check-on-release-enabled—Optional.If the check-on-release-enabled element is set to true, then theconnection will be tested each time a user returns a connection to thepool.

  • refresh-minutes—Optional.If the refresh-minutes element is defined, a trigger is firedperiodically (based on the number of minutes specified). This triggerchecks each connection in the pool to make sure it is still valid.

  • check-on-create-enabled—Optional. If set to true, then the connection will be tested when it is created.

  • connection-reserve-timeout-seconds—Optional.Number of seconds after which the call to reserve a connection from thepool will timeout.

  • connection-creation-retry-frequency-seconds—Optional.The frequency of retry attempts by the pool to establish connections tothe database.

  • inactive-connection-timeout-seconds—Optional.The number of seconds of inactivity after which reserved connectionswill forcibly be released back into the pool.

<connection-check-params>

Continued...

Optional

  • test-frequency-seconds—Optional.The number of seconds between database connection tests. After everytest-frequency-seconds interval, unused database connections are testedusing table-name. Connections that do not pass the test will be closedand reopened to re-establish a valid physical database connection. Iftable-name is not set, the test will not be performed.

<jdbcxa-debug-level>

Optional

This is an internal setting.

<remove-infected-connections-enabled>

Optional

Controls whether a connection isremoved from the pool when the application asks for the underlyingvendor connection object. Enabling this attribute has an impact onperformance; it essentially disables the pooling of connections (asconnections are removed from the pool and replaced with newconnections).

driver-params

The following table describes the elements you can define within a driver-params element.

Element

Required
Optional

Description

<statement>

Optional

Defines the driver-params statement. Contains the following optional element: profiling-enabled.

Example:

<statement>

<profiling-enabled>true</profiling-enabled>

</statement>

<prepared-statement

Optional

Enables the running of JDBCprepared statement cache profiling. When enabled, prepared statementcache profiles are stored in external storage for further analysis.This is a resource-consuming feature, so it is recommended that youturn it off on a production server. The default value is false.

  • profiling-enabled—Optional.

  • cache-profiling-threshold—Optional.The cache-profiling-threshold element defines a number of statementrequests after which the state of the prepared statement cache islogged. This element minimizes the output volume. This is aresource-consuming feature, so it is recommended that you turn it offon a production server.

  • cache-size—Optional.The cache-size element returns the size of the prepared statementcache. The size of the cache is a number of prepared statements createdfrom a particular connection and stored in the cache for further use.

  • parameter-logging-enabled—Optional.During SQL roundtrip profiling it is possible to store values ofprepared statement parameters. The parameter-logging-enabled elementenables the storing of statement parameters. This is aresource-consuming feature, so it is recommended that you turn it offon a production server.

  • max-parameter-length—Optional.During SQL roundtrip profiling it is possible to store values ofprepared statement parameters. The max-parameter-length element definesmaximum length of the string passed as a parameter for JDBC SQLroundtrip profiling. This is a resource-consuming feature, so youshould limit the length of data for a parameter to reduce the outputvolume.

  • cache-type—Optional.

<row-prefetch-enabled>

Optional

 

<row-prefetch-size>

Optional

 

<stream-chunk-size>

Optional

 

security

The following table describes the elements you can define within a security element.

Element

Required
Optional

Description

<realm-name>

Optional

Names a security realm to be used by the application. If none is specified, the system default realm is used

<security-role-assignment>


Declares a mapping between an application-wide security role and one or more WebLogic Server principals.

Example:

<security-role-assignment>

<role-name>

PayrollAdmin

</role-name>

<principal-name>

Tanya

</principal-name>

<principal-name>

Fred

</principal-name>

<principal-name>

system

</principal-name>

</security-role-assignment>

application-param

The following table describes the elements you can define within a application-param element.



Element






Required
Optional






Description






<description>






Optional






Provides a description of the application parameter.






<param-name>












Defines the name of the application parameter.






<param-value>












Defines the value of the application parameter.






classloader-structure

The following table describes the elements you can define within a classloader-structure element.



Element






Required
Optional






Description






<module-ref>












Zero or more. The following table describes the elements you can define within a module-ref element.




module-uri—Zero or more. Defined within the module-ref element.






listener

The following table describes the elements you can define within a listener element.



Element






Required
Optional






Description






<listener-class>












Name of the user's implementation of ApplicationLifecycleListener.






<listener-uri>






Optional






A JAR file within the EAR that contains the implementation. If you do not specify the listener-uri, it is assumed that the class is visible to the application.






startup

The following table describes the elements you can define within a startup element.

Element

Required
Optional

Description

<startup-class>


Defines the name of the class to be run when the application is being deployed.

<startup-uri>

Optional

Defines a JAR file within theEAR that contains the startup-class. If startup-uri is not defined,then its assumed that the class is visible to the application.

shutdown

The following table describes the elements you can define within a shutdown element.

Element

Required
Optional

Description

<shutdown-class>


Defines the name of the class to be run when the application is undeployed.

<shutdown-uri>

Optional

Defines a JAR file within theEAR that contains the shutdown-class. If you do not define theshutdown-uri element, it is assumed that the class is visible to theapplication.

原创粉丝点击