Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1774 - in development/laboratory/planet/components/tx: . api api/src api/src/main api/src/main/net api/src/main/net/dpml api/src/main/net/dpml/tx api/src/main/net/dpml/tx/manager impl impl/src/main/net/dpml/tx impl/src/main/net/dpml/tx/context impl/src/main/net/dpml/tx/log impl/src/main/net/dpml/tx/manager impl/src/test/net/dpml/tx/tests/context impl/src/test/net/dpml/tx/tests/log impl/src/test/net/dpml/tx/tests/manager

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1774 - in development/laboratory/planet/components/tx: . api api/src api/src/main api/src/main/net api/src/main/net/dpml api/src/main/net/dpml/tx api/src/main/net/dpml/tx/manager impl impl/src/main/net/dpml/tx impl/src/main/net/dpml/tx/context impl/src/main/net/dpml/tx/log impl/src/main/net/dpml/tx/manager impl/src/test/net/dpml/tx/tests/context impl/src/test/net/dpml/tx/tests/log impl/src/test/net/dpml/tx/tests/manager
  • Date: Mon, 14 Feb 2005 08:51:21 +0100

Author: niclas
Date: Mon Feb 14 08:51:19 2005
New Revision: 1774

Added:
development/laboratory/planet/components/tx/api/
development/laboratory/planet/components/tx/api/.classpath
development/laboratory/planet/components/tx/api/.project
development/laboratory/planet/components/tx/api/build.xml (contents,
props changed)
development/laboratory/planet/components/tx/api/src/
development/laboratory/planet/components/tx/api/src/main/
development/laboratory/planet/components/tx/api/src/main/net/
development/laboratory/planet/components/tx/api/src/main/net/dpml/
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/ConnectionReleaser.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/ExtendedTransactionManager.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/ImportedTransactionActiveException.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/InstanceContext.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/TrackedConnectionAssociator.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/XAWork.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/LogException.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/NamedXAResource.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/Recovery.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/ResourceManager.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/TransactionBranchInfo.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/TransactionLog.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/XidFactory.java
(contents, props changed)

development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/XidImporter.java
(contents, props changed)
development/laboratory/planet/components/tx/impl/.classpath
development/laboratory/planet/components/tx/impl/.project

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/OfflineUserTransaction.java
(contents, props changed)
Removed:

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/ConnectionReleaser.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/ExtendedTransactionManager.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/ImportedTransactionActiveException.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/InstanceContext.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/TrackedConnectionAssociator.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/XAWork.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/LogException.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/NamedXAResource.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/Recovery.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/ResourceManager.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionBranchInfo.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionLog.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/XidFactory.java

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/XidImporter.java
Modified:

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/DefaultInstanceContext.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/DoubleKeyedHashMap.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/OnlineUserTransaction.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/UserTransactionImpl.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/BeanTransactionContext.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/ContainerTransactionContext.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/InheritableTransactionContext.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/TransactionContext.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/TransactionContextManager.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/UnspecifiedTransactionContext.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/log/UnrecoverableLog.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/log/XidImpl2.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/RecoveryImpl.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionBranchInfoImpl.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionImpl.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionManagerImpl.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionTimer.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/WrapperNamedXAResource.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/XidFactoryImpl.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/XidImpl.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/context/TransactionContextManagerTest.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/log/AbstractLogTest.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/AbstractRecoveryTest.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockLog.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockLogRecoveryTest.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockResource.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockResourceManager.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/ProtocolTest.java
(props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/RecoveryTest.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/TestTransactionManager.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/TransactionManagerImplTest.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/XATransactionTester.java
(contents, props changed)

development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/XidImporterTest.java
(contents, props changed)
development/laboratory/planet/components/tx/index.xml
Log:
Separating out what can be viewed as an internal API.

Added: development/laboratory/planet/components/tx/api/.classpath
==============================================================================
--- (empty file)
+++ development/laboratory/planet/components/tx/api/.classpath Mon Feb 14
08:51:19 2005
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="var"
path="MAGIC_CACHE/sun/java/jta/jars/jta-spec-1.0.1B.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: development/laboratory/planet/components/tx/api/.project
==============================================================================
--- (empty file)
+++ development/laboratory/planet/components/tx/api/.project Mon Feb 14
08:51:19 2005
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>transaction-api</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>

Added: development/laboratory/planet/components/tx/api/build.xml
==============================================================================
--- (empty file)
+++ development/laboratory/planet/components/tx/api/build.xml Mon Feb 14
08:51:19 2005
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project name="dpml-tx-api" default="install" basedir="."
+ xmlns:transit="antlib:net.dpml.transit">
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>
+
+</project>

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/ConnectionReleaser.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/ConnectionReleaser.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,33 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.tx;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
+ *
+ * */
+public interface ConnectionReleaser
+{
+ /** Called after the completion of a transaction.
+ *
+ * @param managedConnectionInfo
+ */
+ void afterCompletion(Object managedConnectionInfo);
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/ExtendedTransactionManager.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/ExtendedTransactionManager.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,19 @@
+package net.dpml.tx;
+
+import java.util.Map;
+import javax.transaction.TransactionManager;
+import javax.transaction.NotSupportedException;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+
+/**
+ */
+public interface ExtendedTransactionManager extends TransactionManager
+{
+
+ Transaction begin( long transactionTimeoutMilliseconds )
+ throws NotSupportedException, SystemException;
+
+ Map getExternalXids();
+
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/ImportedTransactionActiveException.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/ImportedTransactionActiveException.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,22 @@
+package net.dpml.tx;
+
+import javax.transaction.xa.Xid;
+
+/**
+ */
+public class ImportedTransactionActiveException extends Exception
+{
+
+ private final Xid m_xid;
+
+ public ImportedTransactionActiveException(Xid xid)
+ {
+ this.m_xid = xid;
+ }
+
+ public Xid getXid()
+ {
+ return m_xid;
+ }
+
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/InstanceContext.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/InstanceContext.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,59 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.tx;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
+ *
+ * */
+public interface InstanceContext
+{
+ Object getId();
+
+ void setId( Object id );
+
+ Object getContainerId();
+
+ void associate()
+ throws Throwable;
+
+ void flush()
+ throws Throwable;
+
+ void beforeCommit()
+ throws Exception;
+
+ void afterCommit(boolean status)
+ throws Exception;
+
+ /**
+ * IMPORTANT INVARIANT: this should always return a map, never null.
+ * @return map of ConnectionManager to (list of ) managed connection
info objects.
+ */
+ Map getConnectionManagerMap();
+
+ Set getUnshareableResources();
+
+ Set getApplicationManagedSecurityResources();
+
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/TrackedConnectionAssociator.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/TrackedConnectionAssociator.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,41 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.tx;
+
+// kill J2EE deps; import javax.resource.ResourceException;
+import javax.transaction.xa.XAException;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
+ *
+ * */
+public interface TrackedConnectionAssociator
+{
+
+ InstanceContext enter( InstanceContext newInstanceContext )
+ throws XAException;
+
+ void newTransaction()
+ throws XAException;
+
+ void exit( InstanceContext instanceContext )
+ throws XAException;
+
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/XAWork.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/XAWork.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,38 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.tx;
+
+import javax.transaction.xa.Xid;
+import javax.transaction.xa.XAException;
+import javax.transaction.SystemException;
+import javax.transaction.InvalidTransactionException;
+
+/**
+ * primarily an interface between the WorkManager/ExecutionContext and the
tm.
+ *
+ * @version $Rev$ $Date: 2004-10-08 04:49:55 +0800 (Fri, 08 Oct 2004) $
+ *
+ * */
+public interface XAWork
+{
+ void begin( Xid xid, long txTimeout )
+ throws XAException, InvalidTransactionException, SystemException,
ImportedTransactionActiveException;
+
+ void end(Xid xid)
+ throws XAException, SystemException;
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/LogException.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/LogException.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,48 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.tx.manager;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
+ *
+ * */
+public class LogException extends Exception
+{
+
+ public LogException()
+ {
+ super();
+ }
+
+ public LogException( String message )
+ {
+ super(message);
+ }
+
+ public LogException( String message, Throwable cause )
+ {
+ super(message, cause);
+ }
+
+ public LogException( Throwable cause )
+ {
+ super(cause);
+ }
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/NamedXAResource.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/NamedXAResource.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,14 @@
+package net.dpml.tx.manager;
+
+import javax.transaction.xa.XAResource;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
+ *
+ * */
+public interface NamedXAResource extends XAResource
+{
+ String getName();
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/Recovery.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/Recovery.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,91 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.tx.manager;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.Map;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.Xid;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date: 2004-12-09 23:41:29 +0800 (Thu, 09 Dec 2004) $
+ *
+ * */
+public interface Recovery
+{
+
+ void recoverLog()
+ throws XAException;
+
+ void recoverResourceManager(NamedXAResource xaResource)
+ throws XAException;
+
+ boolean hasRecoveryErrors();
+
+ List getRecoveryErrors();
+
+ boolean localRecoveryComplete();
+
+ int localUnrecoveredCount();
+
+ //hard to implement.. needs ExternalTransaction to have a reference to
externalXids.
+// boolean remoteRecoveryComplete();
+
+ Map getExternalXids();
+
+ public static class XidBranchesPair
+ {
+ private final Xid m_xid;
+
+ //set of TransactionBranchInfo
+ private final Set m_branches = new HashSet();
+
+ private final Object m_mark;
+
+ public XidBranchesPair( Xid xid, Object mark )
+ {
+ this.m_xid = xid;
+ this.m_mark = mark;
+ }
+
+ public Xid getXid()
+ {
+ return m_xid;
+ }
+
+ public Set getBranches()
+ {
+ return m_branches;
+ }
+
+ public Object getMark()
+ {
+ return m_mark;
+ }
+
+ public void addBranch( TransactionBranchInfo branchInfo )
+ {
+ m_branches.add( branchInfo );
+ }
+ }
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/ResourceManager.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/ResourceManager.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,19 @@
+package net.dpml.tx.manager;
+
+import javax.transaction.SystemException;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date: 2004-10-15 05:51:13 +0800 (Fri, 15 Oct 2004) $
+ *
+ * */
+public interface ResourceManager
+{
+
+ NamedXAResource getRecoveryXAResources()
+ throws SystemException;
+
+ void returnResource( NamedXAResource xaResource );
+
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/TransactionBranchInfo.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/TransactionBranchInfo.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,18 @@
+package net.dpml.tx.manager;
+
+import javax.transaction.xa.Xid;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
+ *
+ * */
+public interface TransactionBranchInfo
+{
+
+ String getResourceName();
+
+ Xid getBranchXid();
+
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/TransactionLog.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/TransactionLog.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,68 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.tx.manager;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.transaction.xa.Xid;
+
+
+/**
+ * Interface used to notify a logging subsystem of transaction events.
+ *
+ * @version $Rev$ $Date: 2004-10-18 04:06:11 +0800 (Mon, 18 Oct 2004) $
+ */
+public interface TransactionLog
+{
+
+ void begin( Xid xid )
+ throws LogException;
+
+ /**
+ * log prepare for the global xid xid and the list of
TransactionBranchInfo branches
+ * @param xid global xid for the transactions
+ * @param branches List of TransactionBranchInfo
+ * @throws LogException
+ */
+ Object prepare( Xid xid, List branches )
+ throws LogException;
+
+ void commit( Xid xid, Object logMark )
+ throws LogException;
+
+ void rollback( Xid xid, Object logMark )
+ throws LogException;
+
+ /**
+ * Recovers the log, returning a map of (top level) xid to List of
TransactionBranchInfo for the branches.
+ * Uses the XidFactory to reconstruct the xids.
+ *
+ * @param xidFactory
+ * @return Map of recovered xid to List of TransactionBranchInfo
representing the branches.
+ * @throws LogException
+ */
+ Collection recover( XidFactory xidFactory )
+ throws LogException;
+
+ String getXMLStats();
+
+ int getAverageForceTime();
+
+ int getAverageBytesPerForce();
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/XidFactory.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/XidFactory.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,22 @@
+package net.dpml.tx.manager;
+
+import javax.transaction.xa.Xid;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
+ *
+ * */
+public interface XidFactory
+{
+ Xid createXid();
+
+ Xid createBranch( Xid globalId, int branch );
+
+ boolean matchesGlobalId( byte[] globalTransactionId );
+
+ boolean matchesBranchId( byte[] branchQualifier );
+
+ Xid recover( int formatId, byte[] globalTransactionid, byte[]
branchQualifier );
+}

Added:
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/XidImporter.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/api/src/main/net/dpml/tx/manager/XidImporter.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,50 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.tx.manager;
+
+import java.util.Map;
+
+import javax.transaction.xa.Xid;
+import javax.transaction.xa.XAException;
+import javax.transaction.Transaction;
+import javax.transaction.SystemException;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date: 2004-10-24 10:14:58 +0800 (Sun, 24 Oct 2004) $
+ *
+ * */
+public interface XidImporter
+{
+
+ Transaction importXid( Xid xid, long transactionTimeoutMillis )
+ throws XAException, SystemException;
+
+ void commit( Transaction tx, boolean onePhase )
+ throws XAException;
+
+ void forget( Transaction tx )
+ throws XAException;
+
+ int prepare( Transaction tx )
+ throws XAException;
+
+ void rollback( Transaction tx )
+ throws XAException;
+}

Added: development/laboratory/planet/components/tx/impl/.classpath
==============================================================================
--- (empty file)
+++ development/laboratory/planet/components/tx/impl/.classpath Mon Feb 14
08:51:19 2005
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="src" path="src/test"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var"
path="MAGIC_CACHE/dpml/transit/jars/dpml-transit-main-SNAPSHOT.jar"/>
+ <classpathentry kind="var"
path="MAGIC_CACHE/sun/java/jta/jars/jta-spec-1.0.1B.jar"/>
+ <classpathentry kind="var"
path="MAGIC_CACHE/junit/jars/junit-3.8.1.jar"/>
+ <classpathentry kind="src" path="/transaction-api"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: development/laboratory/planet/components/tx/impl/.project
==============================================================================
--- (empty file)
+++ development/laboratory/planet/components/tx/impl/.project Mon Feb 14
08:51:19 2005
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>transaction-impl</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/DefaultInstanceContext.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/DefaultInstanceContext.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/DefaultInstanceContext.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +26,7 @@
/**
* Simple implementation of ComponentContext satisfying invariant.
*
- * @version $Rev: 54714 $ $Date: 2004-10-13 08:38:55 +0800 (Wed, 13 Oct
2004) $
+ * @version $Rev$ $Date: 2004-10-13 08:38:55 +0800 (Wed, 13 Oct 2004) $
*
* */
public class DefaultInstanceContext

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/DoubleKeyedHashMap.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/DoubleKeyedHashMap.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/DoubleKeyedHashMap.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +25,7 @@
/**
* <b>Really</b> stupid implementation of a double keyed map.
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*/
public final class DoubleKeyedHashMap
{

Added:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/OfflineUserTransaction.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/OfflineUserTransaction.java
Mon Feb 14 08:51:19 2005
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ package net.dpml.tx;
+
+import java.io.Serializable;
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.SystemException;
+import javax.transaction.UserTransaction;
+
+
+final class OfflineUserTransaction
+ implements UserTransaction, Serializable
+{
+ public void begin()
+ throws NotSupportedException, SystemException
+ {
+ throw new IllegalStateException("Cannot use UserTransaction methods
in this state");
+ }
+
+ public void commit()
+ throws HeuristicMixedException, HeuristicRollbackException,
IllegalStateException,
+ RollbackException, SecurityException, SystemException
+ {
+ throw new IllegalStateException("Cannot use UserTransaction methods
in this state");
+ }
+
+ public int getStatus()
+ throws SystemException
+ {
+ throw new IllegalStateException("Cannot use UserTransaction methods
in this state");
+ }
+
+ public void rollback()
+ throws IllegalStateException, SecurityException, SystemException
+ {
+ throw new IllegalStateException("Cannot use UserTransaction methods
in this state");
+ }
+
+ public void setRollbackOnly()
+ throws IllegalStateException, SystemException
+ {
+ throw new IllegalStateException("Cannot use UserTransaction methods
in this state");
+ }
+
+ public void setTransactionTimeout( int seconds )
+ throws SystemException
+ {
+ throw new IllegalStateException("Cannot use UserTransaction methods
in this state");
+ }
+}
\ No newline at end of file

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/OnlineUserTransaction.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/OnlineUserTransaction.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/OnlineUserTransaction.java
Mon Feb 14 08:51:19 2005
@@ -1,3 +1,22 @@
+/*
+ * Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package net.dpml.tx;

import java.io.Serializable;

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/UserTransactionImpl.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/UserTransactionImpl.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/UserTransactionImpl.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +34,7 @@
* This adds the ability to enable or disable the operations depending on
* the lifecycle of the EJB instance.
*
- * @version $Rev: 71492 $ $Date: 2004-11-15 13:31:50 +0800 (Mon, 15 Nov
2004) $
+ * @version $Rev$ $Date: 2004-11-15 13:31:50 +0800 (Mon, 15 Nov 2004) $
*/
public class UserTransactionImpl
implements UserTransaction, Serializable
@@ -120,45 +121,4 @@
private final OnlineUserTransaction ONLINE = new OnlineUserTransaction();

private static final UserTransaction OFFLINE = new
OfflineUserTransaction();
-
- private static final class OfflineUserTransaction
- implements UserTransaction, Serializable
- {
- public void begin()
- throws NotSupportedException, SystemException
- {
- throw new IllegalStateException("Cannot use UserTransaction
methods in this state");
- }
-
- public void commit()
- throws HeuristicMixedException, HeuristicRollbackException,
IllegalStateException,
- RollbackException, SecurityException, SystemException
- {
- throw new IllegalStateException("Cannot use UserTransaction
methods in this state");
- }
-
- public int getStatus()
- throws SystemException
- {
- throw new IllegalStateException("Cannot use UserTransaction
methods in this state");
- }
-
- public void rollback()
- throws IllegalStateException, SecurityException, SystemException
- {
- throw new IllegalStateException("Cannot use UserTransaction
methods in this state");
- }
-
- public void setRollbackOnly()
- throws IllegalStateException, SystemException
- {
- throw new IllegalStateException("Cannot use UserTransaction
methods in this state");
- }
-
- public void setTransactionTimeout( int seconds )
- throws SystemException
- {
- throw new IllegalStateException("Cannot use UserTransaction
methods in this state");
- }
- }
}

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/BeanTransactionContext.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/BeanTransactionContext.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/BeanTransactionContext.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +32,7 @@
/**
*
*
- * @version $Rev: 55410 $ $Date: 2004-10-24 10:14:58 +0800 (Sun, 24 Oct
2004) $
+ * @version $Rev$ $Date: 2004-10-24 10:14:58 +0800 (Sun, 24 Oct 2004) $
*/
public class BeanTransactionContext extends InheritableTransactionContext
{

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/ContainerTransactionContext.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/ContainerTransactionContext.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/ContainerTransactionContext.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +29,7 @@
import javax.transaction.RollbackException;

/**
- * @version $Rev: 54719 $ $Date: 2004-10-13 09:28:03 +0800 (Wed, 13 Oct
2004) $
+ * @version $Rev$ $Date: 2004-10-13 09:28:03 +0800 (Wed, 13 Oct 2004) $
*/
public class ContainerTransactionContext extends
InheritableTransactionContext
{

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/InheritableTransactionContext.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/InheritableTransactionContext.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/InheritableTransactionContext.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +23,7 @@
/**
*
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*/
public abstract class InheritableTransactionContext extends
TransactionContext
{

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/TransactionContext.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/TransactionContext.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/TransactionContext.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +38,7 @@
/**
*
*
- * @version $Rev: 56821 $ $Date: 2004-11-07 15:59:36 +0800 (Sun, 07 Nov
2004) $
+ * @version $Rev$ $Date: 2004-11-07 15:59:36 +0800 (Sun, 07 Nov 2004) $
*/
public abstract class TransactionContext
{

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/TransactionContextManager.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/TransactionContextManager.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/TransactionContextManager.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,7 +41,7 @@
import net.dpml.tx.manager.XidImporter;

/**
- * @version $Rev: 128441 $ $Date: 2005-01-28 06:56:21 +0800 (Fri, 28 Jan
2005) $
+ * @version $Rev$ $Date: 2005-01-28 06:56:21 +0800 (Fri, 28 Jan 2005) $
*/
public class TransactionContextManager
// remove j2ee deps; implements XATerminator, XAWork

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/UnspecifiedTransactionContext.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/UnspecifiedTransactionContext.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/context/UnspecifiedTransactionContext.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +27,7 @@
/**
*
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*/
public class UnspecifiedTransactionContext extends TransactionContext
{

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/log/UnrecoverableLog.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/log/UnrecoverableLog.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/log/UnrecoverableLog.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +33,7 @@
* Not recommended for production use as heuristic recovery will be needed if
* the transaction coordinator dies.
*
- * @version $Rev: 54973 $ $Date: 2004-10-18 04:06:11 +0800 (Mon, 18 Oct
2004) $
+ * @version $Rev$ $Date: 2004-10-18 04:06:11 +0800 (Mon, 18 Oct 2004) $
*/
public class UnrecoverableLog
implements TransactionLog

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/log/XidImpl2.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/log/XidImpl2.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/log/XidImpl2.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +27,7 @@
* Unique id for a transaction. This implementation is backed by a single
byte buffer
* so can do less copying than one backed by several byte buffers for the
different components.
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*/
public class XidImpl2
implements Xid, Serializable

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/RecoveryImpl.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/RecoveryImpl.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/RecoveryImpl.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,11 +35,17 @@
import javax.transaction.xa.Xid;

import net.dpml.lang.NullArgumentException;
+import net.dpml.tx.manager.LogException;
+import net.dpml.tx.manager.NamedXAResource;
+import net.dpml.tx.manager.Recovery;
+import net.dpml.tx.manager.TransactionBranchInfo;
+import net.dpml.tx.manager.TransactionLog;
+import net.dpml.tx.manager.XidFactory;

/**
*
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*
* */
public class RecoveryImpl

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionBranchInfoImpl.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionBranchInfoImpl.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionBranchInfoImpl.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,11 +20,12 @@


import javax.transaction.xa.Xid;
+import net.dpml.tx.manager.TransactionBranchInfo;

/**
*
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*
* */
public class TransactionBranchInfoImpl

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionImpl.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionImpl.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionImpl.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,11 +39,16 @@
import javax.transaction.xa.Xid;

import net.dpml.lang.NullArgumentException;
+import net.dpml.tx.manager.LogException;
+import net.dpml.tx.manager.NamedXAResource;
+import net.dpml.tx.manager.TransactionBranchInfo;
+import net.dpml.tx.manager.TransactionLog;
+import net.dpml.tx.manager.XidFactory;

/**
* Basic local transaction with support for multiple resources.
*
- * @version $Rev: 128441 $ $Date: 2005-01-28 06:56:21 +0800 (Fri, 28 Jan
2005) $
+ * @version $Rev$ $Date: 2005-01-28 06:56:21 +0800 (Fri, 28 Jan 2005) $
*/
public class TransactionImpl
implements Transaction

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionManagerImpl.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionManagerImpl.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionManagerImpl.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,11 +46,17 @@

import net.dpml.tx.ExtendedTransactionManager;
import net.dpml.tx.log.UnrecoverableLog;
+import net.dpml.tx.manager.NamedXAResource;
+import net.dpml.tx.manager.Recovery;
+import net.dpml.tx.manager.ResourceManager;
+import net.dpml.tx.manager.TransactionLog;
+import net.dpml.tx.manager.XidFactory;
+import net.dpml.tx.manager.XidImporter;

/**
* Simple implementation of a transaction manager.
*
- * @version $Rev: 128441 $ $Date: 2005-01-28 06:56:21 +0800 (Fri, 28 Jan
2005) $
+ * @version $Rev$ $Date: 2005-01-28 06:56:21 +0800 (Fri, 28 Jan 2005) $
*/
public class TransactionManagerImpl
implements ExtendedTransactionManager, XidImporter

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionTimer.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionTimer.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/TransactionTimer.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +20,7 @@
/**
* TODO improve shutdown
*
- * @version $Revision: $ $Date: $
+ * @version $Revision$ $Date: $
*/
public class TransactionTimer
{

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/WrapperNamedXAResource.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/WrapperNamedXAResource.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/WrapperNamedXAResource.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +27,7 @@
/**
*
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*
* */
public class WrapperNamedXAResource

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/XidFactoryImpl.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/XidFactoryImpl.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/XidFactoryImpl.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +22,7 @@
import java.net.UnknownHostException;

import javax.transaction.xa.Xid;
+import net.dpml.tx.manager.XidFactory;

/*
import org.apache.geronimo.gbean.GBeanInfo;
@@ -35,7 +37,7 @@
* <li>4 byte system id</li>
* <li>4 or 16 byte IP address of host</li>
* <ol>
- * @version $Rev: 126313 $ $Date: 2005-01-25 05:03:52 +0800 (Tue, 25 Jan
2005) $
+ * @version $Rev$ $Date: 2005-01-25 05:03:52 +0800 (Tue, 25 Jan 2005) $
* todo Should have a way of setting baseId
*/
public class XidFactoryImpl

Modified:
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/XidImpl.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/XidImpl.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/main/net/dpml/tx/manager/XidImpl.java
Mon Feb 14 08:51:19 2005
@@ -1,6 +1,7 @@
-/**
+/*
*
* Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 Niclas Hedhman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +25,7 @@
/**
* Unique id for a transaction.
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*/
public class XidImpl
implements Xid, Serializable
@@ -130,7 +131,7 @@
{
s.append( Integer.toHexString( m_globalId[ i ] ) );
}
- s.append( ",branchId=" );
+ s.append( ", branchId=" );
for( int i = 0; i < m_branchId.length; i++ )
{
s.append( Integer.toHexString( m_branchId[ i ] ) );

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/context/TransactionContextManagerTest.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/context/TransactionContextManagerTest.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/context/TransactionContextManagerTest.java
Mon Feb 14 08:51:19 2005
@@ -17,8 +17,8 @@

package net.dpml.tx.tests.context;

+import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
-
import junit.framework.TestCase;
import net.dpml.tx.ImportedTransactionActiveException;
import net.dpml.tx.context.TransactionContextManager;
@@ -30,7 +30,7 @@
/**
*
*
- * @version $Rev: 54013 $ $Date: 2004-10-07 13:49:55 -0700 (Thu, 07 Oct
2004) $
+ * @version $Rev$ $Date: 2004-10-07 13:49:55 -0700 (Thu, 07 Oct 2004) $
*
*/
public class TransactionContextManagerTest extends TestCase
@@ -61,8 +61,9 @@
transactionContextManager.end( xid );
transactionContextManager.begin( xid, 1000 );
transactionContextManager.end( xid );
- transactionContextManager.prepare( xid );
- transactionContextManager.commit( xid, false );
+ int readOnly = transactionContextManager.prepare(xid);
+ if( XAResource.XA_RDONLY != readOnly )
+ throw new Exception( "XAResource.XA_RDONLY != readOnly" );
}

public void testNoConcurrentWorkSameXid()

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/log/AbstractLogTest.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/log/AbstractLogTest.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/log/AbstractLogTest.java
Mon Feb 14 08:51:19 2005
@@ -34,7 +34,7 @@
/**
*
*
- * @version $Rev: 54973 $ $Date: 2004-10-18 04:06:11 +0800 (Mon, 18 Oct
2004) $
+ * @version $Rev$ $Date: 2004-10-18 04:06:11 +0800 (Mon, 18 Oct 2004) $
*
*/
public abstract class AbstractLogTest extends TestCase

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/AbstractRecoveryTest.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/AbstractRecoveryTest.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/AbstractRecoveryTest.java
Mon Feb 14 08:51:19 2005
@@ -40,7 +40,7 @@
* This is just a unit test for recovery, depending on proper behavior of the
* log(s) it uses.
*
- * @version $Rev: 54973 $ $Date: 2004-10-18 04:06:11 +0800 (Mon, 18 Oct
2004) $
+ * @version $Rev$ $Date: 2004-10-18 04:06:11 +0800 (Mon, 18 Oct 2004) $
*
*/
public abstract class AbstractRecoveryTest extends TestCase

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockLog.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockLog.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockLog.java
Mon Feb 14 08:51:19 2005
@@ -33,7 +33,7 @@
/**
*
*
- * @version $Rev: 54973 $ $Date: 2004-10-18 04:06:11 +0800 (Mon, 18 Oct
2004) $
+ * @version $Rev$ $Date: 2004-10-18 04:06:11 +0800 (Mon, 18 Oct 2004) $
*
*/
public class MockLog

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockLogRecoveryTest.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockLogRecoveryTest.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockLogRecoveryTest.java
Mon Feb 14 08:51:19 2005
@@ -20,7 +20,7 @@
/**
*
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*
*/
public class MockLogRecoveryTest extends AbstractRecoveryTest

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockResource.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockResource.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockResource.java
Mon Feb 14 08:51:19 2005
@@ -27,7 +27,7 @@


/**
- * @version $Rev: 55097 $ $Date: 2004-10-20 04:35:46 +0800 (Wed, 20 Oct
2004) $
+ * @version $Rev$ $Date: 2004-10-20 04:35:46 +0800 (Wed, 20 Oct 2004) $
*/
public class MockResource
implements NamedXAResource

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockResourceManager.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockResourceManager.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/MockResourceManager.java
Mon Feb 14 08:51:19 2005
@@ -33,7 +33,7 @@
/**
*
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*/
public class MockResourceManager
implements ResourceManager

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/RecoveryTest.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/RecoveryTest.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/RecoveryTest.java
Mon Feb 14 08:51:19 2005
@@ -40,7 +40,7 @@
* This is just a unit test for recovery, depending on proper behavior of the
* log(s) it uses.
*
- * @version $Rev: 46019 $ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep
2004) $
+ * @version $Rev$ $Date: 2004-09-14 17:56:06 +0800 (Tue, 14 Sep 2004) $
*
*/
public class RecoveryTest extends TestCase

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/TestTransactionManager.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/TestTransactionManager.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/TestTransactionManager.java
Mon Feb 14 08:51:19 2005
@@ -29,7 +29,7 @@
/**
*
*
- * @version $Rev: 111396 $ $Date: 2004-12-09 23:41:29 +0800 (Thu, 09 Dec
2004) $
+ * @version $Rev$ $Date: 2004-12-09 23:41:29 +0800 (Thu, 09 Dec 2004) $
*/
public class TestTransactionManager extends TestCase
{

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/TransactionManagerImplTest.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/TransactionManagerImplTest.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/TransactionManagerImplTest.java
Mon Feb 14 08:51:19 2005
@@ -35,7 +35,7 @@


/**
- * @version $Rev: 128441 $ $Date: 2005-01-28 06:56:21 +0800 (Fri, 28 Jan
2005) $
+ * @version $Rev$ $Date: 2005-01-28 06:56:21 +0800 (Fri, 28 Jan 2005) $
*/
public class TransactionManagerImplTest extends TestCase
{

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/XATransactionTester.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/XATransactionTester.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/XATransactionTester.java
Mon Feb 14 08:51:19 2005
@@ -37,7 +37,7 @@
*
*
*
- * @version $Rev: 111396 $ $Date: 2004-12-09 23:41:29 +0800 (Thu, 09 Dec
2004) $
+ * @version $Rev$ $Date: 2004-12-09 23:41:29 +0800 (Thu, 09 Dec 2004) $
*/
public class XATransactionTester
{

Modified:
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/XidImporterTest.java
==============================================================================
---
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/XidImporterTest.java
(original)
+++
development/laboratory/planet/components/tx/impl/src/test/net/dpml/tx/tests/manager/XidImporterTest.java
Mon Feb 14 08:51:19 2005
@@ -33,7 +33,7 @@
/**
*
*
- * @version $Rev: 111396 $ $Date: 2004-12-09 23:41:29 +0800 (Thu, 09 Dec
2004) $
+ * @version $Rev$ $Date: 2004-12-09 23:41:29 +0800 (Thu, 09 Dec 2004) $
*
*/
public class XidImporterTest extends TestCase

Modified: development/laboratory/planet/components/tx/index.xml
==============================================================================
--- development/laboratory/planet/components/tx/index.xml (original)
+++ development/laboratory/planet/components/tx/index.xml Mon Feb 14
08:51:19 2005
@@ -31,6 +31,20 @@
</info>
</resource>

+ <project basedir="api">
+ <info>
+ <group>dpml/components/tx</group>
+ <name>dpml-tx-api</name>
+ <version>1.0.0</version>
+ </info>
+ <dependencies>
+ <include key="jta-spec" />
+ </dependencies>
+ <plugins>
+ <include key="dpml-meta-tools"/>
+ </plugins>
+ </project>
+
<project basedir="impl">
<info>
<group>dpml/components/tx</group>
@@ -38,6 +52,7 @@
<version>1.0.0</version>
</info>
<dependencies>
+ <include key="dpml-tx-api" />
<include key="jta-spec" />
<include key="dpml-transit-main" />
</dependencies>



  • svn commit: r1774 - in development/laboratory/planet/components/tx: . api api/src api/src/main api/src/main/net api/src/main/net/dpml api/src/main/net/dpml/tx api/src/main/net/dpml/tx/manager impl impl/src/main/net/dpml/tx impl/src/main/net/dpml/tx/context impl/src/main/net/dpml/tx/log impl/src/main/net/dpml/tx/manager impl/src/test/net/dpml/tx/tests/context impl/src/test/net/dpml/tx/tests/log impl/src/test/net/dpml/tx/tests/manager, niclas, 02/14/2005

Archive powered by MHonArc 2.6.24.

Top of Page