![]() | ![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
documentation examples changes overview quick start installation command-line configuration admin amber clustering caching database deployment ejb 3.0 embedding filters hessian hmtp ioc jsp logging messaging performance quercus/php remoting scheduled tasks security server push servlets third-party troubleshooting virtual hosting watchdog webapp xml and xslt <cluster> <database> <host> ports <resin> resource tags rewrite <server> session variables <web-app> index relax schema | resources: class loaders, environment and ioc
Environment tags configure class-loaders, logging, authentication and resources like databases, JMS queues, EJB servers, and web service clients. Many of the resources are stored in JNDI or in EL variables for later assembly. Any environment resource can appear in any of Resin environments: <resin>, <cluster>, <host> and <web-app>. Resources configured at parent levels are shared among all children, so a database can share connection pools for all web-apps or an authenticator can provide single-signon.
<authenticator> configures an authentication resource
for the current environment context. The authenticator is used for
login and also for the The authenticators are scoped to their containing environment. An authenticator defined in WEB-INF/resin-web.xml applies only to the web-app, while an authenticator defined in the <cluster> section of the resin.conf applies to the entire cluster. The <management> configuration provides an authenticator which is available to all applications. Resin's servlet authentication uses an authentication resource to validate user login and to provide single-signon capability. The authenticator is configured in the environment context where it is shared. An authenticator configured in the web-app only applies to the web-app, but an authenticator configured in the host will apply to all hosts. The authenticator class is selected with the
Configuration of the authenticator uses bean-style configuration in the <init> tag. See also: the Resin security section.
<authenticator> schema r_authenticator = element authenticator { (r_class | r_uri) & r_binding* & r_init? & r_jndi-name? & r_name? & r_scope? } Example: WEB-INF/resin-web.xml properties-based authenticator <web-app xmlns="http://caucho.com/ns/resin"> <authenticator uri="properties:password-digest=none"> <init> harry=quidditch,user ron=cannons,user,prefect </init> </authenticator> </web-app> <bean> configures a custom singleton bean and stores in the WebBeans registry. <bean> is a primary configuration tag for Resin's IoC capabilities. The bean can also be optional registered in JNDI. Custom configuration of the bean is in the <init> section. Field values may use JSP-EL expressions as well as constant strings or even complex sub-beans. More details for configuring singleton beans are in Resin IoC.
<bean> schema r_bean = element bean { r_class? & r_binding* & r_init? & r_jndi-name? & r_mbean-name? & r_mbean-interface? & r_name? & r_scope? } Example: WEB-INF/resin-web.xml singleton bean <web-app xmlns="http://caucho.com/ns/resin"> <bean name="test"> <type>test.MyBean</type> <init> <greeting>Hello</greeting> <server>${serverId}</server> <sub-bean> <value>${2 + 2}</value> </sub-bean> </init> </bean> </web-app> default true on Windows, false on Unix. <case-insensitive> specifies whether the environment context is case sensitive or insensitive. Because some operating systems are case-insensitive, it is important for security reasons for Resin to behave differently for case-sensitive and case-insensitive directories. For example, when case-insensitive is true, url-patterns will match in a case-insensitive manner, so TEST.JSP will work like test.jsp. <case-insensitive> schema r_case-insensitive = element case-insensitive { r_boolean-Type } default The default value is ISO-8859-1. <character-encoding> specifies the default character encoding for the environment. <character-encoding> schema r_character-encoding = element character-encoding { string } Example: utf-8 as default character encoding <resin xmlns="http://caucho.com/ns/resin"> <character-encoding>utf-8</character-encoding> ... </resin> <class-loader> configures a dynamic classloader for the current environment. Each environment (<cluster>, <host>, <web-app>) etc, can add dynamic classloaders. The environment will inherit the parent classloaders. Each <class-loader> is comprised of several implementing loader items: library-loader for WEB-INF/lib, compiling-loader for WEB-INF/classes. For web-apps, the classloaders generally belong in a <prologue> section, which ensures that Resin evaluates them first. The evaluation order is particularly important in cases like resin-web.xml vs web.xml, because the resin-web.xml is evaluated after the web.xml.
<class-loader> schema r_class-loader = element class-loader { r_compiling-loader* & r_library-loader* & r_simple-loader* & r_tree-loader* } Example: WEB-INF/resin-web.xml defined <class-loader> <web-app xmlns="http://caucho.com/ns/resin"> <prologue> <class-loader> <compiling-loader path="WEB-INF/classes"/> <library-loader path="WEB-INF/lib"/> </class-loader> </prologue> </web-app> <compiling-loader> automatically compiles Java code into .class files before loading them.
Example: WEB-INF/resin-web.xml <compiling-loader> <web-app xmlns="http://caucho.com/ns/resin"> <prologue> <class-loader> <compiling-loader path="WEB-INF/classes" source="WEB-INF/src"/> </class-loader> </prologue> </web-app> <component> configures a component bean template and stores in the WebBeans registry. Injection of a <component> will generally create a new bean instance in constrast to the singleton <bean>. <component> is a primary configuration tag for Resin's IoC capabilities. The bean can also be optionally registered in JNDI. Custom configuration of the component is in the <init> section. Field values may use JSP-EL expressions as well as constant strings or even complex sub-beans. More details for configuring singleton beans are in Resin IoC.
<component> schema r_component = element component { r_class? & r_binding* & r_init? & r_jndi-name? & r_name? & r_scope? } Example: WEB-INF/resin-web.xml component bean <web-app xmlns="http://caucho.com/ns/resin"> <component name="test"> <type>test.MyBean</type> <init> <greeting>Hello</greeting> <server>${serverId}</server> <sub-bean> <value>${2 + 2}</value> </sub-bean> </init> </component> </web-app>
<connection-factory> schema r_connection-factory = element connection-factory { (r_class | r_uri) & r_binding* & r_init? & r_jndi-name? & r_name? & local-transaction-optimization? & max-active-time? & max-connections? & resource-adapter? & shareable? } <database> defines a database (i.e. DataSource) resource. The database configuration section has more details on the configuration. A code pattern for using databases is in a DataSource tutorial.
<database> schema database = element database { backup-driver* & close-dangling-connections? & connection? & connection-wait-time? & driver+ & jndi-name? & max-active-time? & max-close-statements? & max-connections? & max-create-connections? & max-idle-count? & max-idle-time? & max-overflow-connections? & max-pool-time? & name? & password? & ping? & ping-interval? & ping-query? & ping-table? & prepared-statement-cache-size? & save-allocation-stack-trace? & spy? & transaction-timeout? & user? & wrap-statements? & xa? & xa-forbid-same-rm? } backup-driver = element backup-driver { class? & url? & element * { * }? } connection = element connection { catalog? & read-only? & transaction-isolation? } driver = element driver { class? & url? & element * { * }? } Example: WEB-INF/resin-web.xml database <web-app xmlns="http://caucho.com/ns/resin"> <database jndi-name='jdbc/test_mysql'> <driver class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"> <url>jdbc:mysql://localhost:3306/test</url> <user></user> <password></password> </driver> </database> </web-app> <database-default> defines default database values to be used for any <database> definition, or runtime database creation (see DatabaseManager). <database-default> schema element database-default { r_database-Content } Example: WEB-INF/resin-web.xml idle-time defaults <web-app xmlns="http://caucho.com/ns/resin"> <database-default> <max-idle-time>10s</max-idle-time> </database-default> </web-app> <dependency> adds dependent files which should force a reload when changed, like web.xml and resin-web.xml.
<dependency> schema element dependency { string } Example: struts dependency <web-app xmlns="http://caucho.com/ns/resin"> <dependency path="WEB-INF/struts-config.xml"/> ... </web-app> default 2s <dependency-check-interval> Configures how often the environment context should be checked for changes. The default value is set low for development purposes, deployments should use something larger like 5m or 1h. Resin automatically checks each environment for updates, generally class or configuration updates. Because these checks can take a considerable amount of time, deployment servers should use high values like 60s or more while development machines will want low values like 2s. The interval defaults to the parent's interval. So the web-app will default to the host's value. <dependency-check-interval> schema element dependency-check-interval { string } Example: deployment dependency-check-interval <resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <dependency-check-interval>1h<dependency-check-interval> <server id="app-a" .../> <host id=""/> ... </cluster> </resin> <ejb-message-bean> configures a bean as a message listener.
The listener can be a simple bean that just implements the
The bean has full access to Resin-IoC capabilities, including dependency injection, transaction attributes, and aspect interception. The message bean can plug into custom messaging systems. The
application will need to define a ResourceAdapter and
an
<ejb-message-bean> schema element ejb-message-bean { class & init? & (activation-spec? | (destination? & destination-type? & destination-name? & message-consumer-max?) ) } Example: JMS listener in WEB-INF/resin-web.xml <web-app xmlns="http://caucho.com/ns/resin"> <jms-connection-factory uri="resin:"/> <jms-queue name="my_queue" uri="memory:"/> <ejb-message-bean class="qa.MyListener"> <destination>${my_queue}</destination> </ejb-message-bean> </web-app> Example: ActiveMQ in WEB-INF/resin-web.xml <web-app xmlns="http://caucho.com/ns/resin"> <resource-adapter uri="activemq:"/> <ejb-message-bean class="qa.MyListener"> <activation-spec uri="activemq:"> <init physical-name="queue.test"/> </activation-spec uri="activemq:"> </ejb-message-bean> </web-app> Configures an EJB server. See Resin EJB for more details.
<ejb-server> schema element ejb-server { auto-compile & create-database-schema & data-source & config-directory & ejb-descriptor & ejb-jar & jndi-prefix & validate-database-schema & jms-connection-factory & xa-data-source } <ejb-stateful-bean> configures an EJB @Stateful bean. The @Stateful bean is a single-threaded component bean suitable for transaction processing. See Resin EJB for more details. The stateful-bean is registered in the Resin-IoC/WebBeans context and optionally with JNDI. Since @Stateful beans are components, they are created at the request of the application and destroyed by the application. @Stateful beans are never singletons. For singleton-style beans, either use a <bean> or a @Stateless session bean. @Stateful beans may optionally implement a SessionSynchronization interface for transaction callbacks.
<ejb-stateful-bean> schema element ejb-stateful-bean { class & init? & jndi-name? & name? & scope? } <ejb-stateless-bean> configures an EJB @Stateless bean. The @Statelesss bean is a pooled, proxied, singleton component bean suitable. See Resin EJB for more details. The stateless-bean is registered in the Resin-IoC/WebBeans context and optionally with JNDI. @Stateless beans are similar to <bean> singletons, but pool instances. Each instance executes a single thread at a time, unlike <bean> singletons which are multithreaded like servlets. Both styles can use the same aspect capabilities like dependency injection, transactions, and interceptors. Because @Stateless beans are singletons, they do not have a scope attribute.
<ejb-stateless-bean> schema element ejb-stateless-bean { class & init? & jndi-name? & name? } <env-entry> configures a JNDI scalar value for JNDI-based application configuration. Some application beans prefer to retrieve configuration data from JNDI, including String, Integer, and Double constants. env-entry configures that data in the current context. As with other Resin configuration, the value can use JSP-EL expressions.
<env-entry> schema element env-entry { description*, env-entry-name, env-entry-type, env-entry-value } The example configuration stores a string in java:comp/env/greeting. Following the J2EE spec, the env-entry-name is relative to java:comp/env. If the env-entry is in the <host> context, it will be visible to all web-apps in the host. Example: WEB-INF/resin-web.xml with env-entry <web-app xmlns="http://caucho.com/ns/resin"> <env-entry> <env-entry-name>greeting</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>Hello, World</env-entry-value> </env-entry> <servlet ...> </servlet> </web-app> The following servlet fragment is a typical use in a servlet. The servlet only looks up the variable once and stores it for later use. Example: GreetingServlet.java import java.io.*; import javax.naming.*; import javax.servlet.*; import javax.servlet.http.*; public class TestServlet extends HttpServlet { private String greeting; public void init() throws ServletException { try { Context env = (Context) new InitialContext().lookup("java:comp/env"); greeting = (String) env.lookup("greeting"); } catch (NamingException e) { throw new ServletException(e); } } ... } <fileset> provides the ability to match a set of files. It is modelled after the ant tag by the same name. The fileset matches files from a base directory defined by 'dir'. Files can be included by patterns defined by <include> tags or excluded by patterns defined in <exclude> tags.
<fileset> schema element fileset { dir & exclude* & include* fileset patternsA pattern can contain two special characters: '*' and '**'. '*' matches any part of path, but does not match the path separator. '**' matches any part of a path, including the path separator. The following example matches .jar files in WEB-INF/lib. Since it does not search the lib directory recursively, WEB-INF/lib/foo/bar.jar will not match. Example: fileset pattern '*' <fileset dir="WEB-INF/lib"> <include name="*.jar"/> </fileset> MATCH lib/foo.jar MATCH lib/bar.jar NO MATCH lib/baz/foo.jar The following example matches .jar files in WEB-INF/lib recursively, so a deeper file like WEB-INF/lib/foo/bar.jar will match. Example: fileset pattern '**' <fileset dir="WEB-INF/tree"> <include name="**/*.jar"/> </fileset> MATCH lib/foo.jar MATCH lib/bar.jar MATCH lib/baz/foo.jar <javac> configures the Java compiler for automatically compiled files. The javac configuration is used for JSP, PHP, EJB and compiling-loader configuration.
<javac> schema element javac { args* & compiler & encoding? & max-batch? } The eclipse compiler requires the presence of $RESIN_HOME/lib/eclipse-compiler.jar (which is included with Resin). It is a very fast compiler that was developed as part of the Eclipse project. Example: eclipse compiler <resin xmlns="http://caucho.com/ns/resin"> <javac compiler="eclipse" args="-source 1.5"/> ... </resin> The internal compiler requires tools.jar from the JDK installation, so a JDK must be used (not a JRE). Sometimes the internal compiler causes errors, creating exceptions or simply hanging and taking up a thread. The solution is to change the compiler to use an external compiler. Internal compiler <resin xmlns="http://caucho.com/ns/resin"> <javac compiler="internal" args=""/> </resin> The javac compiler is included with the JDK. It executes that same as the internal compiler, however it is executed as an external process and is less prone to the problems described for the internal compiler. In resin.conf with the javac configuration option: javac JDK compiler <resin xmlns="http://caucho.com/ns/resin"> <javac compiler="javac" args=""/> ... </resin> <jms-connection-factory> configures a JMS See Resin messaging for more information.
<jms-connection-factory> schema element jms-connection-factory { (class | uri) & init? & jndi-name? & name? } <jms-queue> configures a JMS See Resin messaging for more information. The Queue can either be identified by the implementing class name or with a URI alias. Third-party queues using JCA will use the <resource-adapter> and either <connection-factory> or <activation-spec>. Code sending messages to a Queue will typically use either
the
<jms-queue> schema element jms-queue { (class | uri) & init & jndi-name & name } <jms-topic> configures a JMS See Resin messaging for more information. The Topic can either be identified by the implementing class name or with a URI alias. Third-party topics using JCA will use the <resource-adapter> and either <connection-factory> or <activation-spec>. Code sending messages to a Topic will typically use either
the
<jms-topic> schema element jms-topic { (class | uri) & init & jndi-name & name } <jndi-link> creates a symbolic link from one jndi name to another, or links to a foreign JNDI context. Resin's JNDI can link to foreign JNDI contexts. For example, third-party EJB servers will often expose their EJB beans through a JNDI context. jndi-link will create the appropriate InitialContextFactory, configure it, and lookup the foreign JNDI objects.
<jndi-link> schema element jndi-link { jndi-name & factory? & foreign-name? & init-param* } Example: A JNDI symbolic link for a DataSource <web-app xmlns="http://caucho.com/ns/resin"dd> <database jndi-name="jdbc/oracle"> ... </database> <jndi-link jndi-name="java:comp/env/jdbc/gryffindor"> <foreign-name>java:comp/env/jdbc/oracle</foreign-name> </jndi-link> <jndi-link jndi-name="java:comp/env/jdbc/slytherin"> <foreign-name>java:comp/env/jdbc/oracle</foreign-name> </jndi-link> </web-app> Example: A JNDI foreign context for all EJB <web-app xmlns="http://caucho.com/ns/resin"> <jndi-link jndi-name='java:comp/env/ejb'> <factory>com.caucho.ejb.hessian.HessianContextFactory</factory> <init-param java.naming.provider.url='http://ejb.hogwarts.com:80/hessian'/> </jndi-link> </web-app> Example: A JNDI foreign context for selected EJB <web-app xmlns="http://caucho.com/ns/resin"> <jndi-link jndi-name='java:comp/env/remote-ejb'> <factory>com.caucho.ejb.hessian.HessianContextFactory</factory> <init-param java.naming.provider.url='http://ejb.hogwarts.com:80/hessian'/> </jndi-link> <jndi-link jndi-name="java:comp/env/ejb/Foo"> <foreign-name>java:comp/env/remote-ejb/Foo</foreign-name> </jndi-link> <jndi-link jndi-name="java:comp/env/ejb/Bar"> <foreign-name>java:comp/env/local-ejb/Bar</foreign-name> </jndi-link> </web-app> <library-loader> configures a jar library, -style class loader.The library-loader will add jar files in its path to the current classpath.
Jar files are recognized wihen they have a filename extension of
<library-loader> schema element library-loader { fileset | path } element fileset { dir & exclude* & include* } See DirectoryLoader. child of resin, cluster, host, web-app<log> configures JDK 1.4 java.util.logger handler. The log configuration describes log in detail.
<log> schema element log { archive-format? & format? & formatter? & handler? & level? & mbean-name? & name & path? & path-format? & rollover-count? & rollover-period? & rollover-size? & timestamp? & use-parent-handlers? } <log> configures JDK 1.4 java.util.logger Logger level. The log configuration describes log in detail.
<logger> schema element logger { name & level? & use-parent-handlers? } Example: compilation logging <resin xmlns="http://caucho.com/ns/resin"> <log name="" level="all" path="log/debug.log"/> <logger name="com.caucho.java" level="fine"/> <cluster id="app-tier"> ... </cluster> </resin> <mail> configures a javax.mail.Session object and makes it available in Resin-IoC/WebBeans. Mail properties can be configured using the properties attribute. Some of the most common properties can be configured directly on the <mail> tag.
<mail> schema element mail { authenticator? & debug? & from? & host? & imap-host? & imap-port? & imap-user? & init? & jndi-name? & name? & pop3-host? & pop3-port? & pop3-user? & smtp-host? & smtp-port? & smtp-user? & store-protocol? & transport-protocol? & user? } <persistence-manager> configures JPA persistence defaults. More details on JPA are available on the Amber page.
<persistence-manager> schema element persistence-manager { create-database-schema & cache-size & cache-timeout & data-source & jdbc-isolation & read-data-source & validate-database-schema & xa-data-source } <reference> configures a JNDI ObjectFactory. Some legacy resources are configured using an ObjectFactory syntax. The <reference> tag provides a compatible way to configure those objects. More modern resources should use <bean> or <component> for IoC configuration. JNDI ObjectFactories are used to create objects from JNDI references. The <reference> tag configures the ObjectFactory and stores it in JNDI.
<reference> schema element reference { factory & jndi-name & init-param* } Example: Hessian client reference <web-app xmlns="http://caucho.com/ns/resin"> <reference> <jndi-name>hessian/hello</jndi-name> <factory>com.caucho.hessian.client.HessianProxyFactory</factory> <init url="http://localhost:8080/ejb/hello"/> type="test.HelloHome"/> </reference> </web-app> <remote-client> configures a proxy to a web-service. It uses a Java interface and a URI to select the web-service. The URI is defined as: , where location is typically a HTTP URL.
remote-client element remote-client { (class|uri) & name? & jndi-name? & interface } resin:choose implements an if, elsif, else.
The <resin:choose> schema is context-dependent. A <resin:choose> in a <web-app> will have <web-app> content, while a <resin:choose> in a <host> will have <host> content. <resin:choose> schema element resin:choose { resin:when*, resin:otherwise } element resin:when { attribute test { string },} element resin:otherwise { } Example: resin:choose usage pattern <resin:choose> <resin:when test="${expr1}"> ... </resin:when> <resin:when test="${expr2}"> ... </resin:when> <resin:otherwise> ... </resin:otherwise> <resin:choose> <resin:when>child of resin:choose<resin:when> conditionally configures a block within a <resin:choose> block. If the matches, Resin will use the enclosed configuration.
<resin:when> schema
element resin:when {
attribute test { string },
}
<resin:otherwise>child of resin:choose<resin:otherwise> is the catch-all configuration for a <resin:choose> block when none of the <resin:when> items match. <resin:otherwise> schema
element resin:otherwise {
}
resin:if executes part of the configuration file conditionally. resin:if can be particularly useful in combination with Java command-line properties like -Dfoo=bar to enable development mode or testing configuration.
The resin:if schema is context-dependent. For example, resin:if in a <web-app> will have web-app content while resin:if in a <host> will have host content. <resin:if> schema
element resin:if {
attribute test { string }
}
Example: enable debugging for -Ddevelopment <resin xmlns="http://caucho.com/ns/resin" xmlns:core="http://caucho.com/ns/resin/core"> <resin:if test="${system['development']}"> <logger name="com.foo" level="finer"/> </resin:if> ... </resin> <resin:import> reads configuration from another file or set of files. For example, the WEB-INF/web.xml and WEB-INF/resin-web.xml files are implemented as <resin:import> in the app-default.xml. The target file is validated by the schema of the including context. So a resin:import in <web-app-default> will have a target with a top-level of <web-app>, and a resin:import in <cluster> will have a top-level tag of <cluster>.
<resin:import> schema element import { (path | fileset) & optional? } element fileset { dir & exclude* & include* } The following example shows how Resin implements the WEB-INF/web.xml and WEB-INF/resin-web.xml files. Both are simply resin:import in a web-app-default. When Resin configures the web-app, it will process the web-app-default program, and call resin:import for the web.xml file. Example: import implementation of WEB-INF/web.xml <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> <cluster id="app-tier"> <web-app-default> <resin:import path="WEB-INF/web.xml" optional="true"/> <resin:import path="WEB-INF/resin-web.xml" optional="true"/> </web-app-default> </cluster> </resin> Virtual hosts can use resin:import to add a custom host.xml file. The host.xml can use any <host> attribute, including <host-name> and <host-alias> to customize the virtual host configuration. Example: adding host.xml in host-deploy <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> <cluster id="app-tier"> <host-deploy path="/var/www/hosts"> <host-default> <resin:import path="host.xml" optional="true"/> <web-app-deploy path="webapps"/> </host-default> </web-app-default> </cluster> </resin> Some applications may want to split their configuration into multiple files using the fileset. For example, a Resin-IoC application might want to define beans in WEB-INF/beans/*.xml and give the web-app flexibility in which bean files to create. Example: Bean IoC fileset in resin-web.xml <web-app xmlns="http://caucho.com/ns/resin" xmlns:core="http://caucho.com/ns/resin/core"> <resin:import> <fileset dir="WEB-INF/beans"> <include>*.xml</include> </fileset> </resin:import> </web-app> Logs a message to the given log file. The content of the element is the message. <resin:message> schema element resin:message { string } logging in resin-web.xml <web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> <resin:message>Starting server ${server.name}</resin:message> </web-app> resin:set adds an EL variable to the current context.
<resin:set> schema element set { name & value & default & attribute * { string } } Example: resin:set in resin.conf <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> <resin:set name="root" value="/var/www"/> <cluster id="app-tier"> <root-directory>${root}</root-directory> ... </cluster> </resin> <resource> is an obsolete synonym for <bean> to define custom singletons. Applications should use the <bean> syntax instead. child of resin, cluster, host, web-app<resource-adapter> configures a JCA
A symbolic URI can be used in place of the ResourceAdapter's class name.
<resource-adapter> schema element resource-adapter { (class | uri) & init? & name? & jndi-name? } <resource-deploy> defines a deployment directory for .rar files. Connectors and resources defined in .rar files must be deployed before they can be configured by connector. The <resource-deploy> tag specifies the directory for that deployment.
<resource-deploy> schema element resource-deploy { path & expand-directory? & expand-path? & resource-default? } Example: resource-deploy <resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <host id=""> <resource-deploy path="deploy"/> </host> </cluster> </resin> <resource-ref> declares that the application needs a resouce configuration. resource-ref is not directly used by Resin. It's a servlet configuration item intended to tell GUI tools which resources need configuration. Resource configuration in Resin uses the resource, reference, database, and ejb-server tags. For backwards compatibility, Resin 2.1-style configuration files may still use resource-ref to configure resources, but it's recommended to convert the configuration. <resource-ref> schema element resource-ref { attribute id?, description*, res-ref-name, ref-type, res-auth, res-sharing-scope? } <scheduled-task> schedules a job to be executed at specific times
or after specific delays. The times can be specified by a cron syntax or
by a simple delay parameter. The job can be either a When specified as an IoC bean, the bean task has full IoC capabilities, including injection, @TransactionAttribute aspects, interception and @Observes.
<scheduled-task> schema element scheduled-task { class? & cron? & delay? & init? & mbean-name? & method? & name? & period? & task? } bean-style job configurationThe most common and flexible job configuration uses standard IoC
bean-style configuration. The bean must implement Example: 5min cron bean task <web-app xmlns="http://caucho.com/ns/resin"> <scheduled-task class="qa.MyTask"> <cron>*/5</cron> </scheduled-task> </web-app> task reference job configurationThe task bean can also be passed to the <scheduled-task> using
a Resin-IoC EL reference. The name of the task bean would be defined
previously, either in a <bean> or <component> or picked up by classpath
scanning. Like the bean-style job configuration, the reference bean must
implement Example: midnight cron bean task <web-app xmlns="http://caucho.com/ns/resin"> <scheduled-task task="#{taskBean}"> <cron>0 0 *</cron> </scheduled-task> </web-app> method reference job configuration<scheduled-task> can execute a method on a defined bean as the scheduler's task. The method is specified using EL reference syntax. At each trigger time, <scheduled-task> will invoke the EL method expression. In the following example, the task invokes Example: 1h period method task <web-app xmlns="http://caucho.com/ns/resin"> <bean name="myBean" class="qa.MyBean"/> <scheduled-task method="#{myBean.myMethod}"> <delay>10m</delay> <period>1h</period> </scheduled-task> </web-app> url job configurationIn a <web-app>, the <scheduled-task> can invoke a servlet URL
at the trigger times. The task uses the servlet Example: sunday cron url task <web-app xmlns="http://caucho.com/ns/resin"> <scheduled-task url="/cron.php"> <cron>0 15 * * 0</cron> </scheduled-task> </web-app> Use of servlet-hack is discouraged. Using servlet-hack violates the JDK's classloader delegation model and can produce surprising ClassCastExceptions. servlet-hack reverses the normal class loader order. Instead of parent classloaders having priority, child classloaders have priority. <servlet-hack> schema element servlet-hack { boolean } <simple-loader> Configures a simple -style class loader..class files in the specified directory will be loaded without any special compilation steps (in contrast with compiling-loader.)
<simple-loader> schema element simple-loader { path & prefix? } Configures the destination for The log configuration describes stderr-log in detail.
<stderr-log> schema element stderr-log { (path | path-format) & archive-format? & rollover-period? & rollover-size? & rollover-count? & timestamp? } Configures the destination for The log configuration describes stderr-log in detail.
<stdout-log> schema element stdout-log { (path | path-format) & archive-format? & rollover-period? & rollover-size? & rollover-count? & timestamp? } Sets a Java system property. The effect is the same as if you had called java.lang.System before starting Resin. <system-property> schema element system-property { attribute * { string }+ } Example: setting system property <resin xmlns="http://caucho.com/ns/resin"> <system-property foo="bar"/> </resin> default Defaults to <temp-dir> configures the application temp directory. This is the path used in .<temp-dir> schema element temp-dir { string } <tree-loader> configures a jar library, library-loader, but will also find
<tree-loader> schema element tree-loader { path } default Defaults to <work-dir> configures a work directory for automatically generated code, e.g. for JSP, PHP, and JPA classes. <work-dir> schema element work-dir { string }
|