geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r417891 [2/2] - in /geronimo/trunk: ./ configs/activemq/ configs/client-corba/ configs/client-corba/src/plan/ configs/client-deployer/ configs/client/ configs/console-jetty/ configs/j2ee-corba/src/plan/ configs/j2ee-deployer/ configs/j2ee-d...
Date Wed, 28 Jun 2006 22:45:10 GMT
Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java?rev=417891&r1=417890&r2=417891&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java
(original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java
Wed Jun 28 15:45:07 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;
@@ -34,15 +36,15 @@
 import org.activeio.net.SocketSyncChannelFactory;
 import org.activeio.packet.ByteArrayPacket;
 
-import org.apache.geronimo.core.service.Interceptor;
-import org.apache.geronimo.core.service.Invocation;
-import org.apache.geronimo.core.service.InvocationResult;
+import org.apache.geronimo.interceptor.Interceptor;
+import org.apache.geronimo.interceptor.Invocation;
+import org.apache.geronimo.interceptor.InvocationResult;
 import org.apache.geronimo.kernel.ObjectInputStreamExt;
 
 /**
  * @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));
     }
 
     /**

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptorInvoker.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptorInvoker.java?rev=417891&r1=417890&r2=417891&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptorInvoker.java
(original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptorInvoker.java
Wed Jun 28 15:45:07 2006
@@ -24,9 +24,9 @@
 import org.activeio.RequestListener;
 import org.activeio.packet.EmptyPacket;
 
-import org.apache.geronimo.core.service.Interceptor;
-import org.apache.geronimo.core.service.Invocation;
-import org.apache.geronimo.core.service.InvocationResult;
+import org.apache.geronimo.interceptor.Interceptor;
+import org.apache.geronimo.interceptor.Invocation;
+import org.apache.geronimo.interceptor.InvocationResult;
 
 /**
  * @version $Rev$ $Date$
@@ -61,29 +61,29 @@
         Thread currentThread = Thread.currentThread();
         ClassLoader orig = currentThread.getContextClassLoader();
         try {
-            
+
             Invocation marshalledInvocation;
-            
+
             try {
                 currentThread.setContextClassLoader(classloader);
                 marshalledInvocation = (Invocation) RequestChannelInterceptor.deserialize(request,classloader);
             } catch (Throwable e) {
                 // Could not deserialize the invocation...
                 e.printStackTrace();
-                return RequestChannelInterceptor.serialize(new ThrowableWrapper(e));    
           
+                return RequestChannelInterceptor.serialize(new ThrowableWrapper(e));
             }
 
             try {
                 InvocationResult rc = next.invoke(marshalledInvocation);
-                return RequestChannelInterceptor.serialize(rc);                
+                return RequestChannelInterceptor.serialize(rc);
             } catch (Throwable e) {
-                return RequestChannelInterceptor.serialize(new ThrowableWrapper(e));    
           
+                return RequestChannelInterceptor.serialize(new ThrowableWrapper(e));
             }
 
-            
+
         } catch (IOException e) {
             // TODO: handle this.
-            return EmptyPacket.EMPTY_PACKET;            
+            return EmptyPacket.EMPTY_PACKET;
         } finally {
             currentThread.setContextClassLoader(orig);
         }

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=417891&r1=417890&r2=417891&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
Wed Jun 28 15:45:07 2006
@@ -198,6 +198,7 @@
                 repositories,
                 new AbstractNameQuery(serverName),
                 moduleName,
+                null,
                 new AbstractNameQuery(tcmName),
                 new AbstractNameQuery(ctcName),
                 null,

Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java?rev=417891&r1=417890&r2=417891&view=diff
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
(original)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
Wed Jun 28 15:45:07 2006
@@ -17,6 +17,20 @@
 
 package org.apache.geronimo.transaction.context;
 
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import javax.resource.spi.XATerminator;
+import javax.transaction.InvalidTransactionException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.transaction.ExtendedTransactionManager;
@@ -24,15 +38,6 @@
 import org.apache.geronimo.transaction.XAWork;
 import org.apache.geronimo.transaction.manager.XidImporter;
 
-import javax.resource.spi.XATerminator;
-import javax.transaction.*;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
 /**
  * @version $Rev$ $Date$
  */
@@ -82,7 +87,7 @@
 
     public TransactionContext newBeanTransactionContext(long transactionTimeoutMilliseconds)
throws NotSupportedException, SystemException {
         TransactionContext ctx = getContext();
-        if (ctx instanceof UnspecifiedTransactionContext == false) {
+        if (!(ctx instanceof UnspecifiedTransactionContext)) {
             throw new NotSupportedException("Previous Transaction has not been committed");
         }
         UnspecifiedTransactionContext oldContext = (UnspecifiedTransactionContext) ctx;

Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/UserTransactionImpl.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/UserTransactionImpl.java?rev=417891&r1=417890&r2=417891&view=diff
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/UserTransactionImpl.java
(original)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/UserTransactionImpl.java
Wed Jun 28 15:45:07 2006
@@ -40,10 +40,15 @@
         protected Object initialValue() {
             return OFFLINE;
         }
-    };
+    }
 
     public UserTransactionImpl() {
         state.set(OFFLINE);
+    }
+
+    public UserTransactionImpl(TransactionContextManager transactionContextManager, TrackedConnectionAssociator
trackedConnectionAssociator) {
+        state.set(OFFLINE);
+        ONLINE.setUp(transactionContextManager, trackedConnectionAssociator);
     }
 
     public void setUp(TransactionContextManager transactionContextManager, TrackedConnectionAssociator
trackedConnectionAssociator) {

Modified: geronimo/trunk/modules/webservices/project.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/webservices/project.xml?rev=417891&r1=417890&r2=417891&view=diff
==============================================================================
--- geronimo/trunk/modules/webservices/project.xml (original)
+++ geronimo/trunk/modules/webservices/project.xml Wed Jun 28 15:45:07 2006
@@ -65,6 +65,12 @@
 
         <dependency>
             <groupId>geronimo</groupId>
+            <artifactId>geronimo-interceptor</artifactId>
+            <version>${geronimo_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
             <artifactId>geronimo-kernel</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>

Modified: geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/MessageContextInvocationKey.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/MessageContextInvocationKey.java?rev=417891&r1=417890&r2=417891&view=diff
==============================================================================
--- geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/MessageContextInvocationKey.java
(original)
+++ geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/MessageContextInvocationKey.java
Wed Jun 28 15:45:07 2006
@@ -16,7 +16,7 @@
  */
 package org.apache.geronimo.webservices;
 
-import org.apache.geronimo.core.service.InvocationKey;
+import org.apache.geronimo.interceptor.InvocationKey;
 
 /**
  * @version $Rev$ $Date$



Mime
View raw message