ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/catalina/ant/jmx/JMXAccessorEqualsCondition.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/catalina/ant/jmx/JMXAccessorEqualsCondition.java
Status
scanned
Type
file
Name
JMXAccessorEqualsCondition.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2915 (2.8 KB)
MD5
7dc26fcdf1a18e90657f01e26ce290d1
SHA1
17a93a59248a825a29ae170a19878240edc0dd34
SHA256
b3965dbebca2f26bc197c5fa10984944ddcf785b6d5acd67e3c4f5f66664dd36
SHA512

      
    
SHA1_git
74f6ce532a8448b4b83bcba6a208f3858acd4f14
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
JMXAccessorEqualsCondition.java | 2.8 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.catalina.ant.jmx; import org.apache.tools.ant.BuildException; /** * Definition * * <pre> * &lt;path id="catalina_ant"&gt; * &lt;fileset dir="${catalina.home}/server/lib"&gt; * &lt;include name="catalina-ant.jar"/&gt; * &lt;/fileset&gt; * &lt;/path&gt; * * &lt;typedef * name="jmxEquals" * classname="org.apache.catalina.ant.jmx.JMXAccessorEqualsCondition" * classpathref="catalina_ant"/&gt; * </pre> * * usage: Wait for start backup node * * <pre> * &lt;target name="wait"&gt; * &lt;waitfor maxwait="${maxwait}" maxwaitunit="second" timeoutproperty="server.timeout" &gt; * &lt;and&gt; * &lt;socket server="${server.name}" port="${server.port}"/&gt; * &lt;http url="${url}"/&gt; * &lt;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" * /&gt; * &lt;/and&gt; * &lt;/waitfor&gt; * &lt;fail if="server.timeout" message="Server ${url} don't answer inside ${maxwait} sec" /&gt; * &lt;echo message="Server ${url} alive" /&gt; * &lt;/target&gt; * </pre> * * @since 5.5.10 */ public class JMXAccessorEqualsCondition extends JMXAccessorConditionBase { @Override public boolean eval() { String value = getValue(); if (value == null) { throw new BuildException("value attribute is not set"); } if (getName() == null || getAttribute() == null) { throw new BuildException("Must specify an MBean name and attribute for equals condition"); } // FIXME check url or host/parameter String jmxValue = accessJMXValue(); if (jmxValue != null) { return jmxValue.equals(value); } return false; } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
39.93
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9