Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx JMXAccessorCondition.java JMXAccessorTask.java
Thank-you for your e-mail. Please note that i will be away from the office starting Wednesday June 29th, returning Thursday July 7th, with no access to email. In my absence, kindly contact Cheri Dueck at [EMAIL PROTECTED] Kind Regards, Natasha Hasmani Senior Event Manager - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx JMXAccessorCondition.java JMXAccessorTask.java
Thank-you for your e-mail. Please note that i will be away from the office starting Wednesday June 29th, returning Thursday July 7th, with no access to email. In my absence, kindly contact Cheri Dueck at [EMAIL PROTECTED] Kind Regards, Natasha Hasmani Senior Event Manager - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx JMXAccessorCondition.java JMXAccessorTask.java
Thank-you for your e-mail. Please note that i will be away from the office starting Wednesday June 29th, returning Thursday July 7th, with no access to email. In my absence, kindly contact Cheri Dueck at [EMAIL PROTECTED] Kind Regards, Natasha Hasmani Senior Event Manager - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx JMXAccessorCondition.java JMXAccessorTask.java
pero2005/07/01 04:46:51 Modified:catalina/src/share/org/apache/catalina/ant/jmx JMXAccessorCondition.java JMXAccessorTask.java Log: Add if and unless Fix docs Revision ChangesPath 1.2 +103 -37 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx/JMXAccessorCondition.java Index: JMXAccessorCondition.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx/JMXAccessorCondition.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JMXAccessorCondition.java 30 Jun 2005 13:01:27 - 1.1 +++ JMXAccessorCondition.java 1 Jul 2005 11:46:51 - 1.2 @@ -88,7 +88,9 @@ private String operation = == ; private String type = long ; private String ref = jmx.server; - +private String unlessCondition; +private String ifCondition; + // - Instance Info /** @@ -240,7 +242,41 @@ public void setRef(String refId) { this.ref = refId; } - +/** + * @return Returns the ifCondition. + */ +public String getIf() { +return ifCondition; +} +/** + * Only fail if a property of the given name exists in the current project. + * @param c property name + */ +public void setIf(String c) { +ifCondition = c; +} + /** + * @return Returns the unlessCondition. + */ +public String getUnless() { +return unlessCondition; +} + +/** + * Only fail if a property of the given name does not + * exist in the current project. + * @param c property name + */ +public void setUnless(String c) { +unlessCondition = c; +} + +/** + * Get JMXConnection (default look at emjmx.server/em project reference from jmxOpen Task) + * @return active JMXConnection + * @throws MalformedURLException + * @throws IOException + */ protected MBeanServerConnection getJMXConnection() throws MalformedURLException, IOException { return JMXAccessorTask.accessJMXConnection( @@ -250,6 +286,7 @@ } /** + * Get value from MBeans attribute * @return */ protected String accessJMXValue() { @@ -264,7 +301,34 @@ return null; } -// This method evaluates the condition +/** + * test the if condition + * @return true if there is no if condition, or the named property exists + */ +protected boolean testIfCondition() { +if (ifCondition == null || .equals(ifCondition)) { +return true; +} +return getProject().getProperty(ifCondition) != null; +} + +/** + * test the unless condition + * @return true if there is no unless condition, + * or there is a named property but it doesn't exist + */ +protected boolean testUnlessCondition() { +if (unlessCondition == null || .equals(unlessCondition)) { +return true; +} +return getProject().getProperty(unlessCondition) == null; +} + +/** + * This method evaluates the condition + * It support for operation ,=,,= the types codelong/code and codedouble/code. + * @return expression emjmxValue/em emoperation/em emvalue/em + */ public boolean eval() { if (operation == null) { throw new BuildException(operation attribute is not set); @@ -276,43 +340,45 @@ throw new BuildException( Must specify a 'attribute', name for equals condition); } -//FIXME check url or host/parameter -String jmxValue = accessJMXValue(); -String op = getOperation() ; -if(jmxValue != null) { -if(==.equals(op)) { -return jmxValue.equals(value); -} else if(!=.equals(op)) { -return !jmxValue.equals(value); -} else { -if(long.equals(type)) { -long jvalue = Long.parseLong(jmxValue); -long lvalue = Long.parseLong(value); -if(.equals(op)) { -return jvalue lvalue ; -} else if(=.equals(op)) { -return jvalue = lvalue ; -} else if(.equals(op)) { -return jvalue lvalue ; -} else if (=.equals(op)) { -return jvalue = lvalue; -} -
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx JMXAccessorCondition.java JMXAccessorTask.java
pero2005/07/01 11:54:14 Modified:catalina/src/share/org/apache/catalina/ant/jmx JMXAccessorCondition.java JMXAccessorTask.java Log: Fix doc Revision ChangesPath 1.3 +3 -3 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx/JMXAccessorCondition.java Index: JMXAccessorCondition.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx/JMXAccessorCondition.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JMXAccessorCondition.java 1 Jul 2005 11:46:51 - 1.2 +++ JMXAccessorCondition.java 1 Jul 2005 18:54:13 - 1.3 @@ -249,7 +249,7 @@ return ifCondition; } /** - * Only fail if a property of the given name exists in the current project. + * Only execute if a property of the given name exists in the current project. * @param c property name */ public void setIf(String c) { @@ -263,7 +263,7 @@ } /** - * Only fail if a property of the given name does not + * Only execute if a property of the given name does not * exist in the current project. * @param c property name */ 1.4 +3 -3 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx/JMXAccessorTask.java Index: JMXAccessorTask.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/jmx/JMXAccessorTask.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JMXAccessorTask.java 1 Jul 2005 11:46:51 - 1.3 +++ JMXAccessorTask.java 1 Jul 2005 18:54:13 - 1.4 @@ -273,7 +273,7 @@ return ifCondition; } /** - * Only fail if a property of the given name exists in the current project. + * Only execute if a property of the given name exists in the current project. * @param c property name */ public void setIf(String c) { @@ -287,7 +287,7 @@ } /** - * Only fail if a property of the given name does not + * Only execute if a property of the given name does not * exist in the current project. * @param c property name */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]