Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 55179 invoked from network); 28 Jun 2006 22:45:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Jun 2006 22:45:40 -0000 Received: (qmail 54264 invoked by uid 500); 28 Jun 2006 22:45:40 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 54114 invoked by uid 500); 28 Jun 2006 22:45:39 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 54102 invoked by uid 99); 28 Jun 2006 22:45:39 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2006 15:45:39 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2006 15:45:38 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 375CC1A9842; Wed, 28 Jun 2006 15:45:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: scm@geronimo.apache.org From: dain@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060628224518.375CC1A9842@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 @@ geronimo + geronimo-interceptor + ${geronimo_version} + + + + geronimo geronimo-kernel ${pom.currentVersion} 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$