Java Doc for JbiJmxTask.java in  » ESB » open-esb » com » sun » jbi » ui » ant » 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 » ESB » open esb » com.sun.jbi.ui.ant 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.jbi.ui.ant.JbiJmxTask

All known Subclasses:   com.sun.jbi.ui.ant.JbiUpgradeComponentTask,  com.sun.jbi.ui.ant.JbiTargetTask,
JbiJmxTask
abstract public class JbiJmxTask extends Task (Code)
This class is the base class for all the jbi admin tasks that uses JBIAdminCommands interface implementation to execute the jbi admin tasks. This class has a set of common properties for all the jbi admin tasks. These common properties are related to jmx connection informaton ( host, port, username, passwrod ) This class also has helper methods to format the display message and handling the errors and the management status message.
author:
   Sun Microsystems, Inc.


Field Summary
final public static  StringDEF_HOST_PROP
    
final public static  StringDEF_JMX_PROPERTIES_FILE
    
final public static  StringDEF_PASSWORD_PROP
    
final public static  StringDEF_PORT_PROP
    
final public static  StringDEF_URL_PROP
    
final public static  StringDEF_USERNAME_PROP
    


Method Summary
protected  StringcreateFailedFormattedJbiAdminResult(String i18nKey, Object[] args)
     converts the i18n error message to the jbi result display format.
public  voidexecute()
     executes the ant task.
abstract protected  voidexecuteTask()
     this is where the task exection code gets implemented.
protected  JBIManagementMessageextractJBIManagementMessage(Exception ex)
    
protected  StringformatTaskFailedMessage(String causeMsg)
    
protected  StringformatTaskSuccessMessage()
    
protected  StringformatTaskSuccessMessage(String causeMsg)
    
public  StringgetDefaultHost()
     Getter for Default host.
public  StringgetDefaultJmxpropertiesfile()
     Default Getter for properties file.
public  StringgetDefaultPassword()
     Getter for Default Password.
public  StringgetDefaultPort()
     Getter for property port.
public  StringgetHost()
     Getter for property host.
protected  I18NBundlegetI18NBundle()
     gives the I18N bundle for ant tasks extended tasks override this if they want to provide different i18n bundle for their messages.
protected  JBIAdminCommandsgetJBIAdminCommands()
    
protected  PropertiesgetJmxConnectionProperties()
    
public  StringgetJmxpropertiesfile()
    
public  StringgetPassword()
     Getter for property Password.
protected  StringgetPasswordFromFile(File pwFile)
    
protected  StringgetPasswordFromFileOrAttribute()
     check if the password file is set.
public  FilegetPasswordfile()
     Getter for property passwordFile.
public  StringgetPort()
     Getter for property port.
public  PropertiesgetProviderProperties()
     Returns the properties from the file.
public  BooleangetSecure()
     Getter for property Secure.
abstract protected  StringgetTaskFailedStatusI18NKey()
    
protected  StringgetTaskPartialSuccessStatusI18NKey()
     returns i18n key.
abstract protected  StringgetTaskSuccessStatusI18NKey()
     returns i18n key.
protected  StringgetTaskWarningStatusI18NKey()
     returns i18n key.
public  StringgetUsername()
     Getter for property Username.
protected  StringgetValidComponentName(String compName)
    
protected  StringgetValidName(String name, String errorMsgI18nKey)
    
protected  StringgetValidServiceAssemblyName(String saName)
    
protected  StringgetValidSharedLibraryName(String slibName)
    
public  booleanisFailOnError()
     Getter for property failOnError.
protected  voidlogDebug(String aDebugMsg)
    
protected  voidlogDebugConnectionAttributes()
    
protected  voidlogError(String aErrorMsg)
    
protected  voidlogInfo(String anInfoMsg)
    
protected  voidlogVerbose(String aVerboseMsg)
    
protected  voidlogWarning(String aWarningMsg)
    
protected  voidprintArrayDataRecursively(Object[] arrayData, OpenType elementType, PrintWriter msgWriter, String tabStr)
    
protected  voidprintCompositeDataRecursively(CompositeData compositeData, PrintWriter msgWriter, String tabStr)
    
protected  voidprintMessage(String aMsg)
    
protected  voidprintTabularData(TabularData statsReport, PrintWriter msgWriter, String tabStr)
    
protected  voidprintTaskPartialSuccess(String result)
    
protected  voidprintTaskSuccess(String result)
    
protected  voidprintTaskSuccess(JBIManagementMessage mgmtMsg)
    
protected  voidprocessTaskException(Exception ex)
     here we check for the management message in the exception and process it for the error, warning or success information.
protected  voidprocessTaskResult(String result)
     processes the result string as a management message for for the error, warning or success information.
public  voidsetFailOnError(boolean failOnError)
     Setter for property failOnError.
public  voidsetHost(String aHost)
     Setter for property host.
public  voidsetJmxpropertiesfile(String propertiesfile)
     Setter for properties file.
public  voidsetPassword(String aPassword)
     Setter for property Password.
public  voidsetPasswordfile(File passwordFile)
     Setter for property passwordFile.
public  voidsetPort(String aPort)
     Setter for property port.
public  voidsetSecure(Boolean secure)
     Setter for property Secure.
public  voidsetUsername(String aUsername)
     Setter for property Username.
protected  voidthrowBuildException(String causeMsg)
    
protected  voidthrowBuildException(Throwable aCause)
    
protected  voidthrowBuildException(JBIManagementMessage aCauseMgmtMsg)
    
protected  voidthrowTaskBuildException(String aCauseKey)
    
protected  voidthrowTaskBuildException(String aCauseKey, String aCauseArg1)
    
protected  voidvalidateJmxConnectionPortValue(String port)
    

Field Detail
DEF_HOST_PROP
final public static String DEF_HOST_PROP(Code)
default ant prop



DEF_JMX_PROPERTIES_FILE
final public static String DEF_JMX_PROPERTIES_FILE(Code)
default ant prop*



DEF_PASSWORD_PROP
final public static String DEF_PASSWORD_PROP(Code)
default ant prop



DEF_PORT_PROP
final public static String DEF_PORT_PROP(Code)
default ant prop



DEF_URL_PROP
final public static String DEF_URL_PROP(Code)
default ant prop



DEF_USERNAME_PROP
final public static String DEF_USERNAME_PROP(Code)
default ant prop





Method Detail
createFailedFormattedJbiAdminResult
protected String createFailedFormattedJbiAdminResult(String i18nKey, Object[] args)(Code)
converts the i18n error message to the jbi result display format.
Parameters:
  i18nKey - String represneting i18n key
Parameters:
  args - arguments to the i18n string the string in the jbi result display format of jbi mgmt message.



execute
public void execute() throws BuildException(Code)
executes the ant task. Ant Task framework calls this method to excute the task. this method intern calls the executeTask where the task execution code gets implemented. This methods processes the failOnError before throwing back the BuildException to the ant environment. If the failOnError is false, it just prints the exception message and returns otherwise it rethrows the build exception.
throws:
  BuildException - if error or exception occurs.



executeTask
abstract protected void executeTask() throws BuildException(Code)
this is where the task exection code gets implemented. this will be called from execute method that preprocesses the build exception before throwing it to ant runtime to process.
throws:
  org.apache.tools.ant.BuildException - on error



extractJBIManagementMessage
protected JBIManagementMessage extractJBIManagementMessage(Exception ex)(Code)
retrieves the exception message and try to construct the jbi mgmt message
Parameters:
  ex - Exception from which the message should be constructed JBIManagementMessage object if the excpetion contains the xml text else return null.



formatTaskFailedMessage
protected String formatTaskFailedMessage(String causeMsg)(Code)
returns formatted failed message
Parameters:
  causeMsg - cause message text formatted message



formatTaskSuccessMessage
protected String formatTaskSuccessMessage()(Code)
task success message formated message



formatTaskSuccessMessage
protected String formatTaskSuccessMessage(String causeMsg)(Code)
returns formatted success message
Parameters:
  causeMsg - cause message formated message



getDefaultHost
public String getDefaultHost()(Code)
Getter for Default host. Value of Default host.



getDefaultJmxpropertiesfile
public String getDefaultJmxpropertiesfile()(Code)
Default Getter for properties file. default properties file name.



getDefaultPassword
public String getDefaultPassword()(Code)
Getter for Default Password. Value of Default Password.



getDefaultPort
public String getDefaultPort()(Code)
Getter for property port. Value of property port.



getHost
public String getHost()(Code)
Getter for property host. Value of property host.



getI18NBundle
protected I18NBundle getI18NBundle()(Code)
gives the I18N bundle for ant tasks extended tasks override this if they want to provide different i18n bundle for their messages. I18NBundle object



getJBIAdminCommands
protected JBIAdminCommands getJBIAdminCommands() throws Exception(Code)
returns JBIAdminCommands implementation JBIAdminCommands interface
throws:
  JMXConnectionException - on error



getJmxConnectionProperties
protected Properties getJmxConnectionProperties()(Code)
returns properties object contain the name/value pairs for jmx connection properties Properties object



getJmxpropertiesfile
public String getJmxpropertiesfile()(Code)
Getter for properties file properties file name



getPassword
public String getPassword()(Code)
Getter for property Password. Value of property Password.



getPasswordFromFile
protected String getPasswordFromFile(File pwFile) throws IOException(Code)
reads the password from the file according to the platform password file definition
Parameters:
  pwFile - path to the password file Value of the password from file



getPasswordFromFileOrAttribute
protected String getPasswordFromFileOrAttribute() throws IOException(Code)
check if the password file is set. If set get the password from the password file, else get the password from the task attribute "password". Value of the password



getPasswordfile
public File getPasswordfile()(Code)
Getter for property passwordFile. Value of property passwordFile.



getPort
public String getPort()(Code)
Getter for property port. Value of property port.



getProviderProperties
public Properties getProviderProperties()(Code)
Returns the properties from the file. properties



getSecure
public Boolean getSecure()(Code)
Getter for property Secure. Value true if Secure else false.



getTaskFailedStatusI18NKey
abstract protected String getTaskFailedStatusI18NKey()(Code)



getTaskPartialSuccessStatusI18NKey
protected String getTaskPartialSuccessStatusI18NKey()(Code)
returns i18n key. tasks implement this method to return the i18n key. default implementation returns null indicating that the task does not have partial success status message. If the tasks such as service assembly tasks have to display main partial success message, they have to override and return the i18n key that is in the i18n bundle. use of this method should check for null return and then fall back to the getTaskSuccessStatusI18NKey for the main status message for partial success. i18n key for the partial success



getTaskSuccessStatusI18NKey
abstract protected String getTaskSuccessStatusI18NKey()(Code)
returns i18n key. tasks implement this method. i18n key for the success status



getTaskWarningStatusI18NKey
protected String getTaskWarningStatusI18NKey()(Code)
returns i18n key. tasks implement this method. i18n key for the warning status



getUsername
public String getUsername()(Code)
Getter for property Username. Value of property Username.



getValidComponentName
protected String getValidComponentName(String compName) throws BuildException(Code)
return the trimed component name or throws build exception
Parameters:
  compName - component name string as passed to the attribute trimed component name
throws:
  BuildException - if the compName is null or empty



getValidName
protected String getValidName(String name, String errorMsgI18nKey) throws BuildException(Code)
return the trimed component name or throws build exception
Parameters:
  name - component name string as passed to the attribute trimed component name
throws:
  BuildException - if the compName is null or empty



getValidServiceAssemblyName
protected String getValidServiceAssemblyName(String saName) throws BuildException(Code)
return the trimed component name or throws build exception
Parameters:
  saName - service assembly name string as passed to the attribute trimed component name
throws:
  BuildException - if the compName is null or empty



getValidSharedLibraryName
protected String getValidSharedLibraryName(String slibName) throws BuildException(Code)
return the trimed component name or throws build exception
Parameters:
  slibName - shared library name string as passed to the attribute trimed component name
throws:
  BuildException - if the compName is null or empty



isFailOnError
public boolean isFailOnError()(Code)
Getter for property failOnError. Value true if failOnError else false.



logDebug
protected void logDebug(String aDebugMsg)(Code)
logs as a DEBUG
Parameters:
  aDebugMsg - Message



logDebugConnectionAttributes
protected void logDebugConnectionAttributes()(Code)



logError
protected void logError(String aErrorMsg)(Code)
logs as a ERROR
Parameters:
  aErrorMsg - Message



logInfo
protected void logInfo(String anInfoMsg)(Code)
logs as a INFO
Parameters:
  anInfoMsg - Message



logVerbose
protected void logVerbose(String aVerboseMsg)(Code)
logs as a VERBOSE
Parameters:
  aVerboseMsg - Message



logWarning
protected void logWarning(String aWarningMsg)(Code)
logs as a WARNING
Parameters:
  aWarningMsg - Message



printArrayDataRecursively
protected void printArrayDataRecursively(Object[] arrayData, OpenType elementType, PrintWriter msgWriter, String tabStr)(Code)

Parameters:
  arrayData -
Parameters:
  elementType -
Parameters:
  msgWriter -



printCompositeDataRecursively
protected void printCompositeDataRecursively(CompositeData compositeData, PrintWriter msgWriter, String tabStr)(Code)

Parameters:
  compositeData -
Parameters:
  msgWriter -



printMessage
protected void printMessage(String aMsg)(Code)
print message
Parameters:
  aMsg - a message string



printTabularData
protected void printTabularData(TabularData statsReport, PrintWriter msgWriter, String tabStr)(Code)
parse and print the tabular data



printTaskPartialSuccess
protected void printTaskPartialSuccess(String result)(Code)
prints result
Parameters:
  result - string to print



printTaskSuccess
protected void printTaskSuccess(String result)(Code)
prints result
Parameters:
  result - string to print



printTaskSuccess
protected void printTaskSuccess(JBIManagementMessage mgmtMsg)(Code)
prints result
Parameters:
  mgmtMsg - message object



processTaskException
protected void processTaskException(Exception ex) throws BuildException(Code)
here we check for the management message in the exception and process it for the error, warning or success information. If it is error throw the build exception, for all other cases print exception results with warnings
Parameters:
  ex - Exception from the task execution
throws:
  BuildException - if the exception status is error



processTaskResult
protected void processTaskResult(String result) throws BuildException(Code)
processes the result string as a management message for for the error, warning or success information. If it is error throw the build exception, for all other cases print success results with warnings
Parameters:
  result - results text
throws:
  BuildException - if the exception status is error



setFailOnError
public void setFailOnError(boolean failOnError)(Code)
Setter for property failOnError.
Parameters:
  failOnError - New value of property failOnError.



setHost
public void setHost(String aHost)(Code)
Setter for property host.
Parameters:
  aHost - New value of property host.



setJmxpropertiesfile
public void setJmxpropertiesfile(String propertiesfile)(Code)
Setter for properties file.
Parameters:
  propertiesfile - name of the properties file



setPassword
public void setPassword(String aPassword)(Code)
Setter for property Password.
Parameters:
  aPassword - password



setPasswordfile
public void setPasswordfile(File passwordFile)(Code)
Setter for property passwordFile.
Parameters:
  passwordFile - New value of property passwordFile.



setPort
public void setPort(String aPort)(Code)
Setter for property port.
Parameters:
  aPort - New value of property port.



setSecure
public void setSecure(Boolean secure)(Code)
Setter for property Secure.
Parameters:
  secure - New value of property Secure.



setUsername
public void setUsername(String aUsername)(Code)
Setter for property Username.
Parameters:
  aUsername - user name



throwBuildException
protected void throwBuildException(String causeMsg) throws BuildException(Code)
throws BuildException
Parameters:
  causeMsg - cuased message text
throws:
  BuildException - with cause



throwBuildException
protected void throwBuildException(Throwable aCause) throws BuildException(Code)
throws BuildException
Parameters:
  aCause - a exception to embed
throws:
  BuildException - with cause



throwBuildException
protected void throwBuildException(JBIManagementMessage aCauseMgmtMsg) throws BuildException(Code)
throws exception
Parameters:
  aCauseMgmtMsg - message object
throws:
  BuildException - on error



throwTaskBuildException
protected void throwTaskBuildException(String aCauseKey) throws BuildException(Code)
throws exception
Parameters:
  aCauseKey - i18n key of the cause
throws:
  BuildException - build exception



throwTaskBuildException
protected void throwTaskBuildException(String aCauseKey, String aCauseArg1) throws BuildException(Code)
throws exception
Parameters:
  aCauseKey - i18n key of the cause
Parameters:
  aCauseArg1 - root cuase
throws:
  BuildException - build exception



validateJmxConnectionPortValue
protected void validateJmxConnectionPortValue(String port) throws JMXConnectionException(Code)
validate
Parameters:
  port - port
throws:
  JMXConnectionException - on error



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