[jboss-remoting-commits] JBoss Remoting SVN: r4810 - in remoting-txn/trunk/src/main/java/org/jboss/remoting/txn: impl and 2 other directories.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Wed Jan 14 19:08:49 EST 2009


Author: david.lloyd at jboss.com
Date: 2009-01-14 19:08:49 -0500 (Wed, 14 Jan 2009)
New Revision: 4810

Added:
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/TransactionalClientImpl.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/TransactionalClientSourceImpl.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/WrappingRequestHandler.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/AbstractTxnReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnGetResourceManagerIdReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnGetTimeoutReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnPrepareReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnRecoverReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnSetTimeoutReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnSuccessfulReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/AbstractTxnRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnCommitRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnEndRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnForgetRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnGetResourceManagerIdRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnGetTimeoutRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnPrepareRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRecoverRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRequestVisitor.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRollbackRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnSetTimeoutRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnStartRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnWrappedRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXACommitRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXARollbackRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXAStartRequest.java
Removed:
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/AbstractTxnReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/AbstractTxnRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TransactionalClientImpl.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TransactionalClientSourceImpl.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnCommitRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnEndRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnForgetRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetResourceManagerIdReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetResourceManagerIdRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetTimeoutReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetTimeoutRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnPrepareReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnPrepareRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRecoverReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRecoverRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRequestVisitor.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRollbackRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSetTimeoutReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSetTimeoutRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnStartRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSuccessfulReply.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnWrappedRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXACommitRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXARollbackRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXAStartRequest.java
   remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/WrappingRequestHandler.java
Log:
Organize into packages

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/AbstractTxnReply.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/AbstractTxnReply.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/AbstractTxnReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,30 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public abstract class AbstractTxnReply {
-
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/AbstractTxnRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/AbstractTxnRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/AbstractTxnRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,30 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public abstract class AbstractTxnRequest {
-    public abstract <I, O> O accept(TxnRequestVisitor<I, O> visitor, I param);
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TransactionalClientImpl.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TransactionalClientImpl.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TransactionalClientImpl.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,189 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-import java.io.IOException;
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ConcurrentMap;
-
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.Xid;
-
-import org.jboss.xnio.IoFuture;
-import org.jboss.xnio.IoUtils;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.CloseHandler;
-import org.jboss.remoting.RemoteExecutionException;
-
-/**
- *
- */
-public final class TransactionalClientImpl<I, O> implements TransactionalClient<I, O> {
-
-    private final Client<I, O> realClient;
-    private final Client<AbstractTxnRequest, AbstractTxnReply> txnClient;
-
-    private RemotingXAResource remotingXAResource;
-
-    TransactionalClientImpl(final Client<I, O> realClient, final Client<AbstractTxnRequest, AbstractTxnReply> txnClient) throws IOException {
-        this.realClient = realClient;
-        this.txnClient = txnClient;
-        remotingXAResource = new RemotingXAResource(txnClient);
-    }
-
-    private static XAException xaException(IOException ex) {
-        try {
-            throw ex;
-        } catch (RemoteExecutionException e) {
-            try {
-                throw e.getCause();
-            } catch (XAException xae) {
-                return xae;
-            } catch (Throwable throwable) {
-                final XAException xae = new XAException(XAException.XA_RBPROTO);
-                xae.initCause(e);
-                return xae;
-            }
-        } catch (IOException e) {
-            final XAException xae = new XAException(XAException.XA_RBPROTO);
-            xae.initCause(e);
-            return xae;
-        }
-    }
-
-    private static AbstractTxnReply doInvoke(Client<AbstractTxnRequest, AbstractTxnReply> txnClient, AbstractTxnRequest request) throws XAException {
-        try {
-            return txnClient.invoke(request);
-        } catch (IOException e) {
-            throw xaException(e);
-        }
-    }
-
-    public void start() throws IOException {
-        txnClient.invoke(TxnStartRequest.INSTANCE);
-    }
-
-    public void commit() throws IOException {
-        txnClient.invoke(TxnCommitRequest.INSTANCE);
-    }
-
-    public void rollback() throws IOException {
-        txnClient.invoke(TxnRollbackRequest.INSTANCE);
-    }
-
-    public XAResource getXaResource() {
-        return remotingXAResource;
-    }
-
-    public O invoke(final I request) throws IOException, CancellationException {
-        return realClient.invoke(request);
-    }
-
-    public IoFuture<? extends O> send(final I request) throws IOException {
-        return realClient.send(request);
-    }
-
-    public ConcurrentMap<Object, Object> getAttributes() {
-        return realClient.getAttributes();
-    }
-
-    public void close() throws IOException {
-        try {
-            realClient.close();
-            txnClient.close();
-        } finally {
-            IoUtils.safeClose(txnClient);
-        }
-    }
-
-    public Key addCloseHandler(final CloseHandler<? super Client<I, O>> handler) {
-        return realClient.addCloseHandler(new CloseHandler<Client<I, O>>() {
-            public void handleClose(final Client<I, O> closed) {
-                handler.handleClose(TransactionalClientImpl.this);
-            }
-        });
-    }
-
-    /**
-     *
-     */
-    public static final class RemotingXAResource implements XAResource {
-        private final Client<AbstractTxnRequest, AbstractTxnReply> txnClient;
-        private final IoFuture<? extends TxnGetResourceManagerIdReply> futureIdReply;
-
-        public RemotingXAResource(final Client<AbstractTxnRequest, AbstractTxnReply> client) throws IOException {
-            txnClient = client;
-            futureIdReply = IoUtils.cast(txnClient.send(TxnGetResourceManagerIdRequest.INSTANCE), TxnGetResourceManagerIdReply.class);
-        }
-
-        public void commit(final Xid xid, final boolean onePhase) throws XAException {
-            doInvoke(txnClient, new TxnXACommitRequest(xid, onePhase));
-        }
-
-        public void end(final Xid xid, final int flags) throws XAException {
-            doInvoke(txnClient, new TxnEndRequest(xid, flags));
-        }
-
-        public void forget(final Xid xid) throws XAException {
-            doInvoke(txnClient, new TxnForgetRequest(xid));
-        }
-
-        public int getTransactionTimeout() throws XAException {
-            return ((TxnGetTimeoutReply) doInvoke(txnClient, TxnGetTimeoutRequest.INSTANCE)).getTimeout();
-        }
-
-        public boolean isSameRM(final XAResource resource) throws XAException {
-            if (resource instanceof RemotingXAResource) {
-                final RemotingXAResource xaResource = (RemotingXAResource) resource;
-                try {
-                    return futureIdReply.get().getId().equals(xaResource.futureIdReply.get().getId());
-                } catch (IOException e) {
-                    throw xaException(e);
-                }
-            } else {
-                return false;
-            }
-        }
-
-        public int prepare(final Xid xid) throws XAException {
-            return ((TxnPrepareReply) doInvoke(txnClient, new TxnPrepareRequest(xid))).getVote();
-        }
-
-        public Xid[] recover(final int flag) throws XAException {
-            return ((TxnRecoverReply) doInvoke(txnClient, new TxnRecoverRequest(flag))).getResources();
-        }
-
-        public void rollback(final Xid xid) throws XAException {
-            doInvoke(txnClient, new TxnXARollbackRequest(xid));
-        }
-
-        public boolean setTransactionTimeout(final int timeout) throws XAException {
-            return ((TxnSetTimeoutReply) doInvoke(txnClient, new TxnSetTimeoutRequest(timeout))).getSuccess();
-        }
-
-        public void start(final Xid xid, final int flags) throws XAException {
-            doInvoke(txnClient, new TxnXAStartRequest(xid, flags));
-        }
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TransactionalClientSourceImpl.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TransactionalClientSourceImpl.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TransactionalClientSourceImpl.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-import java.io.IOException;
-import java.util.concurrent.Executor;
-import org.jboss.remoting.ClientSource;
-import org.jboss.remoting.Endpoint;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.CloseHandler;
-import org.jboss.remoting.spi.RequestHandlerSource;
-import org.jboss.remoting.spi.Handle;
-import org.jboss.remoting.spi.RequestHandler;
-import org.jboss.remoting.spi.AbstractHandleableCloseable;
-import org.jboss.xnio.IoUtils;
-
-/**
- *
- */
-public final class TransactionalClientSourceImpl<I, O> extends AbstractHandleableCloseable<ClientSource<I, O>> implements TransactionalClientSource<I, O> {
-
-    private final Endpoint endpoint;
-    private final RequestHandlerSource requestHandlerSource;
-    private final Class<I> requestClass;
-    private final Class<O> replyClass;
-    private volatile Key key;
-
-    private TransactionalClientSourceImpl(final Executor executor, final Endpoint endpoint, final RequestHandlerSource requestHandlerSource, final Class<I> requestClass, final Class<O> replyClass) {
-        super(executor);
-        this.endpoint = endpoint;
-        this.requestHandlerSource = requestHandlerSource;
-        this.requestClass = requestClass;
-        this.replyClass = replyClass;
-    }
-
-    static <I, O> TransactionalClientSourceImpl<I, O> create(final Executor executor, final Endpoint endpoint, final RequestHandlerSource requestHandlerSource, final Class<I> requestClass, final Class<O> replyClass) {
-        final TransactionalClientSourceImpl<I, O> clientSource = new TransactionalClientSourceImpl<I, O>(executor, endpoint, requestHandlerSource, requestClass, replyClass);
-        final Key key = requestHandlerSource.addCloseHandler(new CloseHandler<RequestHandlerSource>() {
-            public void handleClose(final RequestHandlerSource closed) {
-                IoUtils.safeClose(clientSource);
-            }
-        });
-        clientSource.key = key;
-        return clientSource;
-    }
-
-    protected void closeAction() throws IOException {
-        final Key key = this.key;
-        if (key != null) {
-            key.remove();
-            this.key = null;
-        }
-    }
-
-    public TransactionalClient<I, O> createClient() throws IOException {
-        boolean ok = false;
-        final Handle<RequestHandler> handle = requestHandlerSource.createRequestHandler();
-        try {
-            final RequestHandler requestHandler = handle.getResource();
-            final Client<I, O> realClient = endpoint.createClient(WrappingRequestHandler.create(executor, requestHandler), requestClass, replyClass);
-            try {
-                final Client<AbstractTxnRequest, AbstractTxnReply> txnClient = endpoint.createClient(requestHandler, AbstractTxnRequest.class, AbstractTxnReply.class);
-                try {
-                    handle.close();
-                    final TransactionalClientImpl<I, O> transactionalClient = new TransactionalClientImpl<I, O>(realClient, txnClient);
-                    ok = true;
-                    return transactionalClient;
-                } finally {
-                    if (! ok) IoUtils.safeClose(txnClient);
-                }
-            } finally {
-                if (! ok) IoUtils.safeClose(realClient);
-            }
-        } finally {
-            IoUtils.safeClose(handle);
-        }
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnCommitRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnCommitRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnCommitRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnCommitRequest extends AbstractTxnRequest {
-    public static final TxnCommitRequest INSTANCE = new TxnCommitRequest();
-
-    private TxnCommitRequest() {
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnEndRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnEndRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnEndRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-import javax.transaction.xa.Xid;
-
-/**
- *
- */
-public final class TxnEndRequest extends AbstractTxnRequest {
-
-    public TxnEndRequest(final Xid xid, final int flags) {
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnForgetRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnForgetRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnForgetRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-import javax.transaction.xa.Xid;
-
-/**
- *
- */
-public final class TxnForgetRequest extends AbstractTxnRequest {
-
-    private final Xid xid;
-
-    public TxnForgetRequest(final Xid xid) {
-        this.xid = xid;
-    }
-
-    public Xid getXid() {
-        return xid;
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetResourceManagerIdReply.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetResourceManagerIdReply.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetResourceManagerIdReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnGetResourceManagerIdReply extends AbstractTxnReply {
-    private final Object id;
-
-    public TxnGetResourceManagerIdReply(final Object id) {
-        this.id = id;
-    }
-
-    public Object getId() {
-        return id;
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetResourceManagerIdRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetResourceManagerIdRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetResourceManagerIdRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnGetResourceManagerIdRequest extends AbstractTxnRequest {
-
-    public static final TxnGetResourceManagerIdRequest INSTANCE = new TxnGetResourceManagerIdRequest();
-
-    private TxnGetResourceManagerIdRequest() {
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetTimeoutReply.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetTimeoutReply.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetTimeoutReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnGetTimeoutReply extends AbstractTxnReply {
-
-    private final int timeout;
-
-    public TxnGetTimeoutReply(final int timeout) {
-        this.timeout = timeout;
-    }
-
-    public int getTimeout() {
-        return timeout;
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetTimeoutRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetTimeoutRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetTimeoutRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnGetTimeoutRequest extends AbstractTxnRequest {
-
-    public static final TxnGetTimeoutRequest INSTANCE = new TxnGetTimeoutRequest();
-
-    private TxnGetTimeoutRequest() {
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnPrepareReply.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnPrepareReply.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnPrepareReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnPrepareReply extends AbstractTxnReply {
-    private final int vote;
-
-    public TxnPrepareReply(final int vote) {
-        this.vote = vote;
-    }
-
-    public int getVote() {
-        return vote;
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnPrepareRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnPrepareRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnPrepareRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-import javax.transaction.xa.Xid;
-
-/**
- *
- */
-public final class TxnPrepareRequest extends AbstractTxnRequest {
-
-    private final Xid xid;
-
-    public TxnPrepareRequest(final Xid xid) {
-        this.xid = xid;
-    }
-
-    public Xid getXid() {
-        return xid;
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRecoverReply.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRecoverReply.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRecoverReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-import javax.transaction.xa.Xid;
-
-/**
- *
- */
-public final class TxnRecoverReply extends AbstractTxnReply {
-
-    private final Xid[] resources;
-
-    public TxnRecoverReply(final Xid[] resources) {
-        this.resources = resources;
-    }
-
-    public Xid[] getResources() {
-        return resources;
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRecoverRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRecoverRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRecoverRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnRecoverRequest extends AbstractTxnRequest {
-
-    private final int flag;
-
-    public TxnRecoverRequest(final int flag) {
-        this.flag = flag;
-    }
-
-    public int getFlag() {
-        return flag;
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRequestVisitor.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRequestVisitor.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRequestVisitor.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public interface TxnRequestVisitor<I, O> {
-
-    O visit(TxnXACommitRequest request, I param);
-
-    O visit(TxnEndRequest request, I param);
-
-    O visit(TxnForgetRequest request, I param);
-
-    O visit(TxnGetTimeoutRequest request, I param);
-
-    O visit(TxnPrepareRequest request, I param);
-
-    O visit(TxnRecoverRequest request, I param);
-
-    O visit(TxnXARollbackRequest request, I param);
-
-    O visit(TxnSetTimeoutRequest request, I param);
-
-    O visit(TxnXAStartRequest request, I param);
-
-    O visit(TxnWrappedRequest request, I param);
-
-    O visit(TxnGetResourceManagerIdRequest request, I param);
-
-    O visit(TxnStartRequest request, I param);
-
-    O visit(TxnCommitRequest request, I param);
-
-    O visit(TxnRollbackRequest request, I param);
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRollbackRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRollbackRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRollbackRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnRollbackRequest extends AbstractTxnRequest {
-
-    public static TxnRollbackRequest INSTANCE = new TxnRollbackRequest();
-
-    private TxnRollbackRequest() {
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSetTimeoutReply.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSetTimeoutReply.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSetTimeoutReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnSetTimeoutReply extends AbstractTxnReply {
-
-    private final boolean success;
-
-    public TxnSetTimeoutReply(final boolean success) {
-        this.success = success;
-    }
-
-    public boolean getSuccess() {
-        return success;
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSetTimeoutRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSetTimeoutRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSetTimeoutRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnSetTimeoutRequest extends AbstractTxnRequest {
-
-    private final int timeout;
-
-    public TxnSetTimeoutRequest(final int timeout) {
-        this.timeout = timeout;
-    }
-
-    public int getTimeout() {
-        return timeout;
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnStartRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnStartRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnStartRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnStartRequest extends AbstractTxnRequest {
-
-    public static TxnStartRequest INSTANCE = new TxnStartRequest();
-
-    private TxnStartRequest() {
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSuccessfulReply.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSuccessfulReply.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSuccessfulReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnSuccessfulReply extends AbstractTxnReply {
-    public static final TxnSuccessfulReply INSTANCE = new TxnSuccessfulReply();
-
-    private TxnSuccessfulReply() {
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnWrappedRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnWrappedRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnWrappedRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-/**
- *
- */
-public final class TxnWrappedRequest extends AbstractTxnRequest {
-
-    private final Object wrappedRequest;
-
-    public TxnWrappedRequest(final Object request) {
-        wrappedRequest = request;
-    }
-
-    public Object getWrappedRequest() {
-        return wrappedRequest;
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXACommitRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXACommitRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXACommitRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-import javax.transaction.xa.Xid;
-
-/**
- *
- */
-public final class TxnXACommitRequest extends AbstractTxnRequest {
-    private final Xid xid;
-    private final boolean onePhase;
-
-    public TxnXACommitRequest(final Xid xid, final boolean onePhase) {
-        this.xid = xid;
-        this.onePhase = onePhase;
-    }
-
-    public Xid getXid() {
-        return xid;
-    }
-
-    public boolean isOnePhase() {
-        return onePhase;
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXARollbackRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXARollbackRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXARollbackRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-import javax.transaction.xa.Xid;
-
-/**
- *
- */
-public final class TxnXARollbackRequest extends AbstractTxnRequest {
-
-    private final Xid xid;
-
-    public TxnXARollbackRequest(final Xid xid) {
-        this.xid = xid;
-    }
-
-    public Xid getXid() {
-        return xid;
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXAStartRequest.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXAStartRequest.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXAStartRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-import javax.transaction.xa.Xid;
-
-/**
- *
- */
-public final class TxnXAStartRequest extends AbstractTxnRequest {
-
-    private final Xid xid;
-    private final int flags;
-
-    public TxnXAStartRequest(final Xid xid, final int flags) {
-        this.xid = xid;
-        this.flags = flags;
-    }
-
-    public Xid getXid() {
-        return xid;
-    }
-
-    public int getFlags() {
-        return flags;
-    }
-
-    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
-        return visitor.visit(this, param);
-    }
-}

Deleted: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/WrappingRequestHandler.java
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/WrappingRequestHandler.java	2009-01-14 22:57:56 UTC (rev 4809)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/WrappingRequestHandler.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.remoting.txn;
-
-import org.jboss.remoting.spi.RequestHandler;
-import org.jboss.remoting.spi.RemoteRequestContext;
-import org.jboss.remoting.spi.ReplyHandler;
-import org.jboss.remoting.spi.AbstractAutoCloseable;
-import org.jboss.remoting.spi.Handle;
-import org.jboss.remoting.CloseHandler;
-import org.jboss.xnio.IoUtils;
-import java.util.concurrent.Executor;
-import java.io.IOException;
-
-/**
- *
- */
-public final class WrappingRequestHandler extends AbstractAutoCloseable<RequestHandler> implements RequestHandler {
-
-    private final Handle<RequestHandler> handle;
-    private volatile Key key;
-
-    private WrappingRequestHandler(final Executor executor, final RequestHandler handler) throws IOException {
-        super(executor);
-        handle = handler.getHandle();
-    }
-
-    static WrappingRequestHandler create(final Executor executor, final RequestHandler handler) throws IOException {
-        final WrappingRequestHandler requestHandler = new WrappingRequestHandler(executor, handler);
-        requestHandler.key = requestHandler.handle.addCloseHandler(new CloseHandler<Handle<RequestHandler>>() {
-            public void handleClose(final Handle<RequestHandler> closed) {
-                IoUtils.safeClose(requestHandler);
-            }
-        });
-        return requestHandler;
-    }
-
-    protected void closeAction() throws IOException {
-        try {
-            handle.close();
-        } finally {
-            key.remove();
-            key = null;
-        }
-    }
-
-    public RemoteRequestContext receiveRequest(final Object request, final ReplyHandler replyHandler) {
-        return handle.getResource().receiveRequest(new TxnWrappedRequest(request), replyHandler);
-    }
-}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/TransactionalClientImpl.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TransactionalClientImpl.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/TransactionalClientImpl.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/TransactionalClientImpl.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,210 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.impl;
+
+import java.io.IOException;
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.ConcurrentMap;
+
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.Xid;
+
+import org.jboss.xnio.IoFuture;
+import org.jboss.xnio.IoUtils;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.CloseHandler;
+import org.jboss.remoting.RemoteExecutionException;
+import org.jboss.remoting.txn.request.TxnEndRequest;
+import org.jboss.remoting.txn.request.TxnRollbackRequest;
+import org.jboss.remoting.txn.request.TxnPrepareRequest;
+import org.jboss.remoting.txn.request.TxnGetResourceManagerIdRequest;
+import org.jboss.remoting.txn.request.TxnGetTimeoutRequest;
+import org.jboss.remoting.txn.request.TxnRecoverRequest;
+import org.jboss.remoting.txn.request.TxnForgetRequest;
+import org.jboss.remoting.txn.request.TxnCommitRequest;
+import org.jboss.remoting.txn.request.AbstractTxnRequest;
+import org.jboss.remoting.txn.request.TxnSetTimeoutRequest;
+import org.jboss.remoting.txn.request.TxnXACommitRequest;
+import org.jboss.remoting.txn.request.TxnXARollbackRequest;
+import org.jboss.remoting.txn.request.TxnXAStartRequest;
+import org.jboss.remoting.txn.request.TxnStartRequest;
+import org.jboss.remoting.txn.reply.AbstractTxnReply;
+import org.jboss.remoting.txn.reply.TxnGetResourceManagerIdReply;
+import org.jboss.remoting.txn.reply.TxnGetTimeoutReply;
+import org.jboss.remoting.txn.reply.TxnPrepareReply;
+import org.jboss.remoting.txn.reply.TxnRecoverReply;
+import org.jboss.remoting.txn.reply.TxnSetTimeoutReply;
+import org.jboss.remoting.txn.TransactionalClient;
+
+/**
+ *
+ */
+public final class TransactionalClientImpl<I, O> implements TransactionalClient<I, O> {
+
+    private final Client<I, O> realClient;
+    private final Client<AbstractTxnRequest, AbstractTxnReply> txnClient;
+
+    private RemotingXAResource remotingXAResource;
+
+    TransactionalClientImpl(final Client<I, O> realClient, final Client<AbstractTxnRequest, AbstractTxnReply> txnClient) throws IOException {
+        this.realClient = realClient;
+        this.txnClient = txnClient;
+        remotingXAResource = new RemotingXAResource(txnClient);
+    }
+
+    private static XAException xaException(IOException ex) {
+        try {
+            throw ex;
+        } catch (RemoteExecutionException e) {
+            try {
+                throw e.getCause();
+            } catch (XAException xae) {
+                return xae;
+            } catch (Throwable throwable) {
+                final XAException xae = new XAException(XAException.XA_RBPROTO);
+                xae.initCause(e);
+                return xae;
+            }
+        } catch (IOException e) {
+            final XAException xae = new XAException(XAException.XA_RBPROTO);
+            xae.initCause(e);
+            return xae;
+        }
+    }
+
+    private static AbstractTxnReply doInvoke(Client<AbstractTxnRequest, AbstractTxnReply> txnClient, AbstractTxnRequest request) throws XAException {
+        try {
+            return txnClient.invoke(request);
+        } catch (IOException e) {
+            throw xaException(e);
+        }
+    }
+
+    public void start() throws IOException {
+        txnClient.invoke(TxnStartRequest.INSTANCE);
+    }
+
+    public void commit() throws IOException {
+        txnClient.invoke(TxnCommitRequest.INSTANCE);
+    }
+
+    public void rollback() throws IOException {
+        txnClient.invoke(TxnRollbackRequest.INSTANCE);
+    }
+
+    public XAResource getXaResource() {
+        return remotingXAResource;
+    }
+
+    public O invoke(final I request) throws IOException, CancellationException {
+        return realClient.invoke(request);
+    }
+
+    public IoFuture<? extends O> send(final I request) throws IOException {
+        return realClient.send(request);
+    }
+
+    public ConcurrentMap<Object, Object> getAttributes() {
+        return realClient.getAttributes();
+    }
+
+    public void close() throws IOException {
+        try {
+            realClient.close();
+            txnClient.close();
+        } finally {
+            IoUtils.safeClose(txnClient);
+        }
+    }
+
+    public Key addCloseHandler(final CloseHandler<? super Client<I, O>> handler) {
+        return realClient.addCloseHandler(new CloseHandler<Client<I, O>>() {
+            public void handleClose(final Client<I, O> closed) {
+                handler.handleClose(TransactionalClientImpl.this);
+            }
+        });
+    }
+
+    /**
+     *
+     */
+    public static final class RemotingXAResource implements XAResource {
+        private final Client<AbstractTxnRequest, AbstractTxnReply> txnClient;
+        private final IoFuture<? extends TxnGetResourceManagerIdReply> futureIdReply;
+
+        public RemotingXAResource(final Client<AbstractTxnRequest, AbstractTxnReply> client) throws IOException {
+            txnClient = client;
+            futureIdReply = IoUtils.cast(txnClient.send(TxnGetResourceManagerIdRequest.INSTANCE), TxnGetResourceManagerIdReply.class);
+        }
+
+        public void commit(final Xid xid, final boolean onePhase) throws XAException {
+            doInvoke(txnClient, new TxnXACommitRequest(xid, onePhase));
+        }
+
+        public void end(final Xid xid, final int flags) throws XAException {
+            doInvoke(txnClient, new TxnEndRequest(xid, flags));
+        }
+
+        public void forget(final Xid xid) throws XAException {
+            doInvoke(txnClient, new TxnForgetRequest(xid));
+        }
+
+        public int getTransactionTimeout() throws XAException {
+            return ((TxnGetTimeoutReply) doInvoke(txnClient, TxnGetTimeoutRequest.INSTANCE)).getTimeout();
+        }
+
+        public boolean isSameRM(final XAResource resource) throws XAException {
+            if (resource instanceof RemotingXAResource) {
+                final RemotingXAResource xaResource = (RemotingXAResource) resource;
+                try {
+                    return futureIdReply.get().getId().equals(xaResource.futureIdReply.get().getId());
+                } catch (IOException e) {
+                    throw xaException(e);
+                }
+            } else {
+                return false;
+            }
+        }
+
+        public int prepare(final Xid xid) throws XAException {
+            return ((TxnPrepareReply) doInvoke(txnClient, new TxnPrepareRequest(xid))).getVote();
+        }
+
+        public Xid[] recover(final int flag) throws XAException {
+            return ((TxnRecoverReply) doInvoke(txnClient, new TxnRecoverRequest(flag))).getResources();
+        }
+
+        public void rollback(final Xid xid) throws XAException {
+            doInvoke(txnClient, new TxnXARollbackRequest(xid));
+        }
+
+        public boolean setTransactionTimeout(final int timeout) throws XAException {
+            return ((TxnSetTimeoutReply) doInvoke(txnClient, new TxnSetTimeoutRequest(timeout))).getSuccess();
+        }
+
+        public void start(final Xid xid, final int flags) throws XAException {
+            doInvoke(txnClient, new TxnXAStartRequest(xid, flags));
+        }
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/TransactionalClientSourceImpl.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TransactionalClientSourceImpl.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/TransactionalClientSourceImpl.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/TransactionalClientSourceImpl.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.impl;
+
+import java.io.IOException;
+import java.util.concurrent.Executor;
+import org.jboss.remoting.ClientSource;
+import org.jboss.remoting.Endpoint;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.CloseHandler;
+import org.jboss.remoting.txn.request.AbstractTxnRequest;
+import org.jboss.remoting.txn.reply.AbstractTxnReply;
+import org.jboss.remoting.txn.TransactionalClientSource;
+import org.jboss.remoting.txn.TransactionalClient;
+import org.jboss.remoting.spi.RequestHandlerSource;
+import org.jboss.remoting.spi.Handle;
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.AbstractHandleableCloseable;
+import org.jboss.xnio.IoUtils;
+
+/**
+ *
+ */
+public final class TransactionalClientSourceImpl<I, O> extends AbstractHandleableCloseable<ClientSource<I, O>> implements TransactionalClientSource<I, O> {
+
+    private final Endpoint endpoint;
+    private final RequestHandlerSource requestHandlerSource;
+    private final Class<I> requestClass;
+    private final Class<O> replyClass;
+    private volatile Key key;
+
+    private TransactionalClientSourceImpl(final Executor executor, final Endpoint endpoint, final RequestHandlerSource requestHandlerSource, final Class<I> requestClass, final Class<O> replyClass) {
+        super(executor);
+        this.endpoint = endpoint;
+        this.requestHandlerSource = requestHandlerSource;
+        this.requestClass = requestClass;
+        this.replyClass = replyClass;
+    }
+
+    static <I, O> TransactionalClientSourceImpl<I, O> create(final Executor executor, final Endpoint endpoint, final RequestHandlerSource requestHandlerSource, final Class<I> requestClass, final Class<O> replyClass) {
+        final TransactionalClientSourceImpl<I, O> clientSource = new TransactionalClientSourceImpl<I, O>(executor, endpoint, requestHandlerSource, requestClass, replyClass);
+        final Key key = requestHandlerSource.addCloseHandler(new CloseHandler<RequestHandlerSource>() {
+            public void handleClose(final RequestHandlerSource closed) {
+                IoUtils.safeClose(clientSource);
+            }
+        });
+        clientSource.key = key;
+        return clientSource;
+    }
+
+    protected void closeAction() throws IOException {
+        final Key key = this.key;
+        if (key != null) {
+            key.remove();
+            this.key = null;
+        }
+    }
+
+    public TransactionalClient<I, O> createClient() throws IOException {
+        boolean ok = false;
+        final Handle<RequestHandler> handle = requestHandlerSource.createRequestHandler();
+        try {
+            final RequestHandler requestHandler = handle.getResource();
+            final Client<I, O> realClient = endpoint.createClient(WrappingRequestHandler.create(executor, requestHandler), requestClass, replyClass);
+            try {
+                final Client<AbstractTxnRequest, AbstractTxnReply> txnClient = endpoint.createClient(requestHandler, AbstractTxnRequest.class, AbstractTxnReply.class);
+                try {
+                    handle.close();
+                    final TransactionalClientImpl<I, O> transactionalClient = new TransactionalClientImpl<I, O>(realClient, txnClient);
+                    ok = true;
+                    return transactionalClient;
+                } finally {
+                    if (! ok) IoUtils.safeClose(txnClient);
+                }
+            } finally {
+                if (! ok) IoUtils.safeClose(realClient);
+            }
+        } finally {
+            IoUtils.safeClose(handle);
+        }
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/WrappingRequestHandler.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/WrappingRequestHandler.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/WrappingRequestHandler.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/impl/WrappingRequestHandler.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.impl;
+
+import org.jboss.remoting.spi.RequestHandler;
+import org.jboss.remoting.spi.RemoteRequestContext;
+import org.jboss.remoting.spi.ReplyHandler;
+import org.jboss.remoting.spi.AbstractAutoCloseable;
+import org.jboss.remoting.spi.Handle;
+import org.jboss.remoting.CloseHandler;
+import org.jboss.remoting.txn.request.TxnWrappedRequest;
+import org.jboss.xnio.IoUtils;
+import java.util.concurrent.Executor;
+import java.io.IOException;
+
+/**
+ *
+ */
+public final class WrappingRequestHandler extends AbstractAutoCloseable<RequestHandler> implements RequestHandler {
+
+    private final Handle<RequestHandler> handle;
+    private volatile Key key;
+
+    private WrappingRequestHandler(final Executor executor, final RequestHandler handler) throws IOException {
+        super(executor);
+        handle = handler.getHandle();
+    }
+
+    static WrappingRequestHandler create(final Executor executor, final RequestHandler handler) throws IOException {
+        final WrappingRequestHandler requestHandler = new WrappingRequestHandler(executor, handler);
+        requestHandler.key = requestHandler.handle.addCloseHandler(new CloseHandler<Handle<RequestHandler>>() {
+            public void handleClose(final Handle<RequestHandler> closed) {
+                IoUtils.safeClose(requestHandler);
+            }
+        });
+        return requestHandler;
+    }
+
+    protected void closeAction() throws IOException {
+        try {
+            handle.close();
+        } finally {
+            key.remove();
+            key = null;
+        }
+    }
+
+    public RemoteRequestContext receiveRequest(final Object request, final ReplyHandler replyHandler) {
+        return handle.getResource().receiveRequest(new TxnWrappedRequest(request), replyHandler);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/AbstractTxnReply.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/AbstractTxnReply.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/AbstractTxnReply.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/AbstractTxnReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.reply;
+
+/**
+ *
+ */
+public abstract class AbstractTxnReply {
+
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnGetResourceManagerIdReply.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetResourceManagerIdReply.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnGetResourceManagerIdReply.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnGetResourceManagerIdReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.reply;
+
+/**
+ *
+ */
+public final class TxnGetResourceManagerIdReply extends AbstractTxnReply {
+    private final Object id;
+
+    public TxnGetResourceManagerIdReply(final Object id) {
+        this.id = id;
+    }
+
+    public Object getId() {
+        return id;
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnGetTimeoutReply.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetTimeoutReply.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnGetTimeoutReply.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnGetTimeoutReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.reply;
+
+/**
+ *
+ */
+public final class TxnGetTimeoutReply extends AbstractTxnReply {
+
+    private final int timeout;
+
+    public TxnGetTimeoutReply(final int timeout) {
+        this.timeout = timeout;
+    }
+
+    public int getTimeout() {
+        return timeout;
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnPrepareReply.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnPrepareReply.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnPrepareReply.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnPrepareReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.reply;
+
+/**
+ *
+ */
+public final class TxnPrepareReply extends AbstractTxnReply {
+    private final int vote;
+
+    public TxnPrepareReply(final int vote) {
+        this.vote = vote;
+    }
+
+    public int getVote() {
+        return vote;
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnRecoverReply.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRecoverReply.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnRecoverReply.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnRecoverReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.reply;
+
+import javax.transaction.xa.Xid;
+
+/**
+ *
+ */
+public final class TxnRecoverReply extends AbstractTxnReply {
+
+    private final Xid[] resources;
+
+    public TxnRecoverReply(final Xid[] resources) {
+        this.resources = resources;
+    }
+
+    public Xid[] getResources() {
+        return resources;
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnSetTimeoutReply.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSetTimeoutReply.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnSetTimeoutReply.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnSetTimeoutReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.reply;
+
+/**
+ *
+ */
+public final class TxnSetTimeoutReply extends AbstractTxnReply {
+
+    private final boolean success;
+
+    public TxnSetTimeoutReply(final boolean success) {
+        this.success = success;
+    }
+
+    public boolean getSuccess() {
+        return success;
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnSuccessfulReply.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSuccessfulReply.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnSuccessfulReply.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/reply/TxnSuccessfulReply.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.reply;
+
+/**
+ *
+ */
+public final class TxnSuccessfulReply extends AbstractTxnReply {
+    public static final TxnSuccessfulReply INSTANCE = new TxnSuccessfulReply();
+
+    private TxnSuccessfulReply() {
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/AbstractTxnRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/AbstractTxnRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/AbstractTxnRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/AbstractTxnRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+/**
+ *
+ */
+public abstract class AbstractTxnRequest {
+    public abstract <I, O> O accept(TxnRequestVisitor<I, O> visitor, I param);
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnCommitRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnCommitRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnCommitRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnCommitRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+/**
+ *
+ */
+public final class TxnCommitRequest extends AbstractTxnRequest {
+    public static final TxnCommitRequest INSTANCE = new TxnCommitRequest();
+
+    private TxnCommitRequest() {
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnEndRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnEndRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnEndRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnEndRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+import javax.transaction.xa.Xid;
+
+/**
+ *
+ */
+public final class TxnEndRequest extends AbstractTxnRequest {
+
+    public TxnEndRequest(final Xid xid, final int flags) {
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnForgetRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnForgetRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnForgetRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnForgetRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+import javax.transaction.xa.Xid;
+
+/**
+ *
+ */
+public final class TxnForgetRequest extends AbstractTxnRequest {
+
+    private final Xid xid;
+
+    public TxnForgetRequest(final Xid xid) {
+        this.xid = xid;
+    }
+
+    public Xid getXid() {
+        return xid;
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnGetResourceManagerIdRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetResourceManagerIdRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnGetResourceManagerIdRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnGetResourceManagerIdRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+/**
+ *
+ */
+public final class TxnGetResourceManagerIdRequest extends AbstractTxnRequest {
+
+    public static final TxnGetResourceManagerIdRequest INSTANCE = new TxnGetResourceManagerIdRequest();
+
+    private TxnGetResourceManagerIdRequest() {
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnGetTimeoutRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnGetTimeoutRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnGetTimeoutRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnGetTimeoutRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+/**
+ *
+ */
+public final class TxnGetTimeoutRequest extends AbstractTxnRequest {
+
+    public static final TxnGetTimeoutRequest INSTANCE = new TxnGetTimeoutRequest();
+
+    private TxnGetTimeoutRequest() {
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnPrepareRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnPrepareRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnPrepareRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnPrepareRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+import javax.transaction.xa.Xid;
+
+/**
+ *
+ */
+public final class TxnPrepareRequest extends AbstractTxnRequest {
+
+    private final Xid xid;
+
+    public TxnPrepareRequest(final Xid xid) {
+        this.xid = xid;
+    }
+
+    public Xid getXid() {
+        return xid;
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRecoverRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRecoverRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRecoverRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRecoverRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+/**
+ *
+ */
+public final class TxnRecoverRequest extends AbstractTxnRequest {
+
+    private final int flag;
+
+    public TxnRecoverRequest(final int flag) {
+        this.flag = flag;
+    }
+
+    public int getFlag() {
+        return flag;
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRequestVisitor.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRequestVisitor.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRequestVisitor.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRequestVisitor.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+import org.jboss.remoting.txn.request.TxnStartRequest;
+
+/**
+ *
+ */
+public interface TxnRequestVisitor<I, O> {
+
+    O visit(TxnXACommitRequest request, I param);
+
+    O visit(TxnEndRequest request, I param);
+
+    O visit(TxnForgetRequest request, I param);
+
+    O visit(TxnGetTimeoutRequest request, I param);
+
+    O visit(TxnPrepareRequest request, I param);
+
+    O visit(TxnRecoverRequest request, I param);
+
+    O visit(TxnXARollbackRequest request, I param);
+
+    O visit(TxnSetTimeoutRequest request, I param);
+
+    O visit(TxnXAStartRequest request, I param);
+
+    O visit(TxnWrappedRequest request, I param);
+
+    O visit(TxnGetResourceManagerIdRequest request, I param);
+
+    O visit(TxnStartRequest request, I param);
+
+    O visit(TxnCommitRequest request, I param);
+
+    O visit(TxnRollbackRequest request, I param);
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRollbackRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnRollbackRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRollbackRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnRollbackRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+/**
+ *
+ */
+public final class TxnRollbackRequest extends AbstractTxnRequest {
+
+    public static TxnRollbackRequest INSTANCE = new TxnRollbackRequest();
+
+    private TxnRollbackRequest() {
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnSetTimeoutRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnSetTimeoutRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnSetTimeoutRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnSetTimeoutRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+/**
+ *
+ */
+public final class TxnSetTimeoutRequest extends AbstractTxnRequest {
+
+    private final int timeout;
+
+    public TxnSetTimeoutRequest(final int timeout) {
+        this.timeout = timeout;
+    }
+
+    public int getTimeout() {
+        return timeout;
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnStartRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnStartRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnStartRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnStartRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+import org.jboss.remoting.txn.request.TxnRequestVisitor;
+import org.jboss.remoting.txn.request.AbstractTxnRequest;
+
+/**
+ *
+ */
+public final class TxnStartRequest extends AbstractTxnRequest {
+
+    public static TxnStartRequest INSTANCE = new TxnStartRequest();
+
+    private TxnStartRequest() {
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnWrappedRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnWrappedRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnWrappedRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnWrappedRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+/**
+ *
+ */
+public final class TxnWrappedRequest extends AbstractTxnRequest {
+
+    private final Object wrappedRequest;
+
+    public TxnWrappedRequest(final Object request) {
+        wrappedRequest = request;
+    }
+
+    public Object getWrappedRequest() {
+        return wrappedRequest;
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXACommitRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXACommitRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXACommitRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXACommitRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+import javax.transaction.xa.Xid;
+
+/**
+ *
+ */
+public final class TxnXACommitRequest extends AbstractTxnRequest {
+    private final Xid xid;
+    private final boolean onePhase;
+
+    public TxnXACommitRequest(final Xid xid, final boolean onePhase) {
+        this.xid = xid;
+        this.onePhase = onePhase;
+    }
+
+    public Xid getXid() {
+        return xid;
+    }
+
+    public boolean isOnePhase() {
+        return onePhase;
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXARollbackRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXARollbackRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXARollbackRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXARollbackRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+import javax.transaction.xa.Xid;
+
+/**
+ *
+ */
+public final class TxnXARollbackRequest extends AbstractTxnRequest {
+
+    private final Xid xid;
+
+    public TxnXARollbackRequest(final Xid xid) {
+        this.xid = xid;
+    }
+
+    public Xid getXid() {
+        return xid;
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}

Copied: remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXAStartRequest.java (from rev 4809, remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/TxnXAStartRequest.java)
===================================================================
--- remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXAStartRequest.java	                        (rev 0)
+++ remoting-txn/trunk/src/main/java/org/jboss/remoting/txn/request/TxnXAStartRequest.java	2009-01-15 00:08:49 UTC (rev 4810)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting.txn.request;
+
+import javax.transaction.xa.Xid;
+
+/**
+ *
+ */
+public final class TxnXAStartRequest extends AbstractTxnRequest {
+
+    private final Xid xid;
+    private final int flags;
+
+    public TxnXAStartRequest(final Xid xid, final int flags) {
+        this.xid = xid;
+        this.flags = flags;
+    }
+
+    public Xid getXid() {
+        return xid;
+    }
+
+    public int getFlags() {
+        return flags;
+    }
+
+    public <I, O> O accept(final TxnRequestVisitor<I, O> visitor, final I param) {
+        return visitor.visit(this, param);
+    }
+}




More information about the jboss-remoting-commits mailing list