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 2006/06/19 01:52:24 UTC
svn commit: r415217 - in /geronimo/branches/dain/openejb-2.2-merge/modules:
core/src/java/org/apache/geronimo/core/service/
core/src/java/org/apache/geronimo/proxy/
security/src/java/org/apache/geronimo/security/remoting/jmx/
Author: dain
Date: Sun Jun 18 16:52:23 2006
New Revision: 415217
URL: http://svn.apache.org/viewvc?rev=415217&view=rev
Log:
svn merge -r 378161:378162 https://svn.apache.org/repos/asf/geronimo/trunk@378162
dblevins 2006-02-15 21:07:50 -0800 (Wed, 15 Feb 2006)
Cleaned tons of unused code. Most of it existed around ProxyContainer, and only 5 lines of it was needed.
Added:
geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/MarshalledMethod.java
- copied unchanged from r378162, geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/MarshalledMethod.java
geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/ReflexiveInterceptor.java
- copied unchanged from r378162, geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/ReflexiveInterceptor.java
geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/SerializableInvocation.java
- copied unchanged from r378162, geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/SerializableInvocation.java
Removed:
geronimo/branches/dain/openejb-2.2-merge/modules/core/src/java/org/apache/geronimo/core/service/Component.java
geronimo/branches/dain/openejb-2.2-merge/modules/core/src/java/org/apache/geronimo/core/service/Container.java
geronimo/branches/dain/openejb-2.2-merge/modules/core/src/java/org/apache/geronimo/core/service/InvocationType.java
geronimo/branches/dain/openejb-2.2-merge/modules/core/src/java/org/apache/geronimo/core/service/RPCContainer.java
geronimo/branches/dain/openejb-2.2-merge/modules/core/src/java/org/apache/geronimo/core/service/SimpleInvocation.java
geronimo/branches/dain/openejb-2.2-merge/modules/core/src/java/org/apache/geronimo/core/service/StackThreadLocal.java
geronimo/branches/dain/openejb-2.2-merge/modules/core/src/java/org/apache/geronimo/core/service/StringInvocationKey.java
geronimo/branches/dain/openejb-2.2-merge/modules/core/src/java/org/apache/geronimo/proxy/
Modified:
geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java
geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java
geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java
Modified: geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java?rev=415217&r1=415216&r2=415217&view=diff
==============================================================================
--- geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java (original)
+++ geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java Sun Jun 18 16:52:23 2006
@@ -20,8 +20,8 @@
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.lang.reflect.Proxy;
-import org.apache.geronimo.proxy.ProxyContainer;
import org.apache.geronimo.security.jaas.server.JaasLoginServiceMBean;
@@ -49,9 +49,8 @@
// Setup the client side container..
RequestChannelInterceptor remoteInterceptor = new RequestChannelInterceptor(target, cl);
- ProxyContainer clientContainer = new ProxyContainer(remoteInterceptor);
- return (JaasLoginServiceMBean) clientContainer.createProxy(cl , new Class[]{JaasLoginServiceMBean.class});
-
+ Class[] interfaces = new Class[]{JaasLoginServiceMBean.class};
+ return (JaasLoginServiceMBean) Proxy.newProxyInstance(cl, interfaces, remoteInterceptor);
}
}
Modified: geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java?rev=415217&r1=415216&r2=415217&view=diff
==============================================================================
--- geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java (original)
+++ geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java Sun Jun 18 16:52:23 2006
@@ -43,7 +43,6 @@
import org.apache.geronimo.gbean.GBeanLifecycle;
import org.apache.geronimo.kernel.ObjectNameUtil;
import org.apache.geronimo.management.geronimo.NetworkConnector;
-import org.apache.geronimo.proxy.ReflexiveInterceptor;
import org.apache.geronimo.security.jaas.server.JaasLoginServiceMBean;
Modified: geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java?rev=415217&r1=415216&r2=415217&view=diff
==============================================================================
--- geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java (original)
+++ geronimo/branches/dain/openejb-2.2-merge/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java Sun Jun 18 16:52:23 2006
@@ -22,6 +22,8 @@
import java.io.ObjectOutputStream;
import java.net.URI;
import java.net.URISyntaxException;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
import org.activeio.Packet;
import org.activeio.RequestChannel;
@@ -42,7 +44,7 @@
/**
* @version $Rev$ $Date$
*/
-public class RequestChannelInterceptor implements Interceptor {
+public class RequestChannelInterceptor implements Interceptor, InvocationHandler {
private final ClassLoader cl;
private final URI target;
@@ -52,6 +54,16 @@
this.cl = cl;
}
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ Invocation invocation = new SerializableInvocation(method, args, proxy);
+ InvocationResult result = invoke(invocation);
+ if( result.isException() ) {
+ throw result.getException();
+ }
+ return result.getResult();
+ }
+
public InvocationResult invoke(Invocation invocation) throws Throwable {
ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();
@@ -59,18 +71,18 @@
RequestChannel channel = createRequestChannel(target);
Packet response;
- try {
+ try {
channel.start();
Packet request = serialize(invocation);
response = channel.request(request, Service.WAIT_FOREVER_TIMEOUT);
} finally {
- channel.dispose();
+ channel.dispose();
}
-
+
Object obj;
- try {
+ try {
obj = deserialize(response, cl);
- } catch ( ClassNotFoundException e ) {
+ } catch ( ClassNotFoundException e ) {
// Weird.
Thread.currentThread().setContextClassLoader(RequestChannelInterceptor.class.getClassLoader());
response.clear();
@@ -82,20 +94,20 @@
throw ((RequestChannelInterceptorInvoker.ThrowableWrapper) obj).exception;
}
return (InvocationResult)obj;
-
+
} finally {
Thread.currentThread().setContextClassLoader(originalLoader);
}
}
-
+
private static RequestChannel createRequestChannel(URI target) throws IOException, URISyntaxException {
SocketSyncChannelFactory factory = new SocketSyncChannelFactory();
SyncChannel channel = factory.openSyncChannel(target);
SocketMetadata socket = (SocketMetadata) channel.narrow(SocketMetadata.class);
socket.setTcpNoDelay(true);
return new AsyncChannelToClientRequestChannel(
- new PacketAggregatingSyncChannel(
- channel));
+ new PacketAggregatingSyncChannel(
+ channel));
}
/**