org.apache.catalina.ant.jmx

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Sevlet Container » apache tomcat 6.0.14 » org.apache.catalina.ant.jmx 
org.apache.catalina.ant.jmx

This package contains a set of JMX Task implementations for Ant (version 1.6 or later) that can be used to interact with the Remote JMX JSR 160 RMI Adaptor to get/set attributes, invoke MBean operations and query for Mbeans inside a running instance of Tomcat. For more information, see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/monitoring.html.

Each task element can open a new jmx connection or reference an existing one. The following attribute are exists in every tasks:

Attribute Description
url The JMX Connection URL of the remote Tomcat MBeansServer.
username The username of a MBeanServer auth, when configured.
password The password of a MBeanServer auth, when configured.
host The JMX Connection host.
port The JMX Connection port.
ref The name of the ant internal reference for a jmx connection.

NOTE - This Tasks only work, when JSR 160 MBean Adaptor as remote jvm is configured.

Java Source File NameTypeComment
Arg.javaClass
author:
   Peter Rossbach
version:
   $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct.
JMXAccessorCondition.javaClass Definition:
 
 <path id="catalina_ant">
 <fileset dir="${catalina.home}/server/lib">
 <include name="catalina-ant.jar"/>
 <include name="catalina-ant-jmx.jar"/>
 </fileset>
 </path>
 <typedef
 name="jmxCondition"
 classname="org.apache.catalina.ant.jmx.JMXAccessorCondition"
 classpathref="catalina_ant"/>
 <taskdef
 name="jmxOpen"
 classname="org.apache.catalina.ant.jmx.JMXAccessorTask"
 classpathref="catalina_ant"/>
 
Usage: Wait for start backup node
 <target name="wait">
 <jmxOpen
 host="${jmx.host}" port="${jmx.port}" username="${jmx.username}" password="${jmx.password}" />
 <waitfor maxwait="${maxwait}" maxwaitunit="second" timeoutproperty="server.timeout" >
 <and>
 <socket server="${server.name}" port="${server.port}"/>
 <http url="${url}"/>
 <jmxCondition
 name="Catalina:type=IDataSender,host=localhost,senderAddress=192.168.111.1,senderPort=9025"
 operation="==" 
 attribute="connected" value="true"
 />
 <jmxCondition
 operation="&lt;"
 name="Catalina:j2eeType=WebModule,name=//${tomcat.application.host}${tomcat.application.path},J2EEApplication=none,J2EEServer=none"
 attribute="startupTime" value="250"
 />
 </and>
 </waitfor>
 <fail if="server.timeout" message="Server ${url} don't answer inside ${maxwait} sec" />
 <echo message="Server ${url} alive" />
 </target>
 
Allowed operation between jmx attribute and reference value:
  • == equals
  • != not equals
  • > greater than (&gt;)
  • >= greater than or equals (&gt;=)
  • < lesser than (&lt;)
  • <= lesser than or equals (&lt;=)
NOTE: For numeric expressions the type must be set and use xml entities as operations.
As type we currently support long and double.
author:
   Peter Rossbach
version:
   $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct.
JMXAccessorCreateTask.javaClass Create new MBean at JMX JSR 160 MBeans Server.
JMXAccessorEqualsCondition.javaClass Definition
 
 <path id="catalina_ant">
 <fileset dir="${catalina.home}/server/lib">
 <include name="catalina-ant.jar"/>
 <include name="catalina-ant-jmx.jar"/>
 </fileset>
 </path>
 <typedef
 name="jmxEquals"
 classname="org.apache.catalina.ant.jmx.JMXAccessorEqualsCondition"
 classpathref="catalina_ant"/>
 
usage: Wait for start backup node
 <target name="wait">
 <waitfor maxwait="${maxwait}" maxwaitunit="second" timeoutproperty="server.timeout" >
 <and>
 <socket server="${server.name}" port="${server.port}"/>
 <http url="${url}"/>
 <jmxEquals 
 host="localhost" port="9014" username="controlRole" password="tomcat"
 name="Catalina:type=IDataSender,host=localhost,senderAddress=192.168.111.1,senderPort=9025"
 attribute="connected" value="true"
 />
 </and>
 </waitfor>
 <fail if="server.timeout" message="Server ${url} don't answer inside ${maxwait} sec" />
 <echo message="Server ${url} alive" />
 </target>
 

author:
   Peter Rossbach
version:
   $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct.
JMXAccessorGetTask.javaClass Access JMX JSR 160 MBeans Server.
JMXAccessorInvokeTask.javaClass Access JMX JSR 160 MBeans Server.
JMXAccessorQueryTask.javaClass Query for Mbeans.
JMXAccessorSetTask.javaClass Access JMX JSR 160 MBeans Server.
JMXAccessorTask.javaClass Access JMX JSR 160 MBeans Server.
  • open more then one JSR 160 rmi connection
  • Get/Set Mbeans attributes
  • Call Mbean Operation with arguments
  • Argument values can be converted from string to int,long,float,double,boolean,ObjectName or InetAddress
  • Query Mbeans
  • Show Get, Call, Query result at Ant console log
  • Bind Get, Call, Query result at Ant properties
Examples: open server with reference and autorisation
 <jmxOpen
 host="127.0.0.1"
 port="9014"
 username="monitorRole"
 password="mysecret"
 ref="jmx.myserver" 
 />
 
All calls after opening with same refid reuse the connection.

First call to a remote MBeanserver save the JMXConnection a referenz jmx.server

All JMXAccessorXXXTask support the attribute if and unless.
JMXAccessorUnregisterTask.javaClass unregister a MBean at JMX JSR 160 MBeans Server.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.