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

📄 env-tags.xtp

📁 RESIN 3.2 最新源码
💻 XTP
📖 第 1 页 / 共 5 页
字号:
  &amp; r_binding*  &amp; r_init?  &amp; r_jndi-name?  &amp; r_name?  &amp; r_scope?}</def><example title="Example: WEB-INF/resin-web.xml component bean">&lt;web-app xmlns="http://caucho.com/ns/resin">  &lt;component name="test"&gt;    &lt;type&gt;test.MyBean&lt;/type&gt;    &lt;init&gt;      &lt;greeting&gt;Hello&lt;/greeting&gt;      &lt;server&gt;${serverId}&lt;/server&gt;      &lt;sub-bean&gt;        &lt;value&gt;${2 + 2}&lt;/value&gt;      &lt;/sub-bean&gt;    &lt;/init&gt;  &lt;/component&gt;&lt;/web-app></example></defun> <defun title="&lt;connection-factory>" occur="*" version="Resin 3.1.5"       type="defun"><parents>resin, cluster, host, web-app</parents>  <!-- com.caucho.jca.ConnectorResource --><deftable title="Parallels to JDBC"><tr>  <th>JDBC Class</th>  <th>Connector Class</th></tr><tr>  <td>Connection</td>  <td>Connection (driver-defined class)</td></tr><tr>  <td>DataSource</td>  <td>ConnectionFactory (driver-defined class)</td></tr><tr>  <td>Driver</td>  <td>ManagedConnectionFactory</td></tr><tr>  <td>n/a</td>  <td>ResourceAdapter</td></tr></deftable><deftable title="&lt;connection-factory> attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>class</td>  <td>ManagedConnectionFactory driver for the resource</td>  <td>required or <var>uri</var></td></tr><tr>  <td>init</td>  <td>IoC configuration for the ManagedConnectionFactory</td>  <td></td></tr><tr>  <td>local-transaction-optimization</td>  <td>Enables the local transaction optimization during commit</td>  <td>true</td></tr><tr>  <td>max-active-time</td>  <td>Configures the maximum time allowed for a connection</td>  <td>infinite</td></tr><tr>  <td>max-connections</td>  <td>Configures the maximum connections available</td>  <td>1024</td></tr><tr>  <td>jndi-name</td>  <td>JNDI name for the <code>ConnectionFactory</code></td>  <td></td></tr><tr>  <td>name</td>  <td>The IoC name for the <code>ConnectionFactory</code>, used for @Named injection. Resin 3.1.4.</td>  <td></td></tr><tr>  <td>resource-adapter</td>  <td>The driver's <code>ResourceAdapter</code></td>  <td></td></tr><tr>  <td>shareable</td>  <td>Enables sharing of <code>Connection</code> objects in a transaction</td>  <td>true</td></tr><tr>  <td>uri</td>  <td>Shortcut alias for the ManagedConnectionFactory</td>  <td>required or <var>class</var></td></tr></deftable><def title="&lt;connection-factory> schema">r_connection-factory = element connection-factory {  (r_class | r_uri)  &amp; r_binding*  &amp; r_init?  &amp; r_jndi-name?  &amp; r_name?  &amp; local-transaction-optimization?  &amp; max-active-time?  &amp; max-connections?  &amp; resource-adapter?  &amp; shareable?}</def></defun><defun title="&lt;database>" occur="*" version="Resin 3.0" type="defun"><parents>resin, cluster, host, web-app</parents>  <!-- com.caucho.sql.DBPool --><p>&lt;database> defines a database (i.e. DataSource)  resource.</p><p>The <a href="config-database.xtp">database configuration</a> section hasmore details on the configuration.  A code pattern for using databasesis in a <a href="../examples/db-jdbc/index.xtp">DataSource tutorial.</a></p><deftable title="&lt;database> attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>backup-driver</td>  <td>Configures a backup database driver.  If Resin can't connect toany of the main drivers, it will use one of the. backups</td>  <td></td></tr><tr>  <td>close-dangling-connections</td>  <td>If an application does not close a Connection by the end of therequest, Resin will close it automatically an issue a warning.</td>  <td>true</td></tr><tr>  <td>connection</td>  <td>Defines initialization attributes for new connections, e.g.setting the transaction-isolation.</td>  <td>true</td></tr><tr>  <td>connection-wait-time</td>  <td>When max-connections has been reached, how long Resin will wait fora connection to become idle before giving up.</td>  <td>10min</td></tr><tr>  <td>driver</td>  <td>Configures the database driver, giving the driver's class nameas well as its JDBC URL and any other configuration.</td>  <td>required</td></tr><tr>  <td>jndi-name</td>  <td>The JNDI name to register the connection's <code>DataSource</code>under.  If the name can be relative to <var>java:comp/env</var>.</td>  <td></td></tr><tr>  <td>max-active-time</td>  <td>The maximum time Resin will allow a connection to remain openbefore forcing a close.</td>  <td>6 hours</td></tr><tr>  <td>max-close-statements</td>  <td>The maximum number of Statements Resin will hold to automaticallyclose when the Connection closes.</td>  <td>256</td></tr><tr>  <td>max-connections</td>  <td>The maximum number of Connections allowed.</td>  <td>128</td></tr><tr>  <td>max-create-connections</td>  <td>The maximum number of connection creation allowed at one time.</td>  <td>5</td></tr><tr>  <td>max-idle-count</td>  <td>The maximum number of Connections in the idle pool.</td>  <td>1024</td></tr><tr>  <td>max-idle-time</td>  <td>The maximum time a connection will spend in the idle pool before closing.</td>  <td>30s</td></tr><tr>  <td>max-overflow-connections</td>  <td>The number of extra connection creation if the number of connections exceeds to pool size.</td>  <td>0</td></tr><tr>  <td>max-pool-time</td>  <td>The total time a connection can be used before it is automatically closed instead of returned to the idle pool.</td>  <td>24h</td></tr><tr>  <td>name</td>  <td>The IoC name to save the <code>ConnectionFactory</code> as,used with <code>@Named</code> to inject the resource.</td>  <td></td></tr><tr>  <td>password</td>  <td>The JDBC password for the connection.</td>  <td></td></tr><tr>  <td>ping</td>  <td>If true, Resin will ping the database before returning a connectionfrom the pool (if ping-interval is exceeded).</td>  <td>false</td></tr><tr>  <td>ping-interval</td>  <td>How often an idle connection should ping the databaseto ensure it is still valid.</td>  <td>1s</td></tr><tr>  <td>ping-query</td>  <td>A custom query used to ping the database connection.</td>  <td></td></tr><tr>  <td>ping-table</td>  <td>A table used to ping the database connection.</td>  <td></td></tr><tr>  <td>prepared-statement-cache-size</td>  <td>How many <code>PreparedStatements</code> to save in theprepared statement cache.</td>  <td>0</td></tr><tr>  <td>save-allocation-stack-trace</td>  <td>If true, saves the location of the connection allocation as astack trace.</td>  <td>false</td></tr><tr>  <td>spy</td>  <td>Enables spy logging of database statements.  The logging occurs withname="com.caucho.sql" and level="fine".</td>  <td>false</td></tr><tr>  <td>transaction-timeout</td>  <td>Sets the transaction timeout.</td>  <td>none</td></tr><tr>  <td>user</td>  <td>Sets the authentication user.</td>  <td></td></tr><tr>  <td>wrap-statements</td>  <td>If true, Resin wraps statements and automatically closes themon connection close.</td>  <td>true</td></tr><tr>  <td>xa</td>  <td>Enables automatic enlistment of <code>Connections</code>with any <code>UserTransaction</code>.  Disabling &lt;xa> means theconnection are independent of transactions, useful for read-onlyconnections.</td>  <td>true</td></tr><tr>  <td>xa-forbid-same-rm</td>  <td>Workaround flag to handle certain database drivers that donot properly implement the XAResource API.</td>  <td>false</td></tr></deftable><def title="&lt;database> schema">database = element database {  backup-driver*  &amp; close-dangling-connections?  &amp; connection?  &amp; connection-wait-time?  &amp; driver+  &amp; jndi-name?  &amp; max-active-time?  &amp; max-close-statements?  &amp; max-connections?  &amp; max-create-connections?  &amp; max-idle-count?  &amp; max-idle-time?  &amp; max-overflow-connections?  &amp; max-pool-time?  &amp; name?  &amp; password?  &amp; ping?  &amp; ping-interval?  &amp; ping-query?  &amp; ping-table?  &amp; prepared-statement-cache-size?  &amp; save-allocation-stack-trace?  &amp; spy?  &amp; transaction-timeout?  &amp; user?  &amp; wrap-statements?  &amp; xa?  &amp; xa-forbid-same-rm?}backup-driver = element backup-driver {  class?  &amp; url?  &amp; element * { * }?}connection = element connection {  catalog?  &amp; read-only?  &amp; transaction-isolation?}driver = element driver {  class?  &amp; url?  &amp; element * { * }?}</def><example title="Example: WEB-INF/resin-web.xml database">&lt;web-app xmlns="http://caucho.com/ns/resin">&lt;database jndi-name='jdbc/test_mysql'&gt;  &lt;driver class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"&gt;    &lt;url&gt;jdbc:mysql://localhost:3306/test&lt;/url&gt;    &lt;user&gt;&lt;/user&gt;    &lt;password&gt;&lt;/password&gt;  &lt;/driver&gt;&lt;/database&gt;&lt;/web-app></example></defun><defun title="&lt;database-default>" occur="*" version="Resin 3.0" type="defun"><parents>resin, cluster, host, web-app</parents>  <!-- com.caucho.sql.DBPool --><p>&lt;database-default> defines default database values to be usedfor any &lt;database> definition, or runtime database creation(see <a href="http://caucho.com/resin-javadoc/com/caucho/sql/DatabaseManager.html">DatabaseManager</a>).</p><def title="&lt;database-default> schema">element database-default {  r_database-Content}</def><example title="Example: WEB-INF/resin-web.xml idle-time defaults">&lt;web-app xmlns="http://caucho.com/ns/resin">  &lt;database-default>    &lt;max-idle-time>10s&lt;/max-idle-time>  &lt;/database-default>&lt;/web-app></example></defun><defun title="&lt;dependency>" occur="?" version="Resin 3.0.1" type="defun"><parents>resin, cluster, host, web-app</parents><p>&lt;dependency> adds dependent files which should force areload when changed, like web.xml and resin-web.xml.</p><deftable title="&lt;dependency> attributes">><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>path</td>  <td>Filesystem path to the dependent file.  Since Resin 3.0</td>  <td>required</td></tr></deftable><def title="&lt;dependency> schema">element dependency {  string}</def><example title="Example: struts dependency">&lt;web-app xmlns="http://caucho.com/ns/resin"&gt;  &lt;dependency path="WEB-INF/struts-config.xml"/&gt;  ...&lt;/web-app&gt;</example></defun><defun title="&lt;dependency-check-interval>" occur="?" version="Resin 3.0"><parents>resin, cluster, host, web-app</parents><default>2s</default><p>&lt;dependency-check-interval> Configures how often the environment contextshould be checked for changes.  The default value is set low fordevelopment purposes, deployments should use something larger like5m or 1h.</p><p>Resin automatically checks each environment for updates, generallyclass or configuration updates.  Because these checks can take a considerableamount of time, deployment servers should use high values like 60s or more while development machines will want low values like 2s.</p><p>The interval defaults to the parent's interval.  So the web-app willdefault to the host's value.</p><def title="&lt;dependency-check-interval> schema">element dependency-check-interval {  string}</def><example title="Example: deployment dependency-check-interval">&lt;resin xmlns="http://caucho.com/ns/resin">  &lt;cluster id="app-tier">    &lt;dependency-check-interval>1h&lt;dependency-check-interval>    &lt;server id="app-a" .../>    &lt;host id=""/>      ...  &lt;/cluster>&lt;/resin></example></defun><defun title="&lt;ejb-message-bean>" occur="*" version="Resin 3.0"><parents>resin, cluster, host, web-app</parents>  <!-- com.caucho.ejb.EJBServer --><p>&lt;ejb-message-bean> configures a bean as a message listener.The listener can be a simple bean that just implements the<code>javax.jms.MessageListener interface</code>.  No other packagingor complications are necessary.  Resin will retrieve messages from aconfigured queue and pass them to the listener as they arrive.  Thelisteners are typically pooled.</p><p>The bean has full access to Resin-IoC capabilities, includingdependency injection, transaction attributes, and aspect interception.</p><p>The message bean can plug into custom messaging systems.  Theapplication will need to define a <a href="http://caucho.com/resin-javadoc/javax/resource/spi/ResourceAdapter.html">ResourceAdapter</a> andan <code>ActivationSpec</code>.  More details are available in the<a href="resin-messaging.xtp">Resin Messaging section</a>.</p><deftable title="&lt;ejb-message-bean> attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>activation-spec</td>  <td>Configures a custom message-listener driver</td>  <td></td></tr><tr>  <td>class</td>  <td>Classname of the listener bean</td>  <td>required</td></tr><tr>  <td>destination</td>  <td>Queue or Topic for JMS message receiving</td>  <td></td></tr><tr>  <td>destination-type</td>  <td>javax.jms.Queue or javax.jms.Topic</td>  <td></td></tr><tr>  <td>init</td>  <td>IoC configuration for the listener bean</td>

⌨️ 快捷键说明

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