![]() |
| |||||||||
| Resin 3.1 Documentation Examples Changes Overview Installation Configuration Quercus SOA/IoC JSP Servlets and Filters Admin (JMX) EJB Amber Security Performance Hessian XML and XSLT Third-party Troubleshooting/FAQ Overview Security Java Integration Resin Module Module Status List of PHP Applications Troubleshooting/FAQ |
Quercus provides a number of Resin-specific function to integrate with JNDI, JMS, JMX, and provide extra debugging. jndi_lookup Retrives an object from JNDI. jndi_lookup is useful in a SOA (Service Oriented Architecture) system to locate a Java service.
<?php
$conn = jndi_lookup("java:comp/env/jms/jms-connection-factory");
$queue = jndi_lookup("java:comp/env/jms/test-queue");
...
?>
mbean_explode Explodes a JMX ObjectName into an array.
<?php
var_dump(mbean_explode("resin:type=WebApp,name=/foo,Host=bar.com"));
?>
array(4) {
[":domain:"]=>
string(5) "resin"
["Host"]=>
string(7) "bar.com"
["name"]=>
string(4) "/foo"
["type"]=>
string(6) "WebApp"
}
mbean_implode Creates a JMX ObjectName from an array.
<?php
$a = array(":domain:"=>"resin", "type" => "ThreadPool");
var_dump(mbean_implode($a));
?>
resin:type=ThreadPool MBeanServer An object representing a JMX MBeanServer.
<?php
$mbeanServer = new MBeanServer();
$threadPool = $mbeanServer->lookup("resin:type=ThreadPool");
echo "thread-max: " . $threadPool->threadMax;
lookupReturns a proxy to the mbean matching the given name.
<?php
$mbeanServer = new MBeanServer();
$threadPool = $mbeanServer->lookup("resin:type=ThreadPool");
queryReturns mbean proxies matching the name pattern.
<?php
$mbeanServer = new MBeanServer();
foreach ($webApp in $mbeanServer->query("resin:type=WebApp,*")) {
echo $webApp->name . "<br>\n";
}
resin_debug Write debugging information to the log. The log is at INFO level.
<?php
$a = array("a", "b");
resin_debug("ARRAY: $a[0]");
?>
resin_thread_dump Produce a thread_dump to the logs. The log is at INFO level.
<?php
$a = array("a"=>"b");
resin_thread_dump();
?>
resin_call_stack Returns an array containing the current PHP function call stack.
<?php
function foo()
{
bar();
}
function bar()
{
var_dump(resin_call_stack());
}
foo();
?>
resin_var_dump Produce a var_dump to the logs. The log is at INFO level.
<?php
$a = array("a"=>"b");
resin_var_dump($a);
?>
resin_version Returns the version of Resin running Quercus. <?php var_dump(resin_version()); ?> xa_begin Starts a distributed transaction. All database connections will automatically participate in the transaction. Returns TRUE for success, FALSE for failure. <?php xa_begin(); ... xa_commit(); ?> xa_commit Commits a distributed transaction. All database connections will automatically participate in the transaction. Returns TRUE for success, FALSE for failure. <?php xa_begin(); ... xa_commit(); ?> xa_rollback Rolls back a distributed transaction. All database connections will automatically participate in the transaction. Returns TRUE for success, FALSE for failure. <?php xa_begin(); ... xa_rollback(); ?> xa_rollback_only Marks the current distributed transaction as rollback only. Subsequent attempts to commit the transaction will fail with a warning. Returns TRUE for success, FALSE for failure.
| |||||||||