Configures caching for web application components.
sun-web-app (sun-web.xml)
The following table describes subelements for the cache element.
Table A–7 cache Subelements
Element |
Required |
Description |
---|---|---|
zero or more |
Specifies a custom class that implements the CacheHelper interface. |
|
zero or one |
Allows you to change the properties of the default, built-in cache-helper class. |
|
zero or more |
Specifies a cache property, which has a name and a value. |
|
zero or more |
Maps a URL pattern or a servlet name to its cacheability constraints. |
The following table describes attributes for the cache element.
Table A–8 cache Attributes
Attribute |
Default |
Description |
---|---|---|
4096 |
(optional) Specifies the maximum number of entries the cache can contain. Must be a positive integer. |
|
30 |
(optional) Specifies the maximum amount of time in seconds that an entry can remain in the cache after it is created or refreshed. Can be overridden by a timeout element. |
|
true |
(optional) Determines whether servlet and JSP caching is enabled. |
The following table describes properties for the cache element.
Table A–9 cache Properties
Property |
Default |
Description |
---|---|---|
com.sun.appserv.web.cache.LruCache |
Specifies the fully qualified name of the class that implements the cache functionality. See Cache Class Names for possible values. |
|
4096 |
Specifies the number of entries in a segment of the cache table that should have its own LRU (least recently used) list. Applicable only if cacheClassName is set to com.sun.appserv.web.cache.MultiLruCache. |
|
unlimited; Long.MAX_VALUE |
Specifies an upper bound on the cache memory size in bytes (KB or MB units). Example values are 32 KB or 2 MB. Applicable only if cacheClassName is set to com.sun.appserv.web.cache.BoundedMultiLruCache. |
The following table lists possible values of the cacheClassName property.
Table A–10 cacheClassName Values
Value |
Description |
---|---|
A bounded cache with an LRU (least recently used) cache replacement policy. |
|
An unbounded cache suitable if the maximum number of entries is known. |
|
A cache suitable for a large number of entries (>4096). Uses the MultiLRUSegmentSize property. |
|
A cache suitable for limiting the cache size by memory rather than number of entries. Uses the MaxSize property. |
Specifies a class that implements the com.sun.appserv.web.cache.CacheHelper interface.
cache (sun-web.xml)
The following table describes subelements for the cache-helper element.
Table A–11 cache-helper Subelements
Element |
Required |
Description |
---|---|---|
zero or more |
Specifies a property, which has a name and a value. |
The following table describes attributes for the cache-helper element.
Table A–12 cache-helper Attributes
Attribute |
Default |
Description |
---|---|---|
name |
default |
Specifies a unique name for the helper class, which is referenced in the cache-mapping element. |
none |
Specifies the fully qualified class name of the cache helper, which must implement the com.sun.appserv.web.CacheHelper interface. |
Specifies the name of the cache-helper used by the parent cache-mapping element.
cache-mapping (sun-web.xml)
none - contains data
Specifies the maximum time that a bean can remain idle in the cache. After this amount of time, the container can passivate this bean. A value of 0 specifies that beans never become candidates for passivation. Default is 600.
Applies to stateful session beans and entity beans.
This element is not implemented for GlassFish v3 Prelude.
bean-cache (sun-ejb-jar.xml)
none - contains data
Maps a URL pattern or a servlet name to its cacheability constraints.
cache (sun-web.xml)
The following table describes subelements for the cache-mapping element.
Table A–13 cache-mapping Subelements
Element |
Required |
Description |
---|---|---|
requires one servlet-name or url-pattern |
Contains the name of a servlet. |
|
requires one servlet-name or url-pattern |
Contains a servlet URL pattern for which caching is enabled. |
|
required if dispatcher, timeout, refresh-field, http-method, key-field, and constraint-field are not used |
Contains the name of the cache-helper used by the parent cache-mapping element. |
|
zero or one if cache-helper-ref is not used |
Contains a comma-separated list of RequestDispatcher methods for which caching is enabled. |
|
zero or one if cache-helper-ref is not used |
Contains the cache-mapping specific maximum amount of time in seconds that an entry can remain in the cache after it is created or refreshed. |
|
zero or one if cache-helper-ref is not used |
Specifies a field that gives the application component a programmatic way to refresh a cached entry. |
|
zero or more if cache-helper-ref is not used |
Contains an HTTP method that is eligible for caching. |
|
zero or more if cache-helper-ref is not used |
Specifies a component of the key used to look up and extract cache entries. |
|
zero or more if cache-helper-ref is not used |
Specifies a cacheability constraint for the given url-pattern or servlet-name. |
Specifies JAX-RPC property values that can be set on a javax.xml.rpc.Call object before it is returned to the web service client. The property names can be any properties supported by the JAX-RPC Call implementation.
port-info, service-ref (sun-web.xml, sun-ejb-jar.xml)
The following table describes subelements for the call-property element.
Table A–14 call-property subelements
Element |
Required |
Description |
---|---|---|
only one |
Specifies the name of the entity. |
|
only one |
Specifies the value of the entity. |
Specifies whether the target accepts propagated caller identities. The values are NONE, SUPPORTED, or REQUIRED.
sas-context (sun-ejb-jar.xml)
none - contains data
Specifies that the stateful session bean state is checkpointed, or persisted, after the specified methods are executed. The availability-enabled attribute of the parent ejb element must be set to true.
This element is not implemented for GlassFish v3 Prelude.
ejb (sun-ejb-jar.xml)
The following table describes subelements for the checkpoint-at-end-of-method element.
Table A–15 checkpoint-at-end-of-method Subelements
Element |
Required |
Description |
---|---|---|
one or more |
Specifies a bean method. |
Deprecated. Supported for backward compatibility. Use checkpoint-at-end-of-method instead.
This element is not implemented for GlassFish v3 Prelude.
ejb (sun-ejb-jar.xml)
Configures the class loader for the web module.
sun-web-app (sun-web.xml)
The following table describes subelements for the class-loader element.
Table A–16 class-loader Subelements
Element |
Required |
Description |
---|---|---|
zero or more |
Specifies a property, which has a name and a value. |
The following table describes attributes for the class-loader element.
Table A–17 class-loader Attributes
If the delegate element is set to false, the class loader delegation behavior complies with the Servlet 2.4 specification, section 9.7.2. If set to its default value of true, classes and resources residing in container-wide library JAR files are loaded in preference to classes and resources packaged within the WAR file.
Portable programs that use this element should not be packaged with any classes or interfaces that are a part of the Java EE specification. The behavior of a program that includes such classes or interfaces in its WAR file is undefined.
The following table describes properties for the class-loader element.
Table A–18 class-loader Properties
Property |
Default |
Description |
---|---|---|
false |
If true, specifies that all JAR and ZIP files in the WEB-INF/lib directory that start with a period (.) are ignored by the class loader. |
Describes runtime information for a CMP entity bean object for EJB 1.1 and EJB 2.1 beans.
This element is not implemented for GlassFish v3 Prelude.
ejb (sun-ejb-jar.xml)
The following table describes subelements for the cmp element.
Table A–19 cmp Subelements
Element |
Required |
Description |
---|---|---|
zero or one |
This element is not implemented. |
|
zero or one |
This element is not implemented. |
|
zero or one |
Describes the finders for CMP 1.1 beans. |
|
zero or one |
Disables prefetching of entity bean states for the specified query methods. |
Specifies the database to be used for storing CMP beans.
This element is not implemented for GlassFish v3 Prelude.
enterprise-beans (sun-ejb-jar.xml)
The following table describes subelements for the cmp-resource element.
Table A–20 cmp-resource Subelements
Element |
Required |
Description |
---|---|---|
only one |
Specifies the absolute jndi-name of a JDBC resource. |
|
zero or one |
Specifies the default runtime bindings of a resource reference. |
|
zero or more |
Specifies a property name and value. Used to configure PersistenceManagerFactory properties. |
|
zero or one |
If true, specifies that database tables are created for beans that are automatically mapped by the EJB container. |
|
zero or one |
If true, specifies that database tables that were automatically created when the bean(s) were last deployed are dropped when the bean(s) are undeployed. |
|
zero or one |
Specifies the name of the database vendor for which tables can be created. |
|
zero or one |
Specifies field-specific type mappings and allows you to set the use-unique-table-names property. |
Overrides the Transaction Timeout setting of the Transaction Service for an individual bean. The default value, 0, specifies that the default Transaction Service timeout is used. If positive, this value is used for all methods in the bean that start a new container-managed transaction. This value is not used if the bean joins a client transaction.
ejb (sun-ejb-jar.xml)
none - contains data
Specifies the commit option used on transaction completion. Valid values for the Enterprise Server are B or C. Default value is B. Applies to entity beans.
This element is not implemented for GlassFish v3 Prelude.
ejb (sun-ejb-jar.xml)
none - contains data
Specifies if the target supports privacy-protected messages. The values are NONE, SUPPORTED, or REQUIRED.
transport-config (sun-ejb-jar.xml)
none - contains data
Specifies a cacheability constraint for the given url-pattern or servlet-name.
All constraint-field constraints must pass for a response to be cached. If there are value constraints, at least one of them must pass.
cache-mapping (sun-web.xml)
The following table describes subelements for the constraint-field element.
Table A–21 constraint-field Subelements
Element |
Required |
Description |
---|---|---|
zero or more |
Contains a value to be matched to the input parameter value. |
The following table describes attributes for the constraint-field element.
Table A–22 constraint-field Attributes
Attribute |
Default |
Description |
---|---|---|
name |
none |
Specifies the input parameter name. |
request.parameter |
(optional) Specifies the scope from which the input parameter is retrieved. Allowed values are context.attribute, request.header, request.parameter, request.cookie, request.attribute, and session.attribute. |
|
true |
(optional) If true, caches the response if matching succeeds. Overrides the same attribute in a constraint-field-value subelement. |
|
false |
(optional) If true, caches the response if matching fails. Overrides the same attribute in a constraint-field-value subelement. |
Specifies a value to be matched to the input parameter value. The matching is case sensitive. For example:
<value match-expr="in-range">1-60</value>
constraint-field (sun-web.xml)
none - contains data
The following table describes attributes for the constraint-field-value element.
Table A–23 constraint-field-value Attributes
Attribute |
Default |
Description |
---|---|---|
equals |
(optional) Specifies the type of comparison performed with the value. Allowed values are equals, not-equals, greater, lesser, and in-range. If match-expr is greater or lesser, the value must be a number. If match-expr is in-range, the value must be of the form n1-n2, where n1 and n2 are numbers. |
|
true |
(optional) If true, caches the response if matching succeeds. |
|
false |
(optional) If true, caches the response if matching fails. |
Contains the web context root for the web application. Overrides the corresponding element in the web.xml file.
sun-web-app (sun-web.xml)
none - contains data
Specifies session cookie properties.
session-config (sun-web.xml)
The following table describes subelements for the cookie-properties element.
Table A–24 cookie-properties Subelements
Element |
Required |
Description |
---|---|---|
zero or more |
Specifies a property, which has a name and a value. |
The following table describes properties for the cookie-properties element.
Table A–25 cookie-properties Properties
Property |
Default |
Description |
---|---|---|
Context path at which the web module is installed. |
Specifies the pathname that is set when the cookie is created. The browser sends the cookie if the pathname for the request contains this pathname. If set to / (slash), the browser sends cookies to all URLs served by the Enterprise Server. You can set the path to a narrower mapping to limit the request URLs to which the browser sends cookies. |
|
-1 |
Specifies the expiration time (in seconds) after which the browser expires the cookie. |
|
(unset) |
Specifies the domain for which the cookie is valid. |
|
Sun GlassFish Enterprise Server Session Tracking Cookie |
Specifies the comment that identifies the session tracking cookie in the cookie file. Applications can provide a more specific comment for the cookie. |
|
dynamic |
Sets the Secure attribute of any JSESSIONID cookies associated with the web application. Allowed values are as follows:
To set the Secure attribute of a JSESSIONIDSSO cookie, use the ssoCookieSecure virtual-server property in the domain.xml file. For details, see virtual-server in Sun GlassFish Enterprise Server v3 Prelude Administration Reference. |
Specifies whether database tables are created for beans that are automatically mapped by the EJB container. If true, creates tables in the database. If false (the default if this element is not present), does not create tables.
This element is not implemented for GlassFish v3 Prelude.
cmp-resource (sun-ejb-jar.xml)
none - contains data