You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by da...@apache.org on 2004/05/27 00:58:30 UTC
cvs commit: incubator-geronimo/modules/remoting/src/test/org/apache/geronimo/remoting JMXRemotingTestMain.java
dain 2004/05/26 15:58:30
Modified: modules/kernel/src/java/org/apache/geronimo/gbean
DynamicGBeanDelegate.java GBeanInfoFactory.java
modules/kernel/src/java/org/apache/geronimo/gbean/jmx
GBeanMBean.java ProxyMethodInterceptor.java
Added: modules/kernel/src/java/org/apache/geronimo/gbean
GOperationSignature.java
Removed: modules/kernel/src/java/org/apache/geronimo/kernel/deployment/client
DeploymentNotification.java
modules/kernel/src/java/org/apache/geronimo/kernel/jmx
InterfaceCallbackFilter.java InvokeMBean.java
JMXKernel.java MBeanOperationSignature.java
MBeanProxyCallback.java
modules/remoting/src/test/org/apache/geronimo/remoting
JMXRemotingTestMain.java
Log:
Removed unused classes
Moved MBeanOperationSignature to GOperationSignature in gbean package
Revision Changes Path
1.6 +3 -5 incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGBeanDelegate.java
Index: DynamicGBeanDelegate.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGBeanDelegate.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DynamicGBeanDelegate.java 10 Mar 2004 09:59:00 -0000 1.5
+++ DynamicGBeanDelegate.java 26 May 2004 22:58:30 -0000 1.6
@@ -22,8 +22,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.geronimo.kernel.jmx.MBeanOperationSignature;
-
import net.sf.cglib.reflect.FastClass;
import net.sf.cglib.reflect.FastMethod;
@@ -91,7 +89,7 @@
for (int i = 0; i < parameters.length; i++) {
types[i] = parameters[i].getName();
}
- MBeanOperationSignature key = new MBeanOperationSignature(method.getName(), types);
+ GOperationSignature key = new GOperationSignature(method.getName(), types);
operations.put(key, new Operation(target, method));
}
@@ -125,7 +123,7 @@
}
public Object invoke(String name, Object[] arguments, String[] types) throws Exception {
- Operation operation = (Operation) operations.get(new MBeanOperationSignature(name, types));
+ Operation operation = (Operation) operations.get(new GOperationSignature(name, types));
if (operation == null) {
throw new IllegalArgumentException("Unknown attribute " + name);
}
1.18 +3 -4 incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoFactory.java
Index: GBeanInfoFactory.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoFactory.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- GBeanInfoFactory.java 18 Mar 2004 10:04:50 -0000 1.17
+++ GBeanInfoFactory.java 26 May 2004 22:58:30 -0000 1.18
@@ -25,7 +25,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.geronimo.kernel.jmx.MBeanOperationSignature;
/**
* @version $Revision$ $Date$
@@ -85,7 +84,7 @@
if (sourceOperations != null && !sourceOperations.isEmpty()) {
for (Iterator it = sourceOperations.iterator(); it.hasNext();) {
GOperationInfo operationInfo = (GOperationInfo) it.next();
- operations.put(new MBeanOperationSignature(operationInfo.getName(),
+ operations.put(new GOperationSignature(operationInfo.getName(),
operationInfo.getParameterList()), operationInfo);
}
}
@@ -182,7 +181,7 @@
}
public void addOperation(GOperationInfo operationInfo) {
- operations.put(new MBeanOperationSignature(operationInfo.getName(), operationInfo.getParameterList()),
+ operations.put(new GOperationSignature(operationInfo.getName(), operationInfo.getParameterList()),
operationInfo);
}
1.1 incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/GOperationSignature.java
Index: GOperationSignature.java
===================================================================
/**
*
* Copyright 2003-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.geronimo.gbean;
import java.lang.reflect.Method;
import java.util.List;
import javax.management.MBeanOperationInfo;
import javax.management.MBeanParameterInfo;
/**
* This is a key class based on a MBean operation name and parameters.
*
* @version $Revision: 1.1 $ $Date: 2004/05/26 22:58:30 $
*/
public final class GOperationSignature {
private final static String[] NO_TYPES = new String[0];
private final String name;
private final String[] argumentTypes;
public GOperationSignature(Method method) {
name = method.getName();
Class[] parameters = method.getParameterTypes();
argumentTypes = new String[parameters.length];
for (int i = 0; i < parameters.length; i++) {
argumentTypes[i] = parameters[i].getName();
}
}
public GOperationSignature(MBeanOperationInfo operationInfo) {
name = operationInfo.getName();
MBeanParameterInfo[] parameters = operationInfo.getSignature();
argumentTypes = new String[parameters.length];
for (int i = 0; i < parameters.length; i++) {
argumentTypes[i] = parameters[i].getType();
}
}
public GOperationSignature(String name, String[] argumentTypes) {
this.name = name;
if (argumentTypes != null) {
this.argumentTypes = argumentTypes;
} else {
this.argumentTypes = NO_TYPES;
}
}
public GOperationSignature(String name, List argumentTypes) {
this.name = name;
if (argumentTypes != null) {
this.argumentTypes = new String[argumentTypes.size()];
for (int i = 0; i < argumentTypes.size(); i++) {
this.argumentTypes[i] = (String) argumentTypes.get(i);
}
} else {
this.argumentTypes = NO_TYPES;
}
}
public boolean equals(Object object) {
if (!(object instanceof GOperationSignature)) {
return false;
}
// match names
GOperationSignature methodKey = (GOperationSignature) object;
if (!methodKey.name.equals(name)) {
return false;
}
// match arg length
int length = methodKey.argumentTypes.length;
if (length != argumentTypes.length) {
return false;
}
// match each arg
for (int i = 0; i < length; i++) {
if (!methodKey.argumentTypes[i].equals(argumentTypes[i])) {
return false;
}
}
return true;
}
public int hashCode() {
int result = 17;
result = 37 * result + name.hashCode();
for (int i = 0; i < argumentTypes.length; i++) {
result = 37 * result + argumentTypes[i].hashCode();
}
return result;
}
public String toString() {
StringBuffer buffer = new StringBuffer(name).append("(");
for (int i = 0; i < argumentTypes.length; i++) {
if(i > 0) {
buffer.append(", ");
}
buffer.append(argumentTypes[i]);
}
return buffer.append(")").toString();
}
}
1.16 +6 -5 incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java
Index: GBeanMBean.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- GBeanMBean.java 26 May 2004 03:22:21 -0000 1.15
+++ GBeanMBean.java 26 May 2004 22:58:30 -0000 1.16
@@ -48,7 +48,8 @@
import org.apache.geronimo.gbean.GOperationInfo;
import org.apache.geronimo.gbean.GReferenceInfo;
import org.apache.geronimo.gbean.InvalidConfigurationException;
-import org.apache.geronimo.kernel.jmx.MBeanOperationSignature;
+import org.apache.geronimo.gbean.GOperationSignature;
+import org.apache.geronimo.gbean.GOperationSignature;
import org.apache.geronimo.kernel.management.NotificationType;
/**
@@ -105,7 +106,7 @@
private final GBeanMBeanOperation[] operations;
/**
- * Operations supported by this GBeanMBean by (MBeanOperationSignature) name.
+ * Operations supported by this GBeanMBean by (GOperationSignature) name.
*/
private final Map operationIndex = new HashMap();
@@ -201,7 +202,7 @@
operations = (GBeanMBeanOperation[]) operationsSet.toArray(new GBeanMBeanOperation[beanInfo.getOperations().size()]);
for (int i = 0; i < operations.length; i++) {
GBeanMBeanOperation operation = operations[i];
- MBeanOperationSignature signature = new MBeanOperationSignature(operation.getName(), operation.getParameterTypes());
+ GOperationSignature signature = new GOperationSignature(operation.getName(), operation.getParameterTypes());
operationIndex.put(signature, new Integer(i));
}
@@ -541,7 +542,7 @@
}
public Object invoke(String methodName, Object[] arguments, String[] types) throws ReflectionException {
- MBeanOperationSignature signature = new MBeanOperationSignature(methodName, types);
+ GOperationSignature signature = new GOperationSignature(methodName, types);
Integer index = (Integer) operationIndex.get(signature);
if (index == null) {
throw new ReflectionException(new NoSuchMethodException("Unknown operation " + signature));
1.11 +7 -6 incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/ProxyMethodInterceptor.java
Index: ProxyMethodInterceptor.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/ProxyMethodInterceptor.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ProxyMethodInterceptor.java 26 May 2004 03:22:21 -0000 1.10
+++ ProxyMethodInterceptor.java 26 May 2004 22:58:30 -0000 1.11
@@ -30,7 +30,8 @@
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
import net.sf.cglib.reflect.FastClass;
-import org.apache.geronimo.kernel.jmx.MBeanOperationSignature;
+import org.apache.geronimo.gbean.GOperationSignature;
+import org.apache.geronimo.gbean.GOperationSignature;
import org.objectweb.asm.Type;
/**
@@ -151,8 +152,8 @@
}
private GBeanInvoker createRawGBeanInvoker(RawInvoker rawInvoker, Method method, Map operations, Map attributes) {
- if (operations.containsKey(new MBeanOperationSignature(method))) {
- int methodIndex = ((Integer) operations.get(new MBeanOperationSignature(method))).intValue();
+ if (operations.containsKey(new GOperationSignature(method))) {
+ int methodIndex = ((Integer) operations.get(new GOperationSignature(method))).intValue();
return new RawGBeanInvoker(rawInvoker, methodIndex, GBeanInvoker.OPERATION);
}
@@ -200,7 +201,7 @@
Map operations = new HashMap(operationInfos.length);
for (int i = 0; i < operationInfos.length; i++) {
MBeanOperationInfo operationInfo = operationInfos[i];
- operations.put(new MBeanOperationSignature(operationInfo), operationInfo);
+ operations.put(new GOperationSignature(operationInfo), operationInfo);
}
// build the method lookup table
@@ -219,7 +220,7 @@
}
private GBeanInvoker createJMXGBeanInvoker(MBeanServer server, Method method, Map operations, Map attributes) {
- if (operations.containsKey(new MBeanOperationSignature(method))) {
+ if (operations.containsKey(new GOperationSignature(method))) {
return new JMXGBeanInvoker(server, method, GBeanInvoker.OPERATION);
}