📄 env-tags.xtp
字号:
& r_binding* & r_init? & r_jndi-name? & r_name? & r_scope?}</def><example title="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></example></defun> <defun title="<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="<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="<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?}</def></defun><defun title="<database>" occur="*" version="Resin 3.0" type="defun"><parents>resin, cluster, host, web-app</parents> <!-- com.caucho.sql.DBPool --><p><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="<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 <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="<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 * { * }?}</def><example title="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></example></defun><defun title="<database-default>" occur="*" version="Resin 3.0" type="defun"><parents>resin, cluster, host, web-app</parents> <!-- com.caucho.sql.DBPool --><p><database-default> defines default database values to be usedfor any <database> definition, or runtime database creation(see <a href="http://caucho.com/resin-javadoc/com/caucho/sql/DatabaseManager.html">DatabaseManager</a>).</p><def title="<database-default> schema">element database-default { r_database-Content}</def><example title="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></example></defun><defun title="<dependency>" occur="?" version="Resin 3.0.1" type="defun"><parents>resin, cluster, host, web-app</parents><p><dependency> adds dependent files which should force areload when changed, like web.xml and resin-web.xml.</p><deftable title="<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="<dependency> schema">element dependency { string}</def><example title="Example: struts dependency"><web-app xmlns="http://caucho.com/ns/resin"> <dependency path="WEB-INF/struts-config.xml"/> ...</web-app></example></defun><defun title="<dependency-check-interval>" occur="?" version="Resin 3.0"><parents>resin, cluster, host, web-app</parents><default>2s</default><p><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="<dependency-check-interval> schema">element dependency-check-interval { string}</def><example title="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></example></defun><defun title="<ejb-message-bean>" occur="*" version="Resin 3.0"><parents>resin, cluster, host, web-app</parents> <!-- com.caucho.ejb.EJBServer --><p><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="<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 + -