⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 env-tags.xtp

📁 RESIN 3.2 最新源码
💻 XTP
📖 第 1 页 / 共 5 页
字号:
  <td></td></tr><tr>  <td>message-consumer-max</td>  <td>The number of listener instances to create for the pool.</td>  <td>5</td></tr></deftable><def title="&lt;ejb-message-bean> schema">element ejb-message-bean {  class  &amp; init?  &amp; (activation-spec?     | (destination?        &amp; destination-type?        &amp; destination-name?        &amp; message-consumer-max?)    )}</def><example title="Example: JMS listener in WEB-INF/resin-web.xml">&lt;web-app xmlns="http://caucho.com/ns/resin">  &lt;jms-connection-factory uri="resin:"/>  &lt;jms-queue name="my_queue" uri="memory:"/>  &lt;ejb-message-bean class="qa.MyListener">    &lt;destination>${my_queue}&lt;/destination>  &lt;/ejb-message-bean>&lt;/web-app></example><example title="Example: ActiveMQ in WEB-INF/resin-web.xml">&lt;web-app xmlns="http://caucho.com/ns/resin">  &lt;resource-adapter uri="activemq:"/>  &lt;ejb-message-bean class="qa.MyListener">    &lt;activation-spec uri="activemq:">       &lt;init physical-name="queue.test"/>    &lt;/activation-spec uri="activemq:">  &lt;/ejb-message-bean>&lt;/web-app></example></defun><defun title="&lt;ejb-server>" occur="*" version="Resin 3.0"><parents>resin, cluster, host, web-app</parents>  <!-- com.caucho.ejb.EJBServer --><p>Configures an EJB server.  See <a href="resin-ejb.xtp">Resin EJB</a>for more details.</p><deftable title="&lt;ejb-server> attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>auto-compile</td>  <td>enables auto-compilation of EJB stubs and skeletons</td>  <td>true</td></tr><tr>  <td>create-database-schema</td>  <td>enables JPA auto-creation of missing database tables</td>  <td>false</td></tr><tr>  <td>data-source</td>  <td>specifies the default database for JPA</td>  <td></td></tr><tr>  <td>config-directory</td>  <td>specifies a directory containing *.ejb configuration files</td>  <td></td></tr><tr>  <td>ejb-descriptor</td>  <td>path to a *.ejb file to load</td>  <td></td></tr><tr>  <td>ejb-jar</td>  <td>path to a jar file containing a META-INF/ejb-jar.xml with EJBs</td>  <td></td></tr><tr>  <td>jndi-prefix</td>  <td>prefix for JNDI registration of EJBs</td>  <td></td></tr><tr>  <td>validate-database-schema</td>  <td>verifies the actual database tables against the JPA definitions</td>  <td>true</td></tr><tr>  <td>jms-connection-factory</td>  <td>specifies the default JMS ConnectionFactory for message beans</td>  <td></td></tr><tr>  <td>xa-data-source</td>  <td>specifies a separate database for transactions</td>  <td>data-source</td></tr></deftable><def title="&lt;ejb-server> schema">element ejb-server {  auto-compile  &amp; create-database-schema  &amp; data-source  &amp; config-directory  &amp; ejb-descriptor  &amp; ejb-jar  &amp; jndi-prefix  &amp; validate-database-schema  &amp; jms-connection-factory  &amp; xa-data-source}</def></defun><defun title="&lt;ejb-stateful-bean>"><parents>resin, host-default, host, web-app-default, web-app</parents><p>&lt;ejb-stateful-bean> configures an EJB @Stateful bean.  The@Stateful bean is a single-threaded component bean suitable fortransaction processing.  See <a href="resin-ejb.xtp">Resin EJB</a>for more details.</p><p>The stateful-bean is registered in the Resin-IoC/WebBeans context andoptionally with JNDI.</p><p>Since @Stateful beans are components, they are created at the requestof the application and destroyed by the application.  @Stateful beans arenever singletons.  For singleton-style beans, either use a &lt;bean> ora @Stateless session bean.</p><p>@Stateful beans may optionally implement a <a href="http://caucho.com/resin-javadoc/javax/ejb/SessionSynchronization.html">SessionSynchronization</a> interface for transaction callbacks.</p><deftable title="&lt;ejb-stateful-bean> Attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>class</td>  <td>the classname of the bean implementation</td>  <td>required</td></tr><tr>  <td>init</td>  <td>IoC initialization for each bean instance</td>  <td></td></tr><tr>  <td>jndi-name</td>  <td>A JNDI name to store the bean as.</td>  <td></td></tr><tr>  <td>name</td>  <td>The Resin-IoC/WebBeans @Named registration</td>  <td>The classname</td></tr><tr>  <td>scope</td>  <td>The Resin-IoC/WebBeans scope: dependent, request, session, conversaion</td>  <td>dependent classname</td></tr></deftable><def title="&lt;ejb-stateful-bean> schema">element ejb-stateful-bean {  class  &amp; init?  &amp; jndi-name?  &amp; name?  &amp; scope?}</def></defun><defun title="&lt;ejb-stateless-bean>"><parents>resin, host-default, host, web-app-default, web-app</parents><p>&lt;ejb-stateless-bean> configures an EJB @Stateless bean.  The@Statelesss bean is a pooled, proxied, singleton component bean suitable.See <a href="resin-ejb.xtp">Resin EJB</a> for more details.</p><p>The stateless-bean is registered in the Resin-IoC/WebBeans context andoptionally with JNDI.</p><p>@Stateless beans are similar to &lt;bean> singletons, but pool instances.Each instance executes a single thread at a time, unlike &lt;bean>singletons which are multithreaded like servlets.  Both styles canuse the same aspect capabilities like dependency injection, transactions,and interceptors.  Because @Stateless beans are singletons, theydo not have a scope attribute.</p><deftable title="&lt;ejb-stateless-bean> Attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>class</td>  <td>the classname of the bean implementation</td>  <td>required</td></tr><tr>  <td>init</td>  <td>IoC initialization for each bean instance</td>  <td></td></tr><tr>  <td>jndi-name</td>  <td>A JNDI name to store the bean as.</td>  <td></td></tr><tr>  <td>name</td>  <td>The Resin-IoC/WebBeans @Named registration</td>  <td>The classname</td></tr></deftable><def title="&lt;ejb-stateless-bean> schema">element ejb-stateless-bean {  class  &amp; init?  &amp; jndi-name?  &amp; name?}</def></defun><defun title="&lt;env-entry>" occur="*" version="Resin 3.0" type="defun"><parents>resin, host-default, host, web-app-default, web-app</parents>  <!-- com.caucho.config.types.EnvEntry --><p>&lt;env-entry> configures a JNDI scalar valuefor JNDI-based application configuration.</p><p>Some application beans prefer to retrieve configuration data from JNDI,including String, Integer, and Double constants.  env-entry configuresthat data in the current context.  As with other Resin configuration, thevalue can use JSP-EL expressions.</p><deftable title="&lt;env-entry> attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>env-entry-name</td>  <td>JNDI name to store the value.  Since Servlet 2.1</td>  <td>required</td></tr><tr>  <td>env-entry-type</td>  <td>Java type for the value.  Since Servlet 2.1</td>  <td>required</td></tr><tr>  <td>env-entry-value</td>  <td>Value to be stored.  Since Servlet 2.1</td>  <td>required</td></tr></deftable><def title="&lt;env-entry> schema">element env-entry {  description*,  env-entry-name,  env-entry-type,  env-entry-value}</def><p>The example configuration stores a string in java:comp/env/greeting.Following the J2EE spec, the env-entry-name is relative tojava:comp/env.  If the env-entry is in the &lt;host&gt; context, it willbe visible to all web-apps in the host.</p><example title="Example: WEB-INF/resin-web.xml with env-entry">&lt;web-app xmlns="http://caucho.com/ns/resin">  &lt;env-entry&gt;    &lt;env-entry-name&gt;greeting&lt;/env-entry-name&gt;    &lt;env-entry-type&gt;java.lang.String&lt;/env-entry-type&gt;    &lt;env-entry-value&gt;Hello, World&lt;/env-entry-value&gt;  &lt;/env-entry&gt;  &lt;servlet ...>  &lt;/servlet>&lt;/web-app></example><p>The following servlet fragment is a typical use in a servlet.  Theservlet only looks up the variable once and stores it for later use.</p><example title="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);    }  }  ...}</example></defun><defun title="&lt;fileset>" version="Resin 3.0.7" type="defun"><p>&lt;fileset&gt; provides the ability to match a set of files.  It ismodelled after the ant tag by the same name.  The fileset matchesfiles from a base directory defined by 'dir'.  Files can be includedby patterns defined by &lt;include> tags or excluded by patterns defined in&lt;exclude> tags.</p><deftable title="&lt;fileset> Attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr><td>dir</td>    <td>the starting directory</td>    <td>required</td></tr><tr><td>include</td>    <td>an include pattern</td>    <td>do not include all files</td></tr><tr><td>exclude</td>    <td>an exclude pattern</td>    <td>do not exclude any files</td></tr></deftable><def title="&lt;fileset> schema">element fileset {  dir  &amp; exclude*  &amp; include*</def><s2 title="fileset patterns"><p>A pattern can contain two special characters: '*' and '**'.  '*' matches anypart of path, but does not match the path separator.  '**' matches any part ofa path, including the path separator. </p><p>The following example matches .jar files in WEB-INF/lib.  Since it doesnot search the lib directory recursively, WEB-INF/lib/foo/bar.jar will notmatch.</p><example title="Example: fileset pattern '*'">&lt;fileset dir="WEB-INF/lib"&gt;  &lt;include name="*.jar"/&gt;&lt;/fileset&gt;MATCH    lib/foo.jarMATCH    lib/bar.jarNO MATCH lib/baz/foo.jar</example><p>The following example matches .jar files in WEB-INF/lib recursively,so a deeper file like WEB-INF/lib/foo/bar.jar will match.</p><example title="Example: fileset pattern '**'">&lt;fileset dir="WEB-INF/tree"&gt;  &lt;include name="**/*.jar"/&gt;&lt;/fileset&gt;MATCH    lib/foo.jarMATCH    lib/bar.jarMATCH    lib/baz/foo.jar</example></s2></defun><defun title="&lt;javac>" occur="?" type="defun"><parents>resin, cluster, host, web-app</parents>  <!-- com.caucho.java.JavacConfig --><p>&lt;javac> configures the Java compiler for automaticallycompiled files.</p><p>The javac configuration is used for JSP, PHP, EJB andcompiling-loader configuration.</p><deftable title="&lt;javac> Attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>args</td>  <td>extra arguments to pass to the compiler</td>  <td></td></tr><tr>  <td>compiler</td>  <td>the compiler name: eclipse, groovyc, internal, or a command-line</td>  <td></td></tr><tr>  <td>encoding</td>  <td>the character encoding to use</td>  <td>utf-8</td></tr><tr>  <td>max-batch</td>  <td>the maximum number of source files to batch into one compilation</td>  <td>64</td></tr></deftable><def title="&lt;javac> schema">element javac {  args*  &amp; compiler  &amp; encoding?  &amp; max-batch?}</def><p>The eclipse compiler requires the presence of$RESIN_HOME/lib/eclipse-compiler.jar (which is included with Resin). It is avery fast compiler that was developed as part of the Eclipse project. </p><example title="Example: eclipse compiler">&lt;resin xmlns="http://caucho.com/ns/resin"> &lt;javac compiler="eclipse" args="-source 1.5"/&gt;  ...&lt;/resin></example><p>The internal compiler requires tools.jar from the JDK installation, so a JDKmust be used (not a JRE).  Sometimes the internal compiler causes errors,creating exceptions or simply hanging and taking up a thread. The solution isto change the compiler to use an external compiler. </p><example title="Internal compiler">&lt;resin xmlns="http://caucho.com/ns/resin"> &lt;javac compiler="internal" args=""/&gt;&lt;/resin></example><p>The javac compiler is included with the JDK. It executes that same as theinternal compiler, however it is executed as an external process and is lessprone to the problems described for the internal compiler.  In resin.xml withthe javac configuration option: </p><example title="javac JDK compiler">&lt;resin xmlns="http://caucho.com/ns/resin"> &lt;javac compiler="javac" args=""/&gt;  ...&lt;/resin></example></defun><defun title="&lt;jms-connection-factory>" occur="*" version="Resin 3.1.5"><parents>resin, cluster, host, web-app</parents><p>&lt;jms-connection-factory> configures a JMS <code>ConnectionFactory</code>and registers it with Resin-IoC/WebBeans.  The <code>ConnectionFactory</code>can be specified by it's class or a URI alias.</p><p>See <a href="resin-messaging.xtp">Resin messaging</a> for more

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -