Java Doc for JMXAccessorTask.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » catalina » ant » jmx » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.catalina.ant.BaseRedirectorHelperTask
   org.apache.catalina.ant.jmx.JMXAccessorTask

All known Subclasses:   org.apache.catalina.ant.jmx.JMXAccessorCreateTask,  org.apache.catalina.ant.jmx.JMXAccessorUnregisterTask,  org.apache.catalina.ant.jmx.JMXAccessorGetTask,  org.apache.catalina.ant.jmx.JMXAccessorSetTask,  org.apache.catalina.ant.jmx.JMXAccessorInvokeTask,  org.apache.catalina.ant.jmx.JMXAccessorQueryTask,
JMXAccessorTask
public class JMXAccessorTask extends BaseRedirectorHelperTask (Code)
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. With if the task is only execute when property exist and with unless when property not exists.
NOTE : These tasks require Ant 1.6 or later interface.
author:
   Peter Rossbach
version:
   $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
since:
   5.5.10


Field Summary
public static  StringJMX_SERVICE_PREFIX
    
public static  StringJMX_SERVICE_SUFFIX
    


Method Summary
public static  MBeanServerConnectionaccessJMXConnection(Project project, String url, String host, String port, String username, String password, String refId)
    
protected  ObjectconvertStringToType(String value, String valueType)
    
public static  MBeanServerConnectioncreateJMXConnection(String url, String host, String port, String username, String password)
     create a new JMX Connection with auth when username and password is set.
protected  voidcreateProperty(Object result)
    
protected  voidcreateProperty(String propertyPrefix, Object result)
     create result as property with name from property prefix When result is an array and isSeparateArrayResults is true, resultproperty used as prefix (resultproperty.0-array.length and store the result array length at resultproperty.length.
protected  voidechoResult(String name, Object result)
    
public  voidexecute()
     Execute the specified command.
public  StringgetDelimiter()
    
public  StringgetHost()
     The Host of the JMX JSR 160 MBeanServer to be used.
public  StringgetIf()
    
public  StringgetInfo()
     Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version>.
protected  MBeanServerConnectiongetJMXConnection()
    
public  StringgetName()
    
public  StringgetPassword()
     The login password for the Manager application.
public  StringgetPort()
     The Port of the JMX JSR 160 MBeanServer to be used.
public  MapgetProperties()
    
public  StringgetProperty(String property)
    
public  StringgetRef()
    
public  StringgetResultproperty()
    
public  StringgetUnless()
    
public  StringgetUrl()
     The URL of the JMX JSR 160 MBeanServer to be used.
public  StringgetUsername()
     The login username for the JMX MBeanServer.
public  booleanisEcho()
    
public  booleanisSeparatearrayresults()
    
public  booleanisUseRef()
    
public  StringjmxExecute(MBeanServerConnection jmxServerConnection)
     Execute the specified command, based on the configured properties.
public  voidsetDelimiter(String separator)
    
public  voidsetEcho(boolean echo)
    
public  voidsetHost(String host)
    
public  voidsetIf(String c)
     Only execute if a property of the given name exists in the current project.
public  voidsetName(String objectName)
    
public  voidsetPassword(String password)
    
public  voidsetPort(String port)
    
public  booleansetProperty(String property, Object value)
    
public  voidsetRef(String refId)
    
public  voidsetResultproperty(String propertyName)
    
public  voidsetSeparatearrayresults(boolean separateArrayResults)
    
public  voidsetUnless(String c)
     Only execute if a property of the given name does not exist in the current project.
public  voidsetUrl(String url)
    
public  voidsetUsername(String username)
    
protected  booleantestIfCondition()
    
protected  booleantestUnlessCondition()
    

Field Detail
JMX_SERVICE_PREFIX
public static String JMX_SERVICE_PREFIX(Code)



JMX_SERVICE_SUFFIX
public static String JMX_SERVICE_SUFFIX(Code)





Method Detail
accessJMXConnection
public static MBeanServerConnection accessJMXConnection(Project project, String url, String host, String port, String username, String password, String refId) throws MalformedURLException, IOException(Code)
Get Current Connection from ref parameter or create a new one! The server connection
throws:
  MalformedURLException -
throws:
  IOException -



convertStringToType
protected Object convertStringToType(String value, String valueType)(Code)
Convert string to datatype FIXME How we can transfer values from ant project reference store (ref)?
Parameters:
  value - The value
Parameters:
  valueType - The type The converted object



createJMXConnection
public static MBeanServerConnection createJMXConnection(String url, String host, String port, String username, String password) throws MalformedURLException, IOException(Code)
create a new JMX Connection with auth when username and password is set.



createProperty
protected void createProperty(Object result)(Code)
create result as property with name from attribute resultproperty
Parameters:
  result - The result
See Also:   JMXAccessorTask.createProperty(String,Object)



createProperty
protected void createProperty(String propertyPrefix, Object result)(Code)
create result as property with name from property prefix When result is an array and isSeparateArrayResults is true, resultproperty used as prefix (resultproperty.0-array.length and store the result array length at resultproperty.length. Other option is that you delemit your result with a delimiter (java.util.StringTokenizer is used).
Parameters:
  propertyPrefix -
Parameters:
  result -



echoResult
protected void echoResult(String name, Object result)(Code)

Parameters:
  name - context of result
Parameters:
  result -



execute
public void execute() throws BuildException(Code)
Execute the specified command. This logic only performs the common attribute validation required by all subclasses; it does not perform any functional logic directly.
exception:
  BuildException - if a validation error occurs



getDelimiter
public String getDelimiter()(Code)
Returns the delimiter.



getHost
public String getHost()(Code)
The Host of the JMX JSR 160 MBeanServer to be used.



getIf
public String getIf()(Code)
Returns the ifCondition.



getInfo
public String getInfo()(Code)
Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version>.



getJMXConnection
protected MBeanServerConnection getJMXConnection() throws MalformedURLException, IOException(Code)
get JMXConnection The connection
throws:
  MalformedURLException -
throws:
  IOException -



getName
public String getName()(Code)
The name used at remote MbeanServer



getPassword
public String getPassword()(Code)
The login password for the Manager application.



getPort
public String getPort()(Code)
The Port of the JMX JSR 160 MBeanServer to be used.



getProperties
public Map getProperties()(Code)
get all properties, when project is there got all project Properties properties



getProperty
public String getProperty(String property)(Code)
get all Properties
Parameters:
  property - The property



getRef
public String getRef()(Code)
Returns the ref.



getResultproperty
public String getResultproperty()(Code)
Returns the resultproperty.



getUnless
public String getUnless()(Code)
Returns the unlessCondition.



getUrl
public String getUrl()(Code)
The URL of the JMX JSR 160 MBeanServer to be used.



getUsername
public String getUsername()(Code)
The login username for the JMX MBeanServer.



isEcho
public boolean isEcho()(Code)
Returns the echo.



isSeparatearrayresults
public boolean isSeparatearrayresults()(Code)
Returns the separatearrayresults.



isUseRef
public boolean isUseRef()(Code)
Returns the useRef.



jmxExecute
public String jmxExecute(MBeanServerConnection jmxServerConnection) throws Exception(Code)
Execute the specified command, based on the configured properties. The input stream will be closed upon completion of this task, whether it was executed successfully or not.
exception:
  Exception - if an error occurs



setDelimiter
public void setDelimiter(String separator)(Code)

Parameters:
  separator - The delimiter to set.



setEcho
public void setEcho(boolean echo)(Code)

Parameters:
  echo - The echo to set.



setHost
public void setHost(String host)(Code)



setIf
public void setIf(String c)(Code)
Only execute if a property of the given name exists in the current project.
Parameters:
  c - property name



setName
public void setName(String objectName)(Code)



setPassword
public void setPassword(String password)(Code)



setPort
public void setPort(String port)(Code)



setProperty
public boolean setProperty(String property, Object value)(Code)

Parameters:
  property - The property
Parameters:
  value - The value True if successful



setRef
public void setRef(String refId)(Code)

Parameters:
  refId - The ref to set.



setResultproperty
public void setResultproperty(String propertyName)(Code)

Parameters:
  propertyName - The resultproperty to set.



setSeparatearrayresults
public void setSeparatearrayresults(boolean separateArrayResults)(Code)

Parameters:
  separateArrayResults - The separatearrayresults to set.



setUnless
public void setUnless(String c)(Code)
Only execute if a property of the given name does not exist in the current project.
Parameters:
  c - property name



setUrl
public void setUrl(String url)(Code)



setUsername
public void setUsername(String username)(Code)



testIfCondition
protected boolean testIfCondition()(Code)
test the if condition true if there is no if condition, or the named property exists



testUnlessCondition
protected boolean testUnlessCondition()(Code)
test the unless condition true if there is no unless condition, or there is a namedproperty but it doesn't exist



Fields inherited from org.apache.catalina.ant.BaseRedirectorHelperTask
protected boolean alwaysLog(Code)(Java Doc)
protected boolean failOnError(Code)(Java Doc)
protected OutputStream redirectErrStream(Code)(Java Doc)
protected OutputStream redirectOutStream(Code)(Java Doc)
protected boolean redirectOutput(Code)(Java Doc)
protected Redirector redirector(Code)(Java Doc)
protected boolean redirectorConfigured(Code)(Java Doc)
protected RedirectorElement redirectorElement(Code)(Java Doc)

Methods inherited from org.apache.catalina.ant.BaseRedirectorHelperTask
public void addConfiguredRedirector(RedirectorElement redirectorElement)(Code)(Java Doc)
protected void closeRedirector()(Code)(Java Doc)
protected void handleErrorFlush(String output)(Code)(Java Doc)
protected void handleErrorOutput(String output)(Code)(Java Doc)
protected void handleFlush(String output)(Code)(Java Doc)
protected void handleFlush(String output, int priority)(Code)(Java Doc)
protected void handleOutput(String output)(Code)(Java Doc)
protected void handleOutput(String output, int priority)(Code)(Java Doc)
public boolean isFailOnError()(Code)(Java Doc)
protected void openRedirector()(Code)(Java Doc)
public void setAlwaysLog(boolean alwaysLog)(Code)(Java Doc)
public void setAppend(boolean append)(Code)(Java Doc)
public void setCreateEmptyFiles(boolean createEmptyFiles)(Code)(Java Doc)
public void setError(File error)(Code)(Java Doc)
public void setErrorProperty(String errorProperty)(Code)(Java Doc)
public void setFailonerror(boolean fail)(Code)(Java Doc)
public void setLogError(boolean logError)(Code)(Java Doc)
public void setOutput(File out)(Code)(Java Doc)
public void setOutputproperty(String outputProperty)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.