SF.net SVN: mx4j: [2247] trunk/mx4j
[email protected] Thu, 23 Nov 2006 14:06:20 -0800
| Newsgroups | gmane.comp.java.mx4j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 2247
http://svn.sourceforge.net/mx4j/?rev=2247&view=rev
Author: simonebordet
Date: 2006-11-23 14:06:19 -0800 (Thu, 23 Nov 2006)
Log Message:
-----------
Moved sources from the Ant structure to the Maven2 structure.
Added Paths:
-----------
trunk/mx4j/jsr003/
trunk/mx4j/jsr003/pom.xml
trunk/mx4j/jsr003/src/
trunk/mx4j/jsr003/src/main/
trunk/mx4j/jsr003/src/main/java/
trunk/mx4j/jsr003/src/main/java/javax/
trunk/mx4j/jsr003/src/main/java/javax/management/
trunk/mx4j/jsr003/src/main/java/javax/management/AndQueryExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/Attribute.java
trunk/mx4j/jsr003/src/main/java/javax/management/AttributeChangeNotification.java
trunk/mx4j/jsr003/src/main/java/javax/management/AttributeChangeNotificationFilter.java
trunk/mx4j/jsr003/src/main/java/javax/management/AttributeList.java
trunk/mx4j/jsr003/src/main/java/javax/management/AttributeNotFoundException.java
trunk/mx4j/jsr003/src/main/java/javax/management/AttributeValueExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/BadAttributeValueExpException.java
trunk/mx4j/jsr003/src/main/java/javax/management/BadBinaryOpValueExpException.java
trunk/mx4j/jsr003/src/main/java/javax/management/BadStringOperationException.java
trunk/mx4j/jsr003/src/main/java/javax/management/BetweenQueryExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/BinaryOpValueExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/BinaryRelQueryExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/BooleanValueExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/ClassAttributeValueExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/DefaultLoaderRepository.java
trunk/mx4j/jsr003/src/main/java/javax/management/Descriptor.java
trunk/mx4j/jsr003/src/main/java/javax/management/DescriptorAccess.java
trunk/mx4j/jsr003/src/main/java/javax/management/DynamicMBean.java
trunk/mx4j/jsr003/src/main/java/javax/management/InQueryExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/InstanceAlreadyExistsException.java
trunk/mx4j/jsr003/src/main/java/javax/management/InstanceNotFoundException.java
trunk/mx4j/jsr003/src/main/java/javax/management/IntrospectionException.java
trunk/mx4j/jsr003/src/main/java/javax/management/InvalidApplicationException.java
trunk/mx4j/jsr003/src/main/java/javax/management/InvalidAttributeValueException.java
trunk/mx4j/jsr003/src/main/java/javax/management/JMException.java
trunk/mx4j/jsr003/src/main/java/javax/management/JMRuntimeException.java
trunk/mx4j/jsr003/src/main/java/javax/management/ListenerNotFoundException.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanAttributeInfo.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanConstructorInfo.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanException.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanFeatureInfo.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanInfo.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanNotificationInfo.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanOperationInfo.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanParameterInfo.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanPermission.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanRegistration.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanRegistrationException.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanServer.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanServerBuilder.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanServerConnection.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanServerDelegate.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanServerDelegateMBean.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanServerFactory.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanServerInvocationHandler.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanServerNotification.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanServerPermission.java
trunk/mx4j/jsr003/src/main/java/javax/management/MBeanTrustPermission.java
trunk/mx4j/jsr003/src/main/java/javax/management/MalformedObjectNameException.java
trunk/mx4j/jsr003/src/main/java/javax/management/MatchQueryExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/NotCompliantMBeanException.java
trunk/mx4j/jsr003/src/main/java/javax/management/NotQueryExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/Notification.java
trunk/mx4j/jsr003/src/main/java/javax/management/NotificationBroadcaster.java
trunk/mx4j/jsr003/src/main/java/javax/management/NotificationBroadcasterSupport.java
trunk/mx4j/jsr003/src/main/java/javax/management/NotificationEmitter.java
trunk/mx4j/jsr003/src/main/java/javax/management/NotificationFilter.java
trunk/mx4j/jsr003/src/main/java/javax/management/NotificationFilterSupport.java
trunk/mx4j/jsr003/src/main/java/javax/management/NotificationListener.java
trunk/mx4j/jsr003/src/main/java/javax/management/NumericValueExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/ObjectInstance.java
trunk/mx4j/jsr003/src/main/java/javax/management/ObjectName.java
trunk/mx4j/jsr003/src/main/java/javax/management/OperationsException.java
trunk/mx4j/jsr003/src/main/java/javax/management/OrQueryExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/PersistentMBean.java
trunk/mx4j/jsr003/src/main/java/javax/management/QualifiedAttributeValueExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/Query.java
trunk/mx4j/jsr003/src/main/java/javax/management/QueryEval.java
trunk/mx4j/jsr003/src/main/java/javax/management/QueryExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/ReflectionException.java
trunk/mx4j/jsr003/src/main/java/javax/management/RuntimeErrorException.java
trunk/mx4j/jsr003/src/main/java/javax/management/RuntimeMBeanException.java
trunk/mx4j/jsr003/src/main/java/javax/management/RuntimeOperationsException.java
trunk/mx4j/jsr003/src/main/java/javax/management/ServiceNotFoundException.java
trunk/mx4j/jsr003/src/main/java/javax/management/StandardMBean.java
trunk/mx4j/jsr003/src/main/java/javax/management/StringValueExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/ValueExp.java
trunk/mx4j/jsr003/src/main/java/javax/management/loading/
trunk/mx4j/jsr003/src/main/java/javax/management/modelmbean/
trunk/mx4j/jsr003/src/main/java/javax/management/monitor/
trunk/mx4j/jsr003/src/main/java/javax/management/openmbean/
trunk/mx4j/jsr003/src/main/java/javax/management/relation/
trunk/mx4j/jsr003/src/main/java/javax/management/timer/
trunk/mx4j/jsr003/src/main/java/mx4j/
trunk/mx4j/jsr003/src/main/java/mx4j/AbstractDynamicMBean.java
trunk/mx4j/jsr003/src/main/java/mx4j/ImplementationException.java
trunk/mx4j/jsr003/src/main/java/mx4j/MBeanDescription.java
trunk/mx4j/jsr003/src/main/java/mx4j/MBeanDescriptionAdapter.java
trunk/mx4j/jsr003/src/main/java/mx4j/MX4JSystemKeys.java
trunk/mx4j/jsr003/src/main/java/mx4j/loading/
trunk/mx4j/jsr003/src/main/java/mx4j/log/
trunk/mx4j/jsr003/src/main/java/mx4j/monitor/
trunk/mx4j/jsr003/src/main/java/mx4j/persist/
trunk/mx4j/jsr003/src/main/java/mx4j/server/
trunk/mx4j/jsr003/src/main/java/mx4j/server/BCELMBeanInvoker.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/CachingReflectionMBeanInvoker.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/ChainedMBeanServer.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/ChainedMBeanServerBuilder.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/DefaultClassLoaderRepository.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/DefaultMBeanRepository.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/MBeanIntrospector.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/MBeanInvoker.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/MBeanMetaData.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/MBeanRepository.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/MX4JMBeanMetaData.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/MX4JMBeanServer.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/MX4JMBeanServerBuilder.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/MX4JMBeanServerDelegate.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/ModifiableClassLoaderRepository.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/ReflectionMBeanInvoker.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/ContextClassLoaderMBeanServerInterceptor.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/DefaultMBeanServerInterceptor.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/DefaultMBeanServerInterceptorMBean.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/DefaultMBeanServerInterceptorMBeanDescription.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/InvokerMBeanServerInterceptor.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/InvokerMBeanServerInterceptorMBean.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/InvokerMBeanServerInterceptorMBeanDescription.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/MBeanServerInterceptor.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/MBeanServerInterceptorConfigurator.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/MBeanServerInterceptorConfiguratorMBean.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/MBeanServerInterceptorConfiguratorMBeanDescription.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/NotificationListenerMBeanServerInterceptor.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/SecurityMBeanServerInterceptor.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/SecurityMBeanServerInterceptorMBean.java
trunk/mx4j/jsr003/src/main/java/mx4j/server/interceptor/SecurityMBeanServerInterceptorMBeanDescription.java
trunk/mx4j/jsr003/src/main/java/mx4j/timer/
trunk/mx4j/jsr003/src/main/java/mx4j/util/
trunk/mx4j/jsr160/
trunk/mx4j/jsr160/pom.xml
trunk/mx4j/jsr160/src/
trunk/mx4j/jsr160/src/main/
trunk/mx4j/jsr160/src/main/java/
trunk/mx4j/jsr160/src/main/java/javax/
trunk/mx4j/jsr160/src/main/java/javax/management/
trunk/mx4j/jsr160/src/main/java/javax/management/remote/
trunk/mx4j/jsr160/src/main/java/mx4j/
trunk/mx4j/jsr160/src/main/java/mx4j/remote/
trunk/mx4j/pom.xml
trunk/mx4j/tools/
trunk/mx4j/tools/pom.xml
trunk/mx4j/tools/src/
trunk/mx4j/tools/src/main/
trunk/mx4j/tools/src/main/java/
trunk/mx4j/tools/src/main/java/mx4j/
Removed Paths:
-------------
trunk/mx4j/src/core/javax/management/AndQueryExp.java
trunk/mx4j/src/core/javax/management/Attribute.java
trunk/mx4j/src/core/javax/management/AttributeChangeNotification.java
trunk/mx4j/src/core/javax/management/AttributeChangeNotificationFilter.java
trunk/mx4j/src/core/javax/management/AttributeList.java
trunk/mx4j/src/core/javax/management/AttributeNotFoundException.java
trunk/mx4j/src/core/javax/management/AttributeValueExp.java
trunk/mx4j/src/core/javax/management/BadAttributeValueExpException.java
trunk/mx4j/src/core/javax/management/BadBinaryOpValueExpException.java
trunk/mx4j/src/core/javax/management/BadStringOperationException.java
trunk/mx4j/src/core/javax/management/BetweenQueryExp.java
trunk/mx4j/src/core/javax/management/BinaryOpValueExp.java
trunk/mx4j/src/core/javax/management/BinaryRelQueryExp.java
trunk/mx4j/src/core/javax/management/BooleanValueExp.java
trunk/mx4j/src/core/javax/management/ClassAttributeValueExp.java
trunk/mx4j/src/core/javax/management/DefaultLoaderRepository.java
trunk/mx4j/src/core/javax/management/Descriptor.java
trunk/mx4j/src/core/javax/management/DescriptorAccess.java
trunk/mx4j/src/core/javax/management/DynamicMBean.java
trunk/mx4j/src/core/javax/management/InQueryExp.java
trunk/mx4j/src/core/javax/management/InstanceAlreadyExistsException.java
trunk/mx4j/src/core/javax/management/InstanceNotFoundException.java
trunk/mx4j/src/core/javax/management/IntrospectionException.java
trunk/mx4j/src/core/javax/management/InvalidApplicationException.java
trunk/mx4j/src/core/javax/management/InvalidAttributeValueException.java
trunk/mx4j/src/core/javax/management/JMException.java
trunk/mx4j/src/core/javax/management/JMRuntimeException.java
trunk/mx4j/src/core/javax/management/ListenerNotFoundException.java
trunk/mx4j/src/core/javax/management/MBeanAttributeInfo.java
trunk/mx4j/src/core/javax/management/MBeanConstructorInfo.java
trunk/mx4j/src/core/javax/management/MBeanException.java
trunk/mx4j/src/core/javax/management/MBeanFeatureInfo.java
trunk/mx4j/src/core/javax/management/MBeanInfo.java
trunk/mx4j/src/core/javax/management/MBeanNotificationInfo.java
trunk/mx4j/src/core/javax/management/MBeanOperationInfo.java
trunk/mx4j/src/core/javax/management/MBeanParameterInfo.java
trunk/mx4j/src/core/javax/management/MBeanPermission.java
trunk/mx4j/src/core/javax/management/MBeanRegistration.java
trunk/mx4j/src/core/javax/management/MBeanRegistrationException.java
trunk/mx4j/src/core/javax/management/MBeanServer.java
trunk/mx4j/src/core/javax/management/MBeanServerBuilder.java
trunk/mx4j/src/core/javax/management/MBeanServerConnection.java
trunk/mx4j/src/core/javax/management/MBeanServerDelegate.java
trunk/mx4j/src/core/javax/management/MBeanServerDelegateMBean.java
trunk/mx4j/src/core/javax/management/MBeanServerFactory.java
trunk/mx4j/src/core/javax/management/MBeanServerInvocationHandler.java
trunk/mx4j/src/core/javax/management/MBeanServerNotification.java
trunk/mx4j/src/core/javax/management/MBeanServerPermission.java
trunk/mx4j/src/core/javax/management/MBeanTrustPermission.java
trunk/mx4j/src/core/javax/management/MalformedObjectNameException.java
trunk/mx4j/src/core/javax/management/MatchQueryExp.java
trunk/mx4j/src/core/javax/management/NotCompliantMBeanException.java
trunk/mx4j/src/core/javax/management/NotQueryExp.java
trunk/mx4j/src/core/javax/management/Notification.java
trunk/mx4j/src/core/javax/management/NotificationBroadcaster.java
trunk/mx4j/src/core/javax/management/NotificationBroadcasterSupport.java
trunk/mx4j/src/core/javax/management/NotificationEmitter.java
trunk/mx4j/src/core/javax/management/NotificationFilter.java
trunk/mx4j/src/core/javax/management/NotificationFilterSupport.java
trunk/mx4j/src/core/javax/management/NotificationListener.java
trunk/mx4j/src/core/javax/management/NumericValueExp.java
trunk/mx4j/src/core/javax/management/ObjectInstance.java
trunk/mx4j/src/core/javax/management/ObjectName.java
trunk/mx4j/src/core/javax/management/OperationsException.java
trunk/mx4j/src/core/javax/management/OrQueryExp.java
trunk/mx4j/src/core/javax/management/PersistentMBean.java
trunk/mx4j/src/core/javax/management/QualifiedAttributeValueExp.java
trunk/mx4j/src/core/javax/management/Query.java
trunk/mx4j/src/core/javax/management/QueryEval.java
trunk/mx4j/src/core/javax/management/QueryExp.java
trunk/mx4j/src/core/javax/management/ReflectionException.java
trunk/mx4j/src/core/javax/management/RuntimeErrorException.java
trunk/mx4j/src/core/javax/management/RuntimeMBeanException.java
trunk/mx4j/src/core/javax/management/RuntimeOperationsException.java
trunk/mx4j/src/core/javax/management/ServiceNotFoundException.java
trunk/mx4j/src/core/javax/management/StandardMBean.java
trunk/mx4j/src/core/javax/management/StringValueExp.java
trunk/mx4j/src/core/javax/management/ValueExp.java
trunk/mx4j/src/core/javax/management/loading/
trunk/mx4j/src/core/javax/management/modelmbean/
trunk/mx4j/src/core/javax/management/monitor/
trunk/mx4j/src/core/javax/management/openmbean/
trunk/mx4j/src/core/javax/management/relation/
trunk/mx4j/src/core/javax/management/remote/
trunk/mx4j/src/core/javax/management/timer/
trunk/mx4j/src/core/mx4j/AbstractDynamicMBean.java
trunk/mx4j/src/core/mx4j/ImplementationException.java
trunk/mx4j/src/core/mx4j/MBeanDescription.java
trunk/mx4j/src/core/mx4j/MBeanDescriptionAdapter.java
trunk/mx4j/src/core/mx4j/MX4JSystemKeys.java
trunk/mx4j/src/core/mx4j/loading/
trunk/mx4j/src/core/mx4j/log/
trunk/mx4j/src/core/mx4j/monitor/
trunk/mx4j/src/core/mx4j/persist/
trunk/mx4j/src/core/mx4j/remote/
trunk/mx4j/src/core/mx4j/server/
trunk/mx4j/src/core/mx4j/timer/
trunk/mx4j/src/core/mx4j/util/
trunk/mx4j/src/examples/mx4j/
trunk/mx4j/src/tools/mx4j/
trunk/mx4j/tools/src/main/java/mx4j/tools/
Added: trunk/mx4j/jsr003/pom.xml
===================================================================
--- trunk/mx4j/jsr003/pom.xml (rev 0)
+++ trunk/mx4j/jsr003/pom.xml 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>mx4j</groupId>
+ <artifactId>mx4j</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>mx4j</groupId>
+ <artifactId>mx4j-jsr003</artifactId>
+ <name>MX4J :: JSR003</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.bcel</groupId>
+ <artifactId>bcel</artifactId>
+ <version>5.2</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
Property changes on: trunk/mx4j/jsr003/pom.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/AndQueryExp.java (from rev 2244, trunk/mx4j/src/core/javax/management/AndQueryExp.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/AndQueryExp.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/AndQueryExp.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ * @serial include
+ */
+class AndQueryExp extends QueryEval implements QueryExp
+{
+ private static final long serialVersionUID = -1081892073854801359L;
+
+ /**
+ * @serial The left-side expression
+ */
+ private final QueryExp exp1;
+ /**
+ * @serial The right-side expression
+ */
+ private final QueryExp exp2;
+
+ AndQueryExp(QueryExp exp1, QueryExp exp2)
+ {
+ this.exp1 = exp1;
+ this.exp2 = exp2;
+ }
+
+ public void setMBeanServer(MBeanServer server)
+ {
+ super.setMBeanServer(server);
+ if (exp1 != null) exp1.setMBeanServer(server);
+ if (exp2 != null) exp2.setMBeanServer(server);
+ }
+
+ public boolean apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException
+ {
+ if (exp1 != null && exp2 != null)
+ {
+ return exp1.apply(name) && exp2.apply(name);
+ }
+ return false;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/AndQueryExp.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/Attribute.java (from rev 2244, trunk/mx4j/src/core/javax/management/Attribute.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/Attribute.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/Attribute.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.Serializable;
+
+/**
+ * @version $Revision$
+ */
+public class Attribute implements Serializable
+{
+ private static final long serialVersionUID = 2484220110589082382L;
+
+ /**
+ * @serial The attribute's name
+ */
+ private final String name;
+ /**
+ * @serial The attribute's value
+ */
+ private final Object value;
+
+ private transient int hash;
+
+ public Attribute(String name, Object value)
+ {
+ if (name == null) throw new RuntimeOperationsException(new IllegalArgumentException("The name of an attribute cannot be null"));
+
+ this.name = name;
+ this.value = value;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == null) return false;
+ if (obj == this) return true;
+
+ try
+ {
+ Attribute other = (Attribute)obj;
+ boolean namesEqual = name.equals(other.name);
+ boolean valuesEqual = false;
+ if (value == null)
+ valuesEqual = other.value == null;
+ else
+ valuesEqual = value.equals(other.value);
+ return namesEqual && valuesEqual;
+ }
+ catch (ClassCastException ignored)
+ {
+ }
+ return false;
+ }
+
+ public int hashCode()
+ {
+ if (hash == 0) hash = computeHash();
+ return hash;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Object getValue()
+ {
+ return value;
+ }
+
+ public String toString()
+ {
+ return new StringBuffer("Attribute's name: ").append(getName()).append(", value: ").append(getValue()).toString();
+ }
+
+ private int computeHash()
+ {
+ int hash = name.hashCode();
+ if (value != null) hash ^= value.hashCode();
+ return hash;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/Attribute.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/AttributeChangeNotification.java (from rev 2244, trunk/mx4j/src/core/javax/management/AttributeChangeNotification.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/AttributeChangeNotification.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/AttributeChangeNotification.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class AttributeChangeNotification extends Notification
+{
+ private static final long serialVersionUID = 535176054565814134L;
+
+ public static final String ATTRIBUTE_CHANGE = "jmx.attribute.change";
+
+ /**
+ * @serial The attribute's name
+ */
+ private final String attributeName;
+ /**
+ * @serial The attribute's type
+ */
+ private final String attributeType;
+ /**
+ * @serial The attribute's old value
+ */
+ private final Object oldValue;
+ /**
+ * @serial The attribute's new value
+ */
+ private final Object newValue;
+
+ public AttributeChangeNotification(Object source, long sequenceNumber, long timestamp, String message, String attributeName, String attributeType, Object oldValue, Object newValue)
+ {
+ super(ATTRIBUTE_CHANGE, source, sequenceNumber, timestamp, message);
+ this.attributeName = attributeName;
+ this.attributeType = attributeType;
+ this.oldValue = oldValue;
+ this.newValue = newValue;
+ }
+
+ public String getAttributeName()
+ {
+ return attributeName;
+ }
+
+ public String getAttributeType()
+ {
+ return attributeType;
+ }
+
+ public Object getOldValue()
+ {
+ return oldValue;
+ }
+
+ public Object getNewValue()
+ {
+ return newValue;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/AttributeChangeNotification.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/AttributeChangeNotificationFilter.java (from rev 2244, trunk/mx4j/src/core/javax/management/AttributeChangeNotificationFilter.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/AttributeChangeNotificationFilter.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/AttributeChangeNotificationFilter.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamField;
+import java.io.Serializable;
+import java.io.StreamCorruptedException;
+import java.util.HashSet;
+import java.util.Vector;
+
+/**
+ * @version $Revision$
+ */
+// Change not needed, workaround to a TCK bug only to achieve TCK compliance
+// public class AttributeChangeNotificationFilter implements NotificationFilter
+public class AttributeChangeNotificationFilter implements NotificationFilter, Serializable
+{
+ private static final long serialVersionUID = -6347317584796410029L;
+ private static final String serialName = "enabledAttributes";
+
+ /**
+ * @serialField enabledAttributes Vector The names of the attributes for which
+ * this filter will enable notification dispatching
+ */
+ private static final ObjectStreamField[] serialPersistentFields =
+ {
+ new ObjectStreamField(serialName, Vector.class)
+ };
+
+ private HashSet enabledAttributes = new HashSet();
+
+ public int hashCode()
+ {
+ return enabledAttributes.hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == null) return false;
+ if (obj == this) return true;
+
+ try
+ {
+ AttributeChangeNotificationFilter other = (AttributeChangeNotificationFilter)obj;
+ return getEnabledAttributes().equals(other.getEnabledAttributes());
+ }
+ catch (ClassCastException x)
+ {
+ }
+ return false;
+ }
+
+ public void enableAttribute(String name) throws IllegalArgumentException
+ {
+ if (name == null) throw new IllegalArgumentException("Name cannot be null");
+ synchronized (enabledAttributes)
+ {
+ enabledAttributes.add(name);
+ }
+ }
+
+ public void disableAttribute(String name)
+ {
+ if (name != null)
+ {
+ synchronized (enabledAttributes)
+ {
+ enabledAttributes.remove(name);
+ }
+ }
+ }
+
+ public void disableAllAttributes()
+ {
+ synchronized (enabledAttributes)
+ {
+ enabledAttributes.clear();
+ }
+ }
+
+ public Vector getEnabledAttributes()
+ {
+ synchronized (enabledAttributes)
+ {
+ return new Vector(enabledAttributes);
+ }
+ }
+
+
+ public boolean isNotificationEnabled(Notification notification)
+ {
+ if (!(notification instanceof AttributeChangeNotification)) return false;
+ AttributeChangeNotification n = (AttributeChangeNotification)notification;
+
+ if (!AttributeChangeNotification.ATTRIBUTE_CHANGE.equals(n.getType())) return false;
+ String attributeName = n.getAttributeName();
+
+ if (attributeName != null)
+ {
+ synchronized (enabledAttributes)
+ {
+ if (enabledAttributes.contains(attributeName)) return true;
+ }
+ }
+ return false;
+ }
+
+ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
+ {
+ ObjectInputStream.GetField fields = in.readFields();
+
+ Vector vector = (Vector)fields.get(serialName, null);
+ if (fields.defaulted(serialName))
+ {
+ throw new StreamCorruptedException("Serialized stream corrupted: expecting a non-null Vector");
+ }
+
+ if (enabledAttributes == null) enabledAttributes = new HashSet();
+ enabledAttributes.clear();
+ enabledAttributes.addAll(vector);
+ }
+
+ private void writeObject(ObjectOutputStream out) throws IOException
+ {
+ ObjectOutputStream.PutField fields = out.putFields();
+
+ Vector vector = getEnabledAttributes();
+ fields.put(serialName, vector);
+ out.writeFields();
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/AttributeChangeNotificationFilter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/AttributeList.java (from rev 2244, trunk/mx4j/src/core/javax/management/AttributeList.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/AttributeList.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/AttributeList.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @version $Revision$
+ */
+public class AttributeList extends ArrayList
+{
+ private static final long serialVersionUID = -4077085769279709076L;
+
+ public AttributeList()
+ {
+ }
+
+ public AttributeList(int initialCapacity)
+ {
+ super(initialCapacity);
+ }
+
+ public AttributeList(AttributeList list)
+ {
+ super(list);
+ }
+
+ public boolean add(Object o)
+ {
+ if (o instanceof Attribute)
+ return super.add(o);
+ else
+ throw new RuntimeOperationsException(new IllegalArgumentException("Elements of AttributeList can only be Attribute objects"));
+ }
+
+ public void add(Attribute a)
+ {
+ add((Object)a);
+ }
+
+ public void add(int index, Object element)
+ {
+ if (element instanceof Attribute)
+ {
+ try
+ {
+ super.add(index, element);
+ }
+ catch (IndexOutOfBoundsException x)
+ {
+ throw new RuntimeOperationsException(x);
+ }
+ }
+ else
+ {
+ throw new RuntimeOperationsException(new IllegalArgumentException("Elements of AttributeList can only be Attribute objects"));
+ }
+ }
+
+ public void add(int index, Attribute element)
+ {
+ add(index, (Object)element);
+ }
+
+ public boolean addAll(Collection c)
+ {
+ if (c instanceof AttributeList)
+ {
+ return super.addAll(c);
+ }
+ else
+ {
+ throw new RuntimeOperationsException(new IllegalArgumentException("Only AttributeList objects can be added to other AttributeList"));
+ }
+ }
+
+ public boolean addAll(AttributeList c)
+ {
+ return addAll((Collection)c);
+ }
+
+ public boolean addAll(int index, Collection c)
+ {
+ if (c instanceof AttributeList)
+ {
+ try
+ {
+ return super.addAll(index, c);
+ }
+ catch (IndexOutOfBoundsException x)
+ {
+ throw new RuntimeOperationsException(x);
+ }
+ }
+ else
+ {
+ throw new RuntimeOperationsException(new IllegalArgumentException("Only AttributeList objects can be added to other AttributeList"));
+ }
+ }
+
+ public boolean addAll(int index, AttributeList c)
+ {
+ return addAll(index, (Collection)c);
+ }
+
+ public Object set(int index, Object element)
+ {
+ if (element instanceof Attribute)
+ {
+ try
+ {
+ return super.set(index, element);
+ }
+ catch (IndexOutOfBoundsException x)
+ {
+ throw new RuntimeOperationsException(x);
+ }
+ }
+ else
+ {
+ throw new RuntimeOperationsException(new IllegalArgumentException("Elements of AttributeList can only be Attribute objects"));
+ }
+ }
+
+ public void set(int index, Attribute element)
+ {
+ set(index, (Object)element);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/AttributeList.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/AttributeNotFoundException.java (from rev 2244, trunk/mx4j/src/core/javax/management/AttributeNotFoundException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/AttributeNotFoundException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/AttributeNotFoundException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class AttributeNotFoundException extends OperationsException
+{
+ private static final long serialVersionUID = 6511584241791106926L;
+
+ public AttributeNotFoundException()
+ {
+ }
+
+ public AttributeNotFoundException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/AttributeNotFoundException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/AttributeValueExp.java (from rev 2244, trunk/mx4j/src/core/javax/management/AttributeValueExp.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/AttributeValueExp.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/AttributeValueExp.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+/**
+ * @version $Revision$
+ */
+public class AttributeValueExp implements ValueExp
+{
+ private static final long serialVersionUID = -7768025046539163385L;
+
+ /**
+ * @serial The name of the attribute
+ */
+ private String attr;
+
+ private transient MBeanServer server;
+
+ /**
+ * @deprecated Must not be used
+ */
+ public AttributeValueExp()
+ {
+ }
+
+ /**
+ * Creates a new AttributeValueExp with the given attribute's name, that will be
+ * used to retrieve the attribute's value used by this ValueExp
+ *
+ * @param attr The name of the MBean attribute
+ */
+ public AttributeValueExp(String attr)
+ {
+ this.attr = attr;
+ }
+
+ /**
+ * Returns the name of the MBean attribute whose value is used by this ValueExp
+ */
+ public String getAttributeName()
+ {
+ return attr;
+ }
+
+ public ValueExp apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException
+ {
+ try
+ {
+ Object value = getAttribute(name);
+ if (value == null)
+ {
+ // Must understand what to return
+ return createValueExp(name);
+ }
+ else if (value instanceof Number)
+ {
+ return new NumericValueExp((Number)value);
+ }
+ else if (value instanceof Boolean)
+ {
+ return new BooleanValueExp(((Boolean)value).booleanValue());
+ }
+ else if (value instanceof String)
+ {
+ return new StringValueExp((String)value);
+ }
+ else
+ {
+ throw new BadAttributeValueExpException(value);
+ }
+ }
+ catch (RuntimeOperationsException x)
+ {
+ throw new BadAttributeValueExpException(getAttributeName());
+ }
+ }
+
+ public void setMBeanServer(MBeanServer server)
+ {
+ this.server = server;
+ }
+
+ protected Object getAttribute(ObjectName name)
+ {
+ try
+ {
+ return server.getAttribute(name, getAttributeName());
+ }
+ catch (MBeanException x)
+ {
+ }
+ catch (AttributeNotFoundException x)
+ {
+ }
+ catch (InstanceNotFoundException x)
+ {
+ }
+ catch (ReflectionException x)
+ {
+ }
+ throw new RuntimeOperationsException(null);
+ }
+
+ private ValueExp createValueExp(final ObjectName name) throws BadAttributeValueExpException
+ {
+ try
+ {
+ MBeanInfo info = (MBeanInfo)AccessController.doPrivileged(new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return server.getMBeanInfo(name);
+ }
+ });
+
+ MBeanAttributeInfo[] attrs = info.getAttributes();
+ for (int i = 0; i < attrs.length; ++i)
+ {
+ MBeanAttributeInfo attribute = attrs[i];
+ if (attribute.getName().equals(getAttributeName()))
+ {
+ String type = attribute.getType();
+ if (type.equals("java.lang.String"))
+ {
+ return new StringValueExp(null);
+ }
+ else
+ {
+ // If an attribute is meant to return a boolean or a number, and returns null,
+ // then the MBean programmer is dumb and we tell him so.
+ throw new BadAttributeValueExpException(null);
+ }
+ }
+ }
+ }
+ catch (PrivilegedActionException x)
+ {
+ }
+ throw new BadAttributeValueExpException(null);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/AttributeValueExp.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/BadAttributeValueExpException.java (from rev 2244, trunk/mx4j/src/core/javax/management/BadAttributeValueExpException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/BadAttributeValueExpException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/BadAttributeValueExpException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class BadAttributeValueExpException extends Exception
+{
+ private static final long serialVersionUID = -3105272988410493376L;
+
+ /**
+ * @serial The value of the MBean attribute
+ */
+ private final Object val;
+
+ public BadAttributeValueExpException(Object value)
+ {
+ super(String.valueOf(value));
+ this.val = value;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/BadAttributeValueExpException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/BadBinaryOpValueExpException.java (from rev 2244, trunk/mx4j/src/core/javax/management/BadBinaryOpValueExpException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/BadBinaryOpValueExpException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/BadBinaryOpValueExpException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class BadBinaryOpValueExpException extends Exception
+{
+ private static final long serialVersionUID = 5068475589449021227L;
+
+ /**
+ * @serial The irregular expression
+ */
+ private final ValueExp exp;
+
+ public BadBinaryOpValueExpException(ValueExp exp)
+ {
+ this.exp = exp;
+ }
+
+ public ValueExp getExp()
+ {
+ return exp;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/BadBinaryOpValueExpException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/BadStringOperationException.java (from rev 2244, trunk/mx4j/src/core/javax/management/BadStringOperationException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/BadStringOperationException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/BadStringOperationException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class BadStringOperationException extends Exception
+{
+ private static final long serialVersionUID = 7802201238441662100L;
+
+ /**
+ * @serial The illegal operation
+ */
+ private final String op;
+
+ public BadStringOperationException(String operation)
+ {
+ super(operation);
+ this.op = operation;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/BadStringOperationException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/BetweenQueryExp.java (from rev 2244, trunk/mx4j/src/core/javax/management/BetweenQueryExp.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/BetweenQueryExp.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/BetweenQueryExp.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ * @serial include
+ */
+class BetweenQueryExp extends QueryEval implements QueryExp
+{
+ private static final long serialVersionUID = -2933597532866307444L;
+
+ /**
+ * @serial The lower value
+ */
+ private final ValueExp exp1;
+ /**
+ * @serial The value to test
+ */
+ private final ValueExp exp2;
+ /**
+ * The upper value
+ */
+ private final ValueExp exp3;
+
+ BetweenQueryExp(ValueExp exp1, ValueExp exp2, ValueExp exp3)
+ {
+ this.exp1 = exp1;
+ this.exp2 = exp2;
+ this.exp3 = exp3;
+ }
+
+ public void setMBeanServer(MBeanServer server)
+ {
+ super.setMBeanServer(server);
+ if (exp1 != null) exp1.setMBeanServer(server);
+ if (exp2 != null) exp2.setMBeanServer(server);
+ if (exp3 != null) exp3.setMBeanServer(server);
+ }
+
+ public boolean apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException
+ {
+ if (exp1 != null && exp2 != null && exp3 != null)
+ {
+ ValueExp val1 = exp1.apply(name);
+ ValueExp val2 = exp2.apply(name);
+ ValueExp val3 = exp3.apply(name);
+
+ if (val1 instanceof NumericValueExp && val2 instanceof NumericValueExp && val3 instanceof NumericValueExp)
+ {
+ NumericValueExp num1 = (NumericValueExp)val1;
+ NumericValueExp num2 = (NumericValueExp)val2;
+ NumericValueExp num3 = (NumericValueExp)val3;
+
+ if (num1.isDouble() || num2.isDouble() || num3.isDouble())
+ {
+ return isBetween(new Double(num1.doubleValue()), new Double(num2.doubleValue()), new Double(num3.doubleValue()));
+ }
+ else
+ {
+ return isBetween(new Long(num1.longValue()), new Long(num2.longValue()), new Long(num3.longValue()));
+ }
+ }
+/*
+ else if (val1 instanceof StringValueExp && val2 instanceof StringValueExp && val3 instanceof StringValueExp)
+ {
+ String s1 = ((StringValueExp)val1).getValue();
+ String s2 = ((StringValueExp)val2).getValue();
+ String s3 = ((StringValueExp)val3).getValue();
+ return isBetween(s1, s2, s3);
+ }
+*/
+ else
+ {
+ throw new InvalidApplicationException("Values are not numeric");
+ }
+ }
+
+ return false;
+ }
+
+ private boolean isBetween(Comparable c1, Comparable c2, Comparable c3)
+ {
+ if (c1 == null && c2 == null && c3 == null) return true;
+ if (c1 == null && (c2 == null || c3 == null)) return true;
+ if (c1 == null) return false;
+ if (c1 != null && (c2 == null || c3 == null)) return false;
+ return c1.compareTo(c2) >= 0 && c1.compareTo(c3) <= 0;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/BetweenQueryExp.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/BinaryOpValueExp.java (from rev 2244, trunk/mx4j/src/core/javax/management/BinaryOpValueExp.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/BinaryOpValueExp.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/BinaryOpValueExp.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+class BinaryOpValueExp extends QueryEval implements ValueExp
+{
+ private static final long serialVersionUID = 1216286847881456786L;
+
+ private final int op;
+ private final ValueExp exp1;
+ private final ValueExp exp2;
+
+ BinaryOpValueExp(int op, ValueExp exp1, ValueExp exp2)
+ {
+ this.op = op;
+ this.exp1 = exp1;
+ this.exp2 = exp2;
+ }
+
+ public void setMBeanServer(MBeanServer server)
+ {
+ super.setMBeanServer(server);
+ if (exp1 != null) exp1.setMBeanServer(server);
+ if (exp2 != null) exp2.setMBeanServer(server);
+ }
+
+ public ValueExp apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException
+ {
+ if (exp1 != null && exp2 != null)
+ {
+ ValueExp val1 = exp1.apply(name);
+ ValueExp val2 = exp2.apply(name);
+
+ if (val1 instanceof NumericValueExp)
+ {
+ if (val2 instanceof NumericValueExp)
+ {
+ NumericValueExp num1 = (NumericValueExp)val1;
+ NumericValueExp num2 = (NumericValueExp)val2;
+
+ if (num1.isDouble() || num2.isDouble())
+ {
+ double d1 = num1.doubleValue();
+ double d2 = num2.doubleValue();
+ switch (op)
+ {
+ case Query.PLUS:
+ return Query.value(d1 + d2);
+ case Query.MINUS:
+ return Query.value(d1 - d2);
+ case Query.TIMES:
+ return Query.value(d1 * d2);
+ case Query.DIV:
+ return Query.value(d1 / d2);
+ }
+ }
+ else
+ {
+ long l1 = num1.longValue();
+ long l2 = num2.longValue();
+ switch (op)
+ {
+ case Query.PLUS:
+ return Query.value(l1 + l2);
+ case Query.MINUS:
+ return Query.value(l1 - l2);
+ case Query.TIMES:
+ return Query.value(l1 * l2);
+ case Query.DIV:
+ return Query.value(l1 / l2);
+ }
+ }
+ }
+ else
+ {
+ throw new BadBinaryOpValueExpException(val2);
+ }
+ }
+ else if (val1 instanceof StringValueExp)
+ {
+ if (val2 instanceof StringValueExp)
+ {
+ String s1 = ((StringValueExp)val1).getValue();
+ String s2 = ((StringValueExp)val2).getValue();
+ switch (op)
+ {
+ case Query.PLUS:
+ return Query.value(String.valueOf(s1) + String.valueOf(s2));
+ default:
+ throw new BadStringOperationException("Trying to perform an operation on Strings that is not concatenation");
+ }
+ }
+ else
+ {
+ throw new BadBinaryOpValueExpException(val2);
+ }
+ }
+ else
+ {
+ throw new BadBinaryOpValueExpException(val1);
+ }
+ }
+ throw new BadBinaryOpValueExpException(null);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/BinaryOpValueExp.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/BinaryRelQueryExp.java (from rev 2244, trunk/mx4j/src/core/javax/management/BinaryRelQueryExp.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/BinaryRelQueryExp.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/BinaryRelQueryExp.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ * @serial include
+ */
+class BinaryRelQueryExp extends QueryEval implements QueryExp
+{
+ private static final long serialVersionUID = -5690656271650491000L;
+
+ /**
+ * @serial The left side expression
+ */
+ private final ValueExp exp1;
+ /**
+ * @serial The infix operator
+ */
+ private final int relOp;
+ /**
+ * @serial The right side expression
+ */
+ private final ValueExp exp2;
+
+ BinaryRelQueryExp(int operation, ValueExp exp1, ValueExp exp2)
+ {
+ this.relOp = operation;
+ this.exp1 = exp1;
+ this.exp2 = exp2;
+ }
+
+ public void setMBeanServer(MBeanServer server)
+ {
+ super.setMBeanServer(server);
+ if (exp1 != null) exp1.setMBeanServer(server);
+ if (exp2 != null) exp2.setMBeanServer(server);
+ }
+
+ public boolean apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException
+ {
+ if (exp1 == null && exp2 == null && (relOp == Query.EQ || relOp == Query.GE || relOp == Query.LE))
+ {
+ return true;
+ }
+
+ if (exp1 != null && exp2 != null)
+ {
+ ValueExp val1 = exp1.apply(name);
+ ValueExp val2 = exp2.apply(name);
+
+ if (val1 instanceof NumericValueExp && val2 instanceof NumericValueExp)
+ {
+ NumericValueExp num1 = (NumericValueExp)val1;
+ NumericValueExp num2 = (NumericValueExp)val2;
+
+ if (num1.isDouble() || num2.isDouble())
+ {
+ return compare(new Double(num1.doubleValue()), new Double(num2.doubleValue()));
+ }
+ else
+ {
+ return compare(new Long(num1.longValue()), new Long(num2.longValue()));
+ }
+ }
+ else if (val1 instanceof BooleanValueExp && val2 instanceof BooleanValueExp)
+ {
+ boolean b1 = ((BooleanValueExp)val1).booleanValue();
+ boolean b2 = ((BooleanValueExp)val2).booleanValue();
+ return compare(new Long(b1 ? 1 : 0), new Long(b2 ? 1 : 0));
+ }
+ else if (val1 instanceof StringValueExp && val2 instanceof StringValueExp)
+ {
+ String s1 = ((StringValueExp)val1).getValue();
+ String s2 = ((StringValueExp)val2).getValue();
+ return compare(s1, s2);
+ }
+ }
+
+ return false;
+ }
+
+ private boolean compare(Comparable c1, Comparable c2)
+ {
+ switch (relOp)
+ {
+ case Query.EQ:
+ if (c1 == null && c2 == null) return true;
+ if (c1 == null || c2 == null) return false;
+ return c1.equals(c2);
+ case Query.GE:
+ if (c1 == null && c2 == null) return true;
+ if (c1 == null && c2 != null) return false;
+ if (c1 != null && c2 == null) return true;
+ return c1.compareTo(c2) >= 0;
+ case Query.LE:
+ if (c1 == null && c2 == null) return true;
+ if (c1 == null && c2 != null) return true;
+ if (c1 != null && c2 == null) return false;
+ return c1.compareTo(c2) <= 0;
+ case Query.GT:
+ if (c1 == null && c2 == null) return false;
+ if (c1 == null && c2 != null) return false;
+ if (c1 != null && c2 == null) return true;
+ return c1.compareTo(c2) > 0;
+ case Query.LT:
+ if (c1 == null && c2 == null) return false;
+ if (c1 == null && c2 != null) return true;
+ if (c1 != null && c2 == null) return false;
+ return c1.compareTo(c2) < 0;
+ }
+ return false;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/BinaryRelQueryExp.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/BooleanValueExp.java (from rev 2244, trunk/mx4j/src/core/javax/management/BooleanValueExp.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/BooleanValueExp.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/BooleanValueExp.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ * @serial include
+ */
+class BooleanValueExp extends QueryEval implements ValueExp
+{
+ private static final long serialVersionUID = 7754922052666594581L;
+
+ private final boolean val;
+
+ BooleanValueExp(boolean val)
+ {
+ this.val = val;
+ }
+
+ boolean booleanValue()
+ {
+ return val;
+ }
+
+ public ValueExp apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException
+ {
+ return this;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/BooleanValueExp.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/ClassAttributeValueExp.java (from rev 2244, trunk/mx4j/src/core/javax/management/ClassAttributeValueExp.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/ClassAttributeValueExp.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/ClassAttributeValueExp.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ * @serial include
+ */
+class ClassAttributeValueExp extends AttributeValueExp
+{
+ private static final long serialVersionUID = -1081892073854801359L;
+
+ /**
+ * @serial Not used, here only for serialization compatibility
+ */
+ private String attr;
+
+ private transient MBeanServer server;
+
+ ClassAttributeValueExp()
+ {
+ super("classname");
+ }
+
+ public void setMBeanServer(MBeanServer server)
+ {
+ super.setMBeanServer(server);
+ this.server = server;
+ }
+
+ public ValueExp apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException
+ {
+ try
+ {
+ // getObjectInstance is called for compatibility with the RI;
+ // in fact, when used under security manager, calling this method requires
+ // the proper permission to call getObjectInstance.
+ String className = server.getObjectInstance(name).getClassName();
+ return new StringValueExp(className);
+ }
+ catch (InstanceNotFoundException ignored)
+ {
+ }
+ throw new BadAttributeValueExpException(null);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/ClassAttributeValueExp.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/DefaultLoaderRepository.java (from rev 2244, trunk/mx4j/src/core/javax/management/DefaultLoaderRepository.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/DefaultLoaderRepository.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/DefaultLoaderRepository.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * Do not use this class !
+ *
+ * @version $Revision$
+ * @deprecated Use {@link MBeanServer#getClassLoaderRepository} instead.
+ */
+public class DefaultLoaderRepository
+{
+ /**
+ * Do not use !
+ *
+ * @deprecated Use {@link javax.management.loading.ClassLoaderRepository#loadClass} instead.
+ */
+ public static Class loadClass(String s) throws ClassNotFoundException
+ {
+ return javax.management.loading.DefaultLoaderRepository.loadClass(s);
+ }
+
+ /**
+ * Do not use !
+ *
+ * @deprecated Use {@link javax.management.loading.ClassLoaderRepository#loadClassWithout} instead.
+ */
+ public static Class loadClassWithout(ClassLoader classloader, String s) throws ClassNotFoundException
+ {
+ return javax.management.loading.DefaultLoaderRepository.loadClassWithout(classloader, s);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/DefaultLoaderRepository.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/Descriptor.java (from rev 2244, trunk/mx4j/src/core/javax/management/Descriptor.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/Descriptor.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/Descriptor.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.Serializable;
+
+/**
+ * A set of name-value pairs that allow ModelMBean metadata to have additional information attached to.
+ * Descriptor is cloneable since represent a snapshot of what the client passed in to the ModelMBean.
+ * This ensures that if the client nulls out some value, the descriptor is still valid, since it has been cloned
+ * prior the client modification. The client can always re-set the descriptor on the model mbean.
+ *
+ * @version $Revision$
+ */
+public interface Descriptor extends Cloneable, Serializable
+{
+ /**
+ * Returns the value of a given field name.
+ *
+ * @param fieldName The field name
+ * @return Object The value for the given field name. Returns null if not found.
+ * @throws RuntimeOperationsException if the value for field name is illegal
+ */
+ public Object getFieldValue(String fieldName) throws RuntimeOperationsException;
+
+ /**
+ * Sets a value for the given field name. The field value will be checked
+ * before being set. This will either add a new field or update it if it
+ * already exists.
+ *
+ * @param fieldName The name of the field
+ * @param fieldValue The value for the given field name
+ * @throws RuntimeOperationsException If values for fieldName or fieldValue
+ * are illegal or the description construction fails
+ */
+ public void setField(String fieldName, Object fieldValue) throws RuntimeOperationsException;
+
+ /**
+ * Removes the named field. If the field is not present, does nothing.
+ *
+ * @param fieldName The field to be removed.
+ */
+ public void removeField(String fieldName);
+
+ /**
+ * Returns the names of all existing fields. If no fields are present, an empty array is returned.
+ */
+ public String[] getFieldNames();
+
+ /**
+ * Return the values of the specified fields, in order.
+ *
+ * @param fieldNames The names of the fields
+ * @return Object[] The values of the fields
+ */
+ public Object[] getFieldValues(String[] fieldNames);
+
+ /**
+ * Returns the names and values of all existing fields.
+ *
+ * @return String[] The String array in the format fieldName=fieldValue.
+ * An empty descriptor will result in an empty array returned.
+ */
+ public String[] getFields();
+
+ /**
+ * Sets the given fieldValues for the given fieldNames.
+ * The size of both given array should match.
+ *
+ * @param fieldNames The names of the fields.
+ * @param fieldValues The values of the fields.
+ * @throws RuntimeOperationsException if fieldNames or fieldValues contains illegal values.
+ */
+ public void setFields(String[] fieldNames, Object[] fieldValues) throws RuntimeOperationsException;
+
+ /**
+ * Returns a copy of this Descriptor
+ */
+ public Object clone() throws RuntimeOperationsException;
+
+ /**
+ * Returns true when the values for the fields of this Descriptor are valid values, false otherwise.
+ *
+ * @throws RuntimeOperationsException If the field names or values are illegal
+ */
+ public boolean isValid() throws RuntimeOperationsException;
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/Descriptor.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/DescriptorAccess.java (from rev 2244, trunk/mx4j/src/core/javax/management/DescriptorAccess.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/DescriptorAccess.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/DescriptorAccess.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * Use to gain access to the {@link Descriptor} objects associated with MBean metadata.
+ *
+ * @version $Revision$
+ */
+public interface DescriptorAccess
+{
+ /**
+ * Returns a copy of the descriptor
+ */
+ public Descriptor getDescriptor();
+
+ /**
+ * Sets the descriptor with a copy of the given descriptor.
+ */
+ public void setDescriptor(Descriptor descriptor);
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/DescriptorAccess.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/DynamicMBean.java (from rev 2244, trunk/mx4j/src/core/javax/management/DynamicMBean.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/DynamicMBean.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/DynamicMBean.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public interface DynamicMBean
+{
+ public MBeanInfo getMBeanInfo();
+
+ public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException;
+
+ public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException;
+
+ public AttributeList getAttributes(String[] attributes);
+
+ public AttributeList setAttributes(AttributeList attributes);
+
+ public Object invoke(String method, Object[] arguments, String[] params) throws MBeanException, ReflectionException;
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/DynamicMBean.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/InQueryExp.java (from rev 2244, trunk/mx4j/src/core/javax/management/InQueryExp.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/InQueryExp.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/InQueryExp.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ * @serial include
+ */
+class InQueryExp extends QueryEval implements QueryExp
+{
+ private static final long serialVersionUID = -5801329450358952434L;
+
+ /**
+ * @serial The value to be tested
+ */
+ private final ValueExp val;
+ /**
+ * @serial The allowed values
+ */
+ private final ValueExp[] valueList;
+
+ InQueryExp(ValueExp val, ValueExp[] valueList)
+ {
+ this.val = val;
+ this.valueList = valueList;
+ }
+
+ public void setMBeanServer(MBeanServer server)
+ {
+ super.setMBeanServer(server);
+ if (val != null) val.setMBeanServer(server);
+ if (valueList != null)
+ {
+ for (int i = 0; i < valueList.length; ++i)
+ {
+ ValueExp v = valueList[i];
+ if (v != null) v.setMBeanServer(server);
+ }
+ }
+ }
+
+ public boolean apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException
+ {
+ if (val != null && valueList != null)
+ {
+ ValueExp valueExp = val.apply(name);
+ if (valueExp instanceof NumericValueExp)
+ {
+ NumericValueExp numExp = (NumericValueExp)valueExp;
+ if (numExp.isDouble())
+ {
+ for (int i = 0; i < valueList.length; ++i)
+ {
+ ValueExp exp = valueList[i];
+ if (exp instanceof NumericValueExp)
+ {
+ if (((NumericValueExp)exp).doubleValue() == numExp.doubleValue()) return true;
+ }
+ }
+ }
+ else
+ {
+ for (int i = 0; i < valueList.length; ++i)
+ {
+ ValueExp exp = valueList[i];
+ if (exp instanceof NumericValueExp)
+ {
+ if (((NumericValueExp)exp).longValue() == numExp.longValue()) return true;
+ }
+ }
+ }
+ }
+ else if (valueExp instanceof StringValueExp)
+ {
+ String s1 = ((StringValueExp)valueExp).getValue();
+ for (int i = 0; i < valueList.length; ++i)
+ {
+ ValueExp exp = valueList[i];
+ if (exp instanceof StringValueExp)
+ {
+ String s2 = ((StringValueExp)exp).getValue();
+ if (s1 == null && s2 == null) return true;
+ if (s1 != null && s2 != null)
+ {
+ if (s1.equals(s2)) return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/InQueryExp.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/InstanceAlreadyExistsException.java (from rev 2244, trunk/mx4j/src/core/javax/management/InstanceAlreadyExistsException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/InstanceAlreadyExistsException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/InstanceAlreadyExistsException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class InstanceAlreadyExistsException extends OperationsException
+{
+ private static final long serialVersionUID = 8893743928912733931L;
+
+ public InstanceAlreadyExistsException()
+ {
+ }
+
+ public InstanceAlreadyExistsException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/InstanceAlreadyExistsException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/InstanceNotFoundException.java (from rev 2244, trunk/mx4j/src/core/javax/management/InstanceNotFoundException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/InstanceNotFoundException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/InstanceNotFoundException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class InstanceNotFoundException extends OperationsException
+{
+ private static final long serialVersionUID = -882579438394773049L;
+
+ public InstanceNotFoundException()
+ {
+ }
+
+ public InstanceNotFoundException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/InstanceNotFoundException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/IntrospectionException.java (from rev 2244, trunk/mx4j/src/core/javax/management/IntrospectionException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/IntrospectionException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/IntrospectionException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class IntrospectionException extends OperationsException
+{
+ private static final long serialVersionUID = 1054516935875481725L;
+
+ public IntrospectionException()
+ {
+ }
+
+ public IntrospectionException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/IntrospectionException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/InvalidApplicationException.java (from rev 2244, trunk/mx4j/src/core/javax/management/InvalidApplicationException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/InvalidApplicationException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/InvalidApplicationException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class InvalidApplicationException extends Exception
+{
+ private static final long serialVersionUID = -3048022274675537269L;
+
+ /**
+ * @serial The invalid value
+ */
+ private final Object val;
+
+ public InvalidApplicationException(Object value)
+ {
+ super(String.valueOf(value));
+ this.val = value;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/InvalidApplicationException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/InvalidAttributeValueException.java (from rev 2244, trunk/mx4j/src/core/javax/management/InvalidAttributeValueException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/InvalidAttributeValueException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/InvalidAttributeValueException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class InvalidAttributeValueException extends OperationsException
+{
+ private static final long serialVersionUID = 2164571879317142449L;
+
+ public InvalidAttributeValueException()
+ {
+ }
+
+ public InvalidAttributeValueException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/InvalidAttributeValueException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/JMException.java (from rev 2244, trunk/mx4j/src/core/javax/management/JMException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/JMException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/JMException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class JMException extends Exception
+{
+ private static final long serialVersionUID = 350520924977331825L;
+
+ public JMException()
+ {
+ }
+
+ public JMException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/JMException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/JMRuntimeException.java (from rev 2244, trunk/mx4j/src/core/javax/management/JMRuntimeException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/JMRuntimeException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/JMRuntimeException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class JMRuntimeException extends RuntimeException
+{
+ private static final long serialVersionUID = 6573344628407841861L;
+
+ public JMRuntimeException()
+ {
+ }
+
+ public JMRuntimeException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/JMRuntimeException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/ListenerNotFoundException.java (from rev 2244, trunk/mx4j/src/core/javax/management/ListenerNotFoundException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/ListenerNotFoundException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/ListenerNotFoundException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+/**
+ * @version $Revision$
+ */
+public class ListenerNotFoundException extends OperationsException
+{
+ private static final long serialVersionUID = -7242605822448519061L;
+
+ public ListenerNotFoundException()
+ {
+ }
+
+ public ListenerNotFoundException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/ListenerNotFoundException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanAttributeInfo.java (from rev 2244, trunk/mx4j/src/core/javax/management/MBeanAttributeInfo.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/MBeanAttributeInfo.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/MBeanAttributeInfo.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+import mx4j.util.Utils;
+
+/**
+ * @version $Revision$
+ */
+// Change not needed, workaround to a TCK bug only to achieve TCK compliance
+// public class MBeanAttributeInfo extends MBeanFeatureInfo implements Cloneable
+public class MBeanAttributeInfo extends MBeanFeatureInfo implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = 8644704819898565848L;
+
+ /**
+ * @serial The full qualified class name of the attribute's type
+ */
+ private String attributeType;
+ /**
+ * @serial The readability of the attribute
+ */
+ private boolean isRead;
+ /**
+ * @serial The writability of the attribute
+ */
+ private boolean isWrite;
+ /**
+ * @serial The boolean flag that says the attribute's type is boolean
+ */
+ private boolean is;
+
+ /**
+ * Creates a new MBeanAttributeInfo
+ *
+ * @param name The attribute name
+ * @param description The attribute description
+ * @param getter The getter method, or null if write only
+ * @param setter The setter method, or null if read only
+ * @throws IntrospectionException If the introspection of the attribute fails
+ */
+ public MBeanAttributeInfo(String name, String description, Method getter, Method setter) throws IntrospectionException
+ {
+ super(name, description);
+
+ String getterType = null;
+ String setterType = null;
+
+ if (getter != null)
+ {
+ if (Utils.isAttributeGetter(getter))
+ {
+ this.isRead = true;
+ if (getter.getName().startsWith("is")) this.is = true;
+ getterType = getter.getReturnType().getName();
+ }
+ else
+ throw new IntrospectionException("Bad getter method");
+ }
+ if (setter != null)
+ {
+ if (Utils.isAttributeSetter(setter))
+ {
+ this.isWrite = true;
+ setterType = setter.getParameterTypes()[0].getName();
+ }
+ else
+ throw new IntrospectionException("Bad setter method");
+ }
+
+ this.attributeType = reconcileAttributeType(getterType, setterType);
+ }
+
+ /**
+ * Creates a new MBeanAttributeInfo
+ *
+ * @param name The attribute name
+ * @param description The attribute description
+ * @param isReadable The attribute's readability
+ * @param isWritable The attribute's writability
+ * @param isIs The flag if the attribute's type is boolean
+ */
+ public MBeanAttributeInfo(String name, String className, String description, boolean isReadable, boolean isWritable, boolean isIs)
+ throws IllegalArgumentException
+ {
+ super(name, description);
+
+ this.attributeType = className;
+ this.isRead = isReadable;
+ this.isWrite = isWritable;
+ this.is = isIs;
+ }
+
+ public Object clone()
+ {
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException ignored)
+ {
+ return null;
+ }
+ }
+
+ public String getType()
+ {
+ return attributeType;
+ }
+
+ public boolean isReadable()
+ {
+ return isRead;
+ }
+
+ public boolean isWritable()
+ {
+ return isWrite;
+ }
+
+ public boolean isIs()
+ {
+ return is;
+ }
+
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+
+ String t = getType();
+ if (t != null) hash = 29 * hash + t.hashCode();
+
+ hash = 29 * hash + 3 * (isReadable() ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode());
+ hash = 29 * hash + 5 * (isWritable() ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode());
+ hash = 29 * hash + 7 * (isIs() ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode());
+
+ return hash;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!super.equals(obj)) return false;
+ if (!(obj instanceof MBeanAttributeInfo)) return false;
+
+ MBeanAttributeInfo other = (MBeanAttributeInfo)obj;
+
+ String thisType = getType();
+ String otherType = other.getType();
+ if (thisType != null ? !thisType.equals(otherType) : otherType != null) return false;
+
+ if (isReadable() ^ other.isReadable()) return false;
+ if (isWritable() ^ other.isWritable()) return false;
+ if (isIs() ^ other.isIs()) return false;
+
+ return true;
+ }
+
+ private String reconcileAttributeType(String getterType, String setterType)
+ throws IntrospectionException
+ {
+ String result = null; // only unchanged if getterType == null && setterType == null
+
+ if (getterType == null && setterType != null)
+ {
+ result = setterType;
+ }
+ else if (getterType != null && setterType == null)
+ {
+ result = getterType;
+ }
+ else if (getterType != null && setterType != null)
+ {
+ if (getterType.compareToIgnoreCase(setterType) == 0)
+ {
+ result = getterType;
+ }
+ else
+ {
+ throw new IntrospectionException("Attribute setter/getter types don't match");
+ }
+ }
+
+ return result;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanAttributeInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanConstructorInfo.java (from rev 2244, trunk/mx4j/src/core/javax/management/MBeanConstructorInfo.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/MBeanConstructorInfo.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/MBeanConstructorInfo.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.Serializable;
+import java.lang.reflect.Constructor;
+
+import mx4j.util.Utils;
+
+/**
+ * Metadata class for an MBean constructor
+ *
+ * @version $Revision$
+ */
+// Change not needed, workaround to a TCK bug only to achieve TCK compliance
+// public class MBeanConstructorInfo extends MBeanFeatureInfo implements Cloneable
+public class MBeanConstructorInfo extends MBeanFeatureInfo implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = 4433990064191844427L;
+
+ /**
+ * @serial The signature of the constructor
+ */
+ private MBeanParameterInfo[] signature;
+
+ /**
+ * Creates a new MBeanConstructorInfo
+ *
+ * @param description The constructor description
+ * @param constructor The constructor
+ */
+ public MBeanConstructorInfo(String description, Constructor constructor)
+ {
+ super(constructor.getName(), description);
+ Class[] params = constructor.getParameterTypes();
+ this.signature = new MBeanParameterInfo[params.length];
+ for (int i = 0; i < params.length; ++i)
+ {
+ this.signature[i] = new MBeanParameterInfo("", params[i].getName(), "");
+ }
+ }
+
+ /**
+ * Creates a new MBeanConstructorInfo
+ *
+ * @param name The constructor's name, normally equals to the class name
+ * @param description The constructor description
+ * @param signature The constructor signature
+ */
+ public MBeanConstructorInfo(String name, String description, MBeanParameterInfo[] signature) throws IllegalArgumentException
+ {
+ super(name, description);
+ this.signature = signature == null ? new MBeanParameterInfo[0] : signature;
+ }
+
+ public Object clone()
+ {
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException ignored)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Returns the signature of this MBeanConstructorInfo
+ */
+ public MBeanParameterInfo[] getSignature()
+ {
+ return signature;
+ }
+
+ public int hashCode()
+ {
+ return super.hashCode() + 29 * Utils.arrayHashCode(getSignature());
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!super.equals(obj)) return false;
+ if (!(obj instanceof MBeanConstructorInfo)) return false;
+
+ MBeanConstructorInfo other = (MBeanConstructorInfo)obj;
+ return Utils.arrayEquals(getSignature(), other.getSignature());
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanConstructorInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanException.java (from rev 2244, trunk/mx4j/src/core/javax/management/MBeanException.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/MBeanException.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/MBeanException.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
+/**
+ * @version $Revision$
+ */
+public class MBeanException extends JMException
+{
+ private static final long serialVersionUID = 4066342430588744142L;
+
+ /**
+ * @serial The nested exception
+ */
+ private final Exception exception;
+
+ public MBeanException(Exception x)
+ {
+ this.exception = x;
+ }
+
+ public MBeanException(Exception x, String message)
+ {
+ super(message);
+ this.exception = x;
+ }
+
+ public String getMessage()
+ {
+ return super.getMessage() + " nested exception is " + getTargetException();
+ }
+
+ public Exception getTargetException()
+ {
+ return exception;
+ }
+
+ public Throwable getCause()
+ {
+ return getTargetException();
+ }
+
+ public void printStackTrace()
+ {
+ if (exception == null)
+ {
+ super.printStackTrace();
+ }
+ else
+ {
+ synchronized (System.err)
+ {
+ System.err.println(this);
+ exception.printStackTrace();
+ }
+ }
+ }
+
+ public void printStackTrace(PrintStream s)
+ {
+ if (exception == null)
+ {
+ super.printStackTrace(s);
+ }
+ else
+ {
+ synchronized (s)
+ {
+ s.println(this);
+ exception.printStackTrace(s);
+ }
+ }
+ }
+
+ public void printStackTrace(PrintWriter w)
+ {
+ if (exception == null)
+ {
+ super.printStackTrace(w);
+ }
+ else
+ {
+ synchronized (w)
+ {
+ w.println(this);
+ exception.printStackTrace(w);
+ }
+ }
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanFeatureInfo.java (from rev 2244, trunk/mx4j/src/core/javax/management/MBeanFeatureInfo.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/MBeanFeatureInfo.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/MBeanFeatureInfo.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.Serializable;
+
+/**
+ * Base class for the MBean metadata classes.
+ *
+ * @version $Revision$
+ */
+public class MBeanFeatureInfo implements Serializable
+{
+ private static final long serialVersionUID = 3952882688968447265L;
+
+ /**
+ * @serial The name of the feature
+ */
+ protected String name;
+ /**
+ * @serial The description of the feature
+ */
+ protected String description;
+
+ /**
+ * Creates a new MBean feature metadata object
+ *
+ * @param name The name of the feature
+ * @param description The description of the feature
+ */
+ public MBeanFeatureInfo(String name, String description) throws IllegalArgumentException
+ {
+ this.name = name;
+ this.description = description;
+ }
+
+ /**
+ * Returns the name of the MBean feature
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Returns the description of the MBean feature
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public int hashCode()
+ {
+ int hash = 0;
+ String n = getName();
+ if (n != null) hash = 29 * hash + n.hashCode();
+ String d = getDescription();
+ if (d != null) hash = 29 * hash + d.hashCode();
+ return hash;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (this == obj) return true;
+ if (!(obj instanceof MBeanFeatureInfo)) return false;
+
+ MBeanFeatureInfo other = (MBeanFeatureInfo)obj;
+ String thisName = getName();
+ String otherName = other.getName();
+ if (thisName != null ? !thisName.equals(otherName) : otherName != null) return false;
+ String thisDescr = getDescription();
+ String otherDescr = other.getDescription();
+ if (thisDescr != null ? !thisDescr.equals(otherDescr) : otherDescr != null) return false;
+ return true;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanFeatureInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanInfo.java (from rev 2244, trunk/mx4j/src/core/javax/management/MBeanInfo.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/MBeanInfo.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/MBeanInfo.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.Serializable;
+
+import mx4j.util.Utils;
+
+/**
+ * @version $Revision$
+ */
+public class MBeanInfo implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = -6451021435135161911L;
+
+ private static final MBeanConstructorInfo[] EMPTY_CONSTRUCTORS = new MBeanConstructorInfo[0];
+ private static final MBeanAttributeInfo[] EMPTY_ATTRIBUTES = new MBeanAttributeInfo[0];
+ private static final MBeanOperationInfo[] EMPTY_OPERATIONS = new MBeanOperationInfo[0];
+ private static final MBeanNotificationInfo[] EMPTY_NOTIFICATIONS = new MBeanNotificationInfo[0];
+
+ /**
+ * @serial The MBean class name
+ */
+ private String className;
+ /**
+ * @serial The MBean description
+ */
+ private String description;
+ /**
+ * @serial The MBean constructors
+ */
+ private MBeanConstructorInfo[] constructors;
+ /**
+ * The MBean attributes
+ */
+ private MBeanAttributeInfo[] attributes;
+ /**
+ * The MBean operations
+ */
+ private MBeanOperationInfo[] operations;
+ /**
+ * The MBean notifications
+ */
+ private MBeanNotificationInfo[] notifications;
+
+ public MBeanInfo(String className, String description, MBeanAttributeInfo[] attributes, MBeanConstructorInfo[] constructors, MBeanOperationInfo[] operations, MBeanNotificationInfo[] notifications)
+ throws IllegalArgumentException
+ {
+ this.className = className;
+ this.description = description;
+ this.constructors = constructors == null || constructors.length == 0 ? EMPTY_CONSTRUCTORS : constructors;
+ this.attributes = attributes == null || attributes.length == 0 ? EMPTY_ATTRIBUTES : attributes;
+ this.operations = operations == null || operations.length == 0 ? EMPTY_OPERATIONS : operations;
+ this.notifications = notifications == null || notifications.length == 0 ? EMPTY_NOTIFICATIONS : notifications;
+ }
+
+ public Object clone()
+ {
+ // This class is read only, so no need to clone also data members
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException x)
+ {
+ return null;
+ }
+ }
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public MBeanConstructorInfo[] getConstructors()
+ {
+ return constructors;
+ }
+
+ public MBeanAttributeInfo[] getAttributes()
+ {
+ return attributes;
+ }
+
+ public MBeanOperationInfo[] getOperations()
+ {
+ return operations;
+ }
+
+ public MBeanNotificationInfo[] getNotifications()
+ {
+ return notifications;
+ }
+
+ public int hashCode()
+ {
+ int hash = 0;
+ String cn = getClassName();
+ if (cn != null) hash = 29 * hash + cn.hashCode();
+ String de = getDescription();
+ if (de != null) hash = 29 * hash + de.hashCode();
+ MBeanConstructorInfo[] co = getConstructors();
+ if (co != null) hash = 29 * hash + Utils.arrayHashCode(co);
+ MBeanAttributeInfo[] at = getAttributes();
+ if (at != null) hash = 29 * hash + Utils.arrayHashCode(at);
+ MBeanOperationInfo[] op = getOperations();
+ if (op != null) hash = 29 * hash + Utils.arrayHashCode(op);
+ MBeanNotificationInfo[] no = getNotifications();
+ if (no != null) hash = 29 * hash + Utils.arrayHashCode(no);
+ return hash;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == this) return true;
+ if (!(obj instanceof MBeanInfo)) return false;
+
+ MBeanInfo other = (MBeanInfo)obj;
+ String thisClassName = getClassName();
+ String otherClassName = other.getClassName();
+ if (thisClassName != null ? !thisClassName.equals(otherClassName) : otherClassName != null) return false;
+ String thisDescription = getDescription();
+ String otherDescription = other.getDescription();
+ if (thisDescription != null ? !thisDescription.equals(otherDescription) : otherDescription != null) return false;
+ if (!Utils.arrayEquals(getConstructors(), other.getConstructors())) return false;
+ if (!Utils.arrayEquals(getAttributes(), other.getAttributes())) return false;
+ if (!Utils.arrayEquals(getOperations(), other.getOperations())) return false;
+ if (!Utils.arrayEquals(getNotifications(), other.getNotifications())) return false;
+ return true;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanNotificationInfo.java (from rev 2244, trunk/mx4j/src/core/javax/management/MBeanNotificationInfo.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/MBeanNotificationInfo.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/MBeanNotificationInfo.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.Serializable;
+
+import mx4j.util.Utils;
+
+/**
+ * Metadata class for MBean notifications.
+ *
+ * @version $Revision$
+ */
+// Change not needed, workaround to a TCK bug only to achieve TCK compliance
+// public class MBeanNotificationInfo extends MBeanFeatureInfo implements Cloneable
+public class MBeanNotificationInfo extends MBeanFeatureInfo implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = -3888371564530107064L;
+
+ /**
+ * @serial The notification types
+ */
+ private String[] types;
+
+ /**
+ * Creates a new MBeanNotificationInfo
+ *
+ * @param notifsType The types
+ * @param name The classname of the Notifications emitted
+ * @param description The description for these notifications
+ */
+ public MBeanNotificationInfo(String[] notifsType, String name, String description) throws IllegalArgumentException
+ {
+ super(name, description);
+ this.types = notifsType == null ? new String[0] : notifsType;
+ }
+
+ public Object clone()
+ {
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException ignored)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Returns the types of the notifications emitted.
+ */
+ public String[] getNotifTypes()
+ {
+ return types;
+ }
+
+ public int hashCode()
+ {
+ return super.hashCode() + 29 * Utils.arrayHashCode(getNotifTypes());
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!super.equals(obj)) return false;
+ if (!(obj instanceof MBeanNotificationInfo)) return false;
+
+ MBeanNotificationInfo other = (MBeanNotificationInfo)obj;
+ return Utils.arrayEquals(getNotifTypes(), other.getNotifTypes());
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanNotificationInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanOperationInfo.java (from rev 2244, trunk/mx4j/src/core/javax/management/MBeanOperationInfo.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/MBeanOperationInfo.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/MBeanOperationInfo.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+import mx4j.util.Utils;
+
+/**
+ * Metadata class for an MBean operation
+ *
+ * @version $Revision$
+ */
+// Change not needed, workaround to a TCK bug only to achieve TCK compliance
+// public class MBeanOperationInfo extends MBeanFeatureInfo implements Cloneable
+public class MBeanOperationInfo extends MBeanFeatureInfo implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = -6178860474881375330L;
+
+ /**
+ * This impact means the operation is read-like.
+ */
+ public static final int INFO = 0;
+ /**
+ * This impact means the operation is write-like.
+ */
+ public static final int ACTION = 1;
+ /**
+ * This impact means the operation is both read-like and write-like.
+ */
+ public static final int ACTION_INFO = 2;
+ /**
+ * This impact means the operation impact is unknown.
+ */
+ public static final int UNKNOWN = 3;
+
+ /**
+ * @serial The operation signature
+ */
+ private MBeanParameterInfo[] signature;
+ /**
+ * The operation return type
+ */
+ private String type;
+ /**
+ * The operation impact
+ */
+ private int impact;
+
+ /**
+ * Creates a new MBeanOperationInfo.
+ *
+ * @param description The operation description
+ * @param method The method
+ */
+ public MBeanOperationInfo(String description, Method method) throws IllegalArgumentException
+ {
+ super(method.getName(), description);
+ Class[] params = method.getParameterTypes();
+ this.signature = new MBeanParameterInfo[params.length];
+ for (int i = 0; i < params.length; ++i)
+ {
+ this.signature[i] = new MBeanParameterInfo("", params[i].getName(), "");
+ }
+ this.type = method.getReturnType().getName();
+ this.impact = UNKNOWN;
+ }
+
+ /**
+ * Creates a new MBeanOperationInfo
+ *
+ * @param name The operation name
+ * @param description The operation description
+ * @param signature The operation signature
+ * @param type The operation return type
+ * @param impact The operation impact
+ */
+ public MBeanOperationInfo(String name, String description, MBeanParameterInfo[] signature, String type, int impact) throws IllegalArgumentException
+ {
+ super(name, description);
+ this.signature = signature == null ? new MBeanParameterInfo[0] : signature;
+ this.type = type;
+ this.impact = impact;
+ }
+
+ public Object clone()
+ {
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException ignored)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Returns the return type of the operation
+ */
+ public String getReturnType()
+ {
+ return type;
+ }
+
+ /**
+ * Returns the signature of the operation
+ */
+ public MBeanParameterInfo[] getSignature()
+ {
+ return signature;
+ }
+
+ /**
+ * Returns the impact of the operation
+ */
+ public int getImpact()
+ {
+ return impact;
+ }
+
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+
+ String type = getReturnType();
+ if (type != null) hash = 29 * hash + type.hashCode();
+ hash = 29 * hash + Utils.arrayHashCode(getSignature());
+ hash = 29 * hash + getImpact();
+
+ return hash;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!super.equals(obj)) return false;
+ if (!(obj instanceof MBeanOperationInfo)) return false;
+
+ MBeanOperationInfo other = (MBeanOperationInfo)obj;
+
+ String thisType = getReturnType();
+ String otherType = other.getReturnType();
+ if (thisType != null ? !thisType.equals(otherType) : otherType != null) return false;
+ if (!Utils.arrayEquals(getSignature(), other.getSignature())) return false;
+ if (getImpact() != other.getImpact()) return false;
+
+ return true;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanOperationInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanParameterInfo.java (from rev 2244, trunk/mx4j/src/core/javax/management/MBeanParameterInfo.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/MBeanParameterInfo.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/MBeanParameterInfo.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.Serializable;
+
+/**
+ * The metadata class for a parameter of MBean constructors and operations.
+ *
+ * @version $Revision$
+ */
+// Change not needed, workaround to a TCK bug only to achieve TCK compliance
+// public class MBeanParameterInfo extends MBeanFeatureInfo implements Cloneable
+public class MBeanParameterInfo extends MBeanFeatureInfo implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = 7432616882776782338L;
+
+ /**
+ * @serial The parameter type
+ */
+ private String type;
+
+ /**
+ * Creates a new MBeanParameterInfo
+ *
+ * @param name The parameter name
+ * @param type The parameter type
+ * @param description The parameter description
+ */
+ public MBeanParameterInfo(String name, String type, String description) throws IllegalArgumentException
+ {
+ super(name, description);
+ this.type = type;
+ }
+
+ public Object clone()
+ {
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException ignored)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Returns the parameter type
+ *
+ * @return
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ String t = getType();
+ if (t != null) hash = 29 * hash + t.hashCode();
+ return hash;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!super.equals(obj)) return false;
+ if (!(obj instanceof MBeanParameterInfo)) return false;
+
+ MBeanParameterInfo other = (MBeanParameterInfo)obj;
+ String thisType = getType();
+ String otherType = other.getType();
+ if (thisType != null ? !thisType.equals(otherType) : otherType != null) return false;
+
+ return true;
+ }
+}
Property changes on: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanParameterInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/mx4j/jsr003/src/main/java/javax/management/MBeanPermission.java (from rev 2244, trunk/mx4j/src/core/javax/management/MBeanPermission.java)
===================================================================
--- trunk/mx4j/jsr003/src/main/java/javax/management/MBeanPermission.java (rev 0)
+++ trunk/mx4j/jsr003/src/main/java/javax/management/MBeanPermission.java 2006-11-23 22:06:19 UTC (rev 2247)
@@ -0,0 +1,435 @@
+/*
+ * Copyright (C) The MX4J Contributors.
+ * All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0.
+ * See the terms of the MX4J License in the documentation provided with this software.
+ */
+
+package javax.management;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.security.Permission;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.StringTokenizer;
+
+import mx4j.util.Utils;
+
+/**
+ * Permission that control access to MBeanServer methods. <br>
+ * The MBeanPermission contains a target name and a comma separated list of target actions.
+ * The target name is composed by:
+ * <ul>
+ * <li> the class name of the MBean, as returned by
+ * {@link javax.management.MBeanInfo#getClassName MBeanInfo.getClassName()} </li>
+ * <li> the pound character '#' </li>
+ * <li> the attribute name or the operation name </li>
+ * <li> the object name of the MBean inclosed in squared brackets </li>
+ * </ul>
+ * When used in the target name, the wildcard '*' may be used to specify packages, classes or methods as a whole. <br>
+ * When used in the actions, the wildcard '*' indicates all actions. <br>
+ * An example of policy file is the following:
+ * <pre>
+ * grant codebase my-jmx-application.jar
+ * {
+ * permission javax.management.MBeanPermission "mx4j.tools.naming.NamingService", "instantiate, registerMBean, unregisterMBean";
+ * permission javax.management.MBeanPermission "mx4j.tools.naming.NamingService#start", "invoke";
+ * permission javax.management.MBeanPermission "mx4j.tools.naming.NamingService#stop", "invoke";
+ * }
+ * </pre>
+ *
+ * @version $Revision$
+ */
+public class MBeanPermission extends Permission
+{
+ private static final long serialVersionUID = 0xde755825e2a117abL;
+
+ private static final String WILDCARD = "*";
+ private static final String NILCARD = "-";
+
+ /**
+ * @serial The permission actions
+ */
+ private String actions;
+
+ private transient int hash;
+ private transient String className;
+ private transient String memberName;
+ private transient ObjectName objectName;
+ private transient ArrayList actionsList;
+
+ /**
+ * Creates a new MBeanPermission
+ *
+ * @param name The target name
+ * @param actions The comma separated list of actions
+ */
+ public MBeanPermission(String name, String actions)
+ {
+ super(name);
+ this.actions = actions;
+
+ parse(name, actions);
+ }
+
+ /**
+ * Creates a new MBeanPermission. If the parts composing the target name are all specified as null,
+ * the wildcard target name '*' is assumed.
+ *
+ * @param className The className part of the target name, may be null
+ * @param memberName The memberName part of the target name, may be null
+ * @param objectName The ObjectName part of the target name, may be null
+ * @param actions The comma separated list of actions
+ */
+ public MBeanPermission(String className, String memberName, ObjectName objectName, String actions)
+ {
+ this(createTargetName(className, memberName, objectName), actions);
+ }
+
+ private static String createTargetName(String className, String memberName, ObjectName objectName)
+ {
+ StringBuffer target = new StringBuffer();
+
+ target.append(className == null ? "-" : className);
+ target.append('#');
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV