You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2009/08/23 00:14:17 UTC
svn commit: r806899 - in
/geronimo/components/txmanager/trunk/geronimo-connector/src:
main/java/org/apache/geronimo/connector/
main/java/org/apache/geronimo/connector/work/
test/java/org/apache/geronimo/connector/
test/java/org/apache/geronimo/connecto...
Author: djencks
Date: Sat Aug 22 22:14:17 2009
New Revision: 806899
URL: http://svn.apache.org/viewvc?rev=806899&view=rev
Log:
update to spec
Added:
geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionContextHandler.java (contents, props changed)
- copied, changed from r803189, geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionInflowContextHandler.java
geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkContextHandler.java (contents, props changed)
- copied, changed from r803189, geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/InflowContextHandler.java
Removed:
geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/InflowContextHandler.java
geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionInflowContextHandler.java
Modified:
geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/GeronimoBootstrapContext.java
geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java
geronimo/components/txmanager/trunk/geronimo-connector/src/test/java/org/apache/geronimo/connector/BootstrapContextTest.java
geronimo/components/txmanager/trunk/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java
Modified: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/GeronimoBootstrapContext.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/GeronimoBootstrapContext.java?rev=806899&r1=806898&r2=806899&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/GeronimoBootstrapContext.java (original)
+++ geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/GeronimoBootstrapContext.java Sat Aug 22 22:14:17 2009
@@ -21,6 +21,8 @@
import javax.resource.spi.UnavailableException;
import javax.resource.spi.XATerminator;
import javax.resource.spi.work.WorkManager;
+import javax.resource.spi.work.WorkContext;
+import javax.transaction.TransactionSynchronizationRegistry;
/**
* GBean BootstrapContext implementation that refers to externally configured WorkManager
@@ -72,4 +74,12 @@
return new Timer();
}
+ public TransactionSynchronizationRegistry getTransactionSynchronizationRegistry() {
+ return null;
+ }
+
+ public boolean isContextSupported(Class<? extends WorkContext> aClass) {
+ return false;
+ }
+
}
Modified: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java?rev=806899&r1=806898&r2=806899&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java (original)
+++ geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java Sat Aug 22 22:14:17 2009
@@ -65,7 +65,7 @@
*/
private Executor scheduledWorkExecutorPool;
- private final Collection<InflowContextHandler> inflowContextHandlers;
+ private final Collection<WorkContextHandler> workContextHandlers;
private final WorkExecutor scheduleWorkExecutor = new ScheduleWorkExecutor();
@@ -79,11 +79,11 @@
this(null, null, null, null);
}
- public GeronimoWorkManager(Executor sync, Executor start, Executor sched, Collection<InflowContextHandler> inflowContextHandlers) {
+ public GeronimoWorkManager(Executor sync, Executor start, Executor sched, Collection<WorkContextHandler> workContextHandlers) {
syncWorkExecutorPool = sync;
startWorkExecutorPool = start;
scheduledWorkExecutorPool = sched;
- this.inflowContextHandlers = inflowContextHandlers == null ? Collections.<InflowContextHandler>emptyList() : inflowContextHandlers;
+ this.workContextHandlers = workContextHandlers == null ? Collections.<WorkContextHandler>emptyList() : workContextHandlers;
}
public void doStart() throws Exception {
@@ -116,7 +116,7 @@
* @see javax.resource.spi.work.WorkManager#doWork(javax.resource.spi.work.Work)
*/
public void doWork(Work work) throws WorkException {
- executeWork(new WorkerContext(work, inflowContextHandlers), syncWorkExecutor, syncWorkExecutorPool);
+ executeWork(new WorkerContext(work, workContextHandlers), syncWorkExecutor, syncWorkExecutorPool);
}
/* (non-Javadoc)
@@ -129,7 +129,7 @@
WorkListener workListener)
throws WorkException {
WorkerContext workWrapper =
- new WorkerContext(work, startTimeout, execContext, workListener, inflowContextHandlers);
+ new WorkerContext(work, startTimeout, execContext, workListener, workContextHandlers);
workWrapper.setThreadPriority(Thread.currentThread().getPriority());
executeWork(workWrapper, syncWorkExecutor, syncWorkExecutorPool);
}
@@ -138,7 +138,7 @@
* @see javax.resource.spi.work.WorkManager#startWork(javax.resource.spi.work.Work)
*/
public long startWork(Work work) throws WorkException {
- WorkerContext workWrapper = new WorkerContext(work, inflowContextHandlers);
+ WorkerContext workWrapper = new WorkerContext(work, workContextHandlers);
workWrapper.setThreadPriority(Thread.currentThread().getPriority());
executeWork(workWrapper, startWorkExecutor, startWorkExecutorPool);
return System.currentTimeMillis() - workWrapper.getAcceptedTime();
@@ -154,7 +154,7 @@
WorkListener workListener)
throws WorkException {
WorkerContext workWrapper =
- new WorkerContext(work, startTimeout, execContext, workListener, inflowContextHandlers);
+ new WorkerContext(work, startTimeout, execContext, workListener, workContextHandlers);
workWrapper.setThreadPriority(Thread.currentThread().getPriority());
executeWork(workWrapper, startWorkExecutor, startWorkExecutorPool);
return System.currentTimeMillis() - workWrapper.getAcceptedTime();
@@ -164,7 +164,7 @@
* @see javax.resource.spi.work.WorkManager#scheduleWork(javax.resource.spi.work.Work)
*/
public void scheduleWork(Work work) throws WorkException {
- WorkerContext workWrapper = new WorkerContext(work, inflowContextHandlers);
+ WorkerContext workWrapper = new WorkerContext(work, workContextHandlers);
workWrapper.setThreadPriority(Thread.currentThread().getPriority());
executeWork(workWrapper, scheduleWorkExecutor, scheduledWorkExecutorPool);
}
@@ -179,7 +179,7 @@
WorkListener workListener)
throws WorkException {
WorkerContext workWrapper =
- new WorkerContext(work, startTimeout, execContext, workListener, inflowContextHandlers);
+ new WorkerContext(work, startTimeout, execContext, workListener, workContextHandlers);
workWrapper.setThreadPriority(Thread.currentThread().getPriority());
executeWork(workWrapper, scheduleWorkExecutor, scheduledWorkExecutorPool);
}
Copied: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionContextHandler.java (from r803189, geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionInflowContextHandler.java)
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionContextHandler.java?p2=geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionContextHandler.java&p1=geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionInflowContextHandler.java&r1=803189&r2=806899&rev=806899&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionInflowContextHandler.java (original)
+++ geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionContextHandler.java Sat Aug 22 22:14:17 2009
@@ -20,7 +20,7 @@
package org.apache.geronimo.connector.work;
-import javax.resource.spi.work.TransactionInflowContext;
+import javax.resource.spi.work.TransactionContext;
import javax.resource.spi.work.WorkCompletedException;
import javax.transaction.xa.XAException;
import javax.transaction.InvalidTransactionException;
@@ -32,46 +32,46 @@
/**
* @version $Rev$ $Date$
*/
-public class TransactionInflowContextHandler implements InflowContextHandler<TransactionInflowContext>{
+public class TransactionContextHandler implements WorkContextHandler<TransactionContext>{
private final XAWork xaWork;
- public TransactionInflowContextHandler(XAWork xaWork) {
+ public TransactionContextHandler(XAWork xaWork) {
this.xaWork = xaWork;
}
- public void before(TransactionInflowContext inflowContext) throws WorkCompletedException {
- if (inflowContext.getXid() != null) {
+ public void before(TransactionContext workContext) throws WorkCompletedException {
+ if (workContext.getXid() != null) {
try {
- long transactionTimeout = inflowContext.getTransactionTimeout();
+ long transactionTimeout = workContext.getTransactionTimeout();
//translate -1 value to 0 to indicate default transaction timeout.
- xaWork.begin(inflowContext.getXid(), transactionTimeout < 0 ? 0 : transactionTimeout);
+ xaWork.begin(workContext.getXid(), transactionTimeout < 0 ? 0 : transactionTimeout);
} catch (XAException e) {
- throw (WorkCompletedException)new WorkCompletedException("Transaction import failed for xid " + inflowContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
+ throw (WorkCompletedException)new WorkCompletedException("Transaction import failed for xid " + workContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
} catch (InvalidTransactionException e) {
- throw (WorkCompletedException)new WorkCompletedException("Transaction import failed for xid " + inflowContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
+ throw (WorkCompletedException)new WorkCompletedException("Transaction import failed for xid " + workContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
} catch (SystemException e) {
- throw (WorkCompletedException)new WorkCompletedException("Transaction import failed for xid " + inflowContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
+ throw (WorkCompletedException)new WorkCompletedException("Transaction import failed for xid " + workContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
} catch (ImportedTransactionActiveException e) {
- throw (WorkCompletedException)new WorkCompletedException("Transaction already active for xid " + inflowContext.getXid(), WorkCompletedException.TX_CONCURRENT_WORK_DISALLOWED).initCause(e);
+ throw (WorkCompletedException)new WorkCompletedException("Transaction already active for xid " + workContext.getXid(), WorkCompletedException.TX_CONCURRENT_WORK_DISALLOWED).initCause(e);
}
}
}
- public void after(TransactionInflowContext inflowContext) throws WorkCompletedException {
- if (inflowContext.getXid() != null) {
+ public void after(TransactionContext workContext) throws WorkCompletedException {
+ if (workContext.getXid() != null) {
try {
- xaWork.end(inflowContext.getXid());
+ xaWork.end(workContext.getXid());
} catch (XAException e) {
- throw (WorkCompletedException)new WorkCompletedException("Transaction end failed for xid " + inflowContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
+ throw (WorkCompletedException)new WorkCompletedException("Transaction end failed for xid " + workContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
} catch (SystemException e) {
- throw (WorkCompletedException)new WorkCompletedException("Transaction end failed for xid " + inflowContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
+ throw (WorkCompletedException)new WorkCompletedException("Transaction end failed for xid " + workContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
}
}
}
- public Class<TransactionInflowContext> getHandledClass() {
- return TransactionInflowContext.class;
+ public Class<TransactionContext> getHandledClass() {
+ return TransactionContext.class;
}
public boolean required() {
Propchange: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionContextHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionContextHandler.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/TransactionContextHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Copied: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkContextHandler.java (from r803189, geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/InflowContextHandler.java)
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkContextHandler.java?p2=geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkContextHandler.java&p1=geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/InflowContextHandler.java&r1=803189&r2=806899&rev=806899&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/InflowContextHandler.java (original)
+++ geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkContextHandler.java Sat Aug 22 22:14:17 2009
@@ -20,17 +20,17 @@
package org.apache.geronimo.connector.work;
-import javax.resource.spi.work.InflowContext;
+import javax.resource.spi.work.WorkContext;
import javax.resource.spi.work.WorkCompletedException;
/**
* @version $Rev$ $Date$
*/
-public interface InflowContextHandler<E extends InflowContext> {
+public interface WorkContextHandler<E extends WorkContext> {
- void before(E inflowContext) throws WorkCompletedException;
+ void before(E workContext) throws WorkCompletedException;
- void after(E inflowContext) throws WorkCompletedException;
+ void after(E workContext) throws WorkCompletedException;
Class<E> getHandledClass();
Propchange: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkContextHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkContextHandler.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkContextHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java?rev=806899&r1=806898&r2=806899&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java (original)
+++ geronimo/components/txmanager/trunk/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java Sat Aug 22 22:14:17 2009
@@ -26,9 +26,9 @@
import javax.resource.NotSupportedException;
import javax.resource.spi.work.ExecutionContext;
-import javax.resource.spi.work.InflowContext;
-import javax.resource.spi.work.InflowContextProvider;
-import javax.resource.spi.work.TransactionInflowContext;
+import javax.resource.spi.work.WorkContext;
+import javax.resource.spi.work.WorkContextProvider;
+import javax.resource.spi.work.TransactionContext;
import javax.resource.spi.work.Work;
import javax.resource.spi.work.WorkAdapter;
import javax.resource.spi.work.WorkCompletedException;
@@ -50,7 +50,7 @@
private static final Logger log = LoggerFactory.getLogger(WorkerContext.class);
- private static final List<InflowContext> NO_INFLOW_CONTEXT = Collections.emptyList();
+ private static final List<WorkContext> NO_INFLOW_CONTEXT = Collections.emptyList();
/**
* Null WorkListener used as the default WorkListener.
@@ -123,18 +123,18 @@
*/
private final ExecutionContext executionContext;
- private final List<InflowContextHandler> inflowContextHandlers;
+ private final List<WorkContextHandler> workContextHandlers;
/**
* Create a WorkWrapper.
- * TODO include a InflowContextLifecycleListener
+ * TODO include a WorkContextLifecycleListener
* @param work Work to be wrapped.
- * @param inflowContextHandlers InflowContextHandlers supported by this work manager
+ * @param workContextHandlers WorkContextHandlers supported by this work manager
*/
- public WorkerContext(Work work, Collection<InflowContextHandler> inflowContextHandlers) {
+ public WorkerContext(Work work, Collection<WorkContextHandler> workContextHandlers) {
adaptee = work;
- this.inflowContextHandlers = new ArrayList<InflowContextHandler>(inflowContextHandlers);
+ this.workContextHandlers = new ArrayList<WorkContextHandler>(workContextHandlers);
executionContext = null;
workListener = NULL_WORK_LISTENER;
}
@@ -142,20 +142,20 @@
/**
* Create a WorkWrapper with the specified execution context.
*
- * TODO include a InflowContextLifecycleListener
+ * TODO include a WorkContextLifecycleListener
* @param aWork Work to be wrapped.
* @param aStartTimeout a time duration (in milliseconds) within which the
* execution of the Work instance must start.
* @param execContext an object containing the execution context with which
* the submitted Work instance must be executed.
* @param workListener an object which would be notified when the various
- * @param inflowContextHandlers InflowContextHandlers supported by this work manager
- * @throws javax.resource.spi.work.WorkRejectedException if executionContext supplied yet Work implements InflowContextProvider
+ * @param workContextHandlers WorkContextHandlers supported by this work manager
+ * @throws javax.resource.spi.work.WorkRejectedException if executionContext supplied yet Work implements WorkContextProvider
*/
public WorkerContext(Work aWork,
long aStartTimeout,
ExecutionContext execContext,
- WorkListener workListener, Collection<InflowContextHandler> inflowContextHandlers) throws WorkRejectedException {
+ WorkListener workListener, Collection<WorkContextHandler> workContextHandlers) throws WorkRejectedException {
adaptee = aWork;
startTimeOut = aStartTimeout;
if (null == workListener) {
@@ -163,15 +163,15 @@
} else {
this.workListener = workListener;
}
- if (aWork instanceof InflowContextProvider) {
+ if (aWork instanceof WorkContextProvider) {
if (execContext != null) {
- throw new WorkRejectedException("Execution context provided but Work implements InflowContextProvider");
+ throw new WorkRejectedException("Execution context provided but Work implements WorkContextProvider");
}
executionContext = null;
} else {
executionContext = execContext;
}
- this.inflowContextHandlers = new ArrayList<InflowContextHandler>(inflowContextHandlers);
+ this.workContextHandlers = new ArrayList<WorkContextHandler>(workContextHandlers);
}
/* (non-Javadoc)
@@ -305,59 +305,59 @@
//Implementation note: we assume this is being called without an interesting TransactionContext,
//and ignore/replace whatever is associated with the current thread.
try {
- List<InflowContext> inflowContexts = NO_INFLOW_CONTEXT;
+ List<WorkContext> workContexts = NO_INFLOW_CONTEXT;
if (executionContext != null) {
- TransactionInflowContext txInflowContext = new TransactionInflowContext();
+ TransactionContext txWorkContext = new TransactionContext();
try {
- txInflowContext.setTransactionTimeout(executionContext.getTransactionTimeout());
+ txWorkContext.setTransactionTimeout(executionContext.getTransactionTimeout());
} catch (NotSupportedException e) {
throw new WorkRejectedException("Could not read tx timeout");
}
- inflowContexts = Collections.<InflowContext>singletonList(txInflowContext);
- } else if (adaptee instanceof InflowContextProvider) {
- inflowContexts = ((InflowContextProvider) adaptee).getInflowContexts();
+ workContexts = Collections.<WorkContext>singletonList(txWorkContext);
+ } else if (adaptee instanceof WorkContextProvider) {
+ workContexts = ((WorkContextProvider) adaptee).getWorkContexts();
}
- List<InflowContextHandler> sortedHandlers = new ArrayList<InflowContextHandler>(inflowContexts.size());
- for (InflowContext inflowContext : inflowContexts) {
+ List<WorkContextHandler> sortedHandlers = new ArrayList<WorkContextHandler>(workContexts.size());
+ for (WorkContext workContext : workContexts) {
boolean found = false;
- for (Iterator<InflowContextHandler> it = inflowContextHandlers.iterator(); it.hasNext();) {
- InflowContextHandler inflowContextHandler = it.next();
+ for (Iterator<WorkContextHandler> it = workContextHandlers.iterator(); it.hasNext();) {
+ WorkContextHandler workContextHandler = it.next();
//TODO is this the right way around?
- if (inflowContext.getClass().isAssignableFrom(inflowContextHandler.getHandledClass())) {
+ if (workContext.getClass().isAssignableFrom(workContextHandler.getHandledClass())) {
it.remove();
- sortedHandlers.add(inflowContextHandler);
+ sortedHandlers.add(workContextHandler);
found = true;
break;
}
}
if (!found) {
- throw new WorkCompletedException("Duplicate or unhandled InflowContext: " + inflowContext);
+ throw new WorkCompletedException("Duplicate or unhandled WorkContext: " + workContext);
}
}
- for (Iterator<InflowContextHandler> it = inflowContextHandlers.iterator(); it.hasNext();) {
- InflowContextHandler inflowContextHandler = it.next();
- if (!inflowContextHandler.required()) {
+ for (Iterator<WorkContextHandler> it = workContextHandlers.iterator(); it.hasNext();) {
+ WorkContextHandler workContextHandler = it.next();
+ if (!workContextHandler.required()) {
it.remove();
}
}
- // TODO use a InflowContextLifecycleListener
+ // TODO use a WorkContextLifecycleListener
int i = 0;
- for (InflowContext inflowContext : inflowContexts) {
- sortedHandlers.get(i++).before(inflowContext);
+ for (WorkContext workContext : workContexts) {
+ sortedHandlers.get(i++).before(workContext);
}
- for (InflowContextHandler inflowContextHandler: inflowContextHandlers) {
- inflowContextHandler.before(null);
+ for (WorkContextHandler workContextHandler: workContextHandlers) {
+ workContextHandler.before(null);
}
try {
adaptee.run();
} finally {
int j = 0;
- for (InflowContext inflowContext : inflowContexts) {
- sortedHandlers.get(j++).after(inflowContext);
+ for (WorkContext workContext : workContexts) {
+ sortedHandlers.get(j++).after(workContext);
}
- for (InflowContextHandler inflowContextHandler: inflowContextHandlers) {
- inflowContextHandler.after(null);
+ for (WorkContextHandler workContextHandler: workContextHandlers) {
+ workContextHandler.after(null);
}
}
Modified: geronimo/components/txmanager/trunk/geronimo-connector/src/test/java/org/apache/geronimo/connector/BootstrapContextTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-connector/src/test/java/org/apache/geronimo/connector/BootstrapContextTest.java?rev=806899&r1=806898&r2=806899&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-connector/src/test/java/org/apache/geronimo/connector/BootstrapContextTest.java (original)
+++ geronimo/components/txmanager/trunk/geronimo-connector/src/test/java/org/apache/geronimo/connector/BootstrapContextTest.java Sat Aug 22 22:14:17 2009
@@ -31,8 +31,8 @@
import junit.framework.TestCase;
import org.apache.geronimo.connector.work.GeronimoWorkManager;
-import org.apache.geronimo.connector.work.TransactionInflowContextHandler;
-import org.apache.geronimo.connector.work.InflowContextHandler;
+import org.apache.geronimo.connector.work.TransactionContextHandler;
+import org.apache.geronimo.connector.work.WorkContextHandler;
import org.apache.geronimo.transaction.manager.GeronimoTransactionManager;
import org.apache.geronimo.transaction.manager.XAWork;
@@ -97,8 +97,8 @@
*/
public void testGetSetWorkManager() throws Exception {
GeronimoTransactionManager transactionManager = new GeronimoTransactionManager();
- TransactionInflowContextHandler txInflowContextHandler = new TransactionInflowContextHandler(transactionManager);
- GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, Collections.<InflowContextHandler>singletonList(txInflowContextHandler));
+ TransactionContextHandler txWorkContextHandler = new TransactionContextHandler(transactionManager);
+ GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, Collections.<WorkContextHandler>singletonList(txWorkContextHandler));
GeronimoBootstrapContext context = new GeronimoBootstrapContext(manager, transactionManager);
WorkManager wm = context.getWorkManager();
@@ -110,8 +110,8 @@
*/
public void testGetSetXATerminator() throws Exception {
GeronimoTransactionManager transactionManager = new GeronimoTransactionManager();
- TransactionInflowContextHandler txInflowContextHandler = new TransactionInflowContextHandler(transactionManager);
- GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, Collections.<InflowContextHandler>singletonList(txInflowContextHandler));
+ TransactionContextHandler txWorkContextHandler = new TransactionContextHandler(transactionManager);
+ GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, Collections.<WorkContextHandler>singletonList(txWorkContextHandler));
GeronimoBootstrapContext context = new GeronimoBootstrapContext(manager, transactionManager);
XATerminator xat = context.getXATerminator();
Modified: geronimo/components/txmanager/trunk/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/trunk/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java?rev=806899&r1=806898&r2=806899&view=diff
==============================================================================
--- geronimo/components/txmanager/trunk/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java (original)
+++ geronimo/components/txmanager/trunk/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java Sat Aug 22 22:14:17 2009
@@ -52,7 +52,7 @@
super.setUp();
XAWork xaWork = new GeronimoTransactionManager();
- TransactionInflowContextHandler txInflowContextHandler = new TransactionInflowContextHandler(xaWork);
+ TransactionContextHandler txWorkContextHandler = new TransactionContextHandler(xaWork);
int poolSize = 1;
int keepAliveTime = 30000;
ThreadPoolExecutor pool = new ThreadPoolExecutor(
@@ -65,7 +65,7 @@
pool.setThreadFactory(new ThreadPoolThreadFactory("Connector Test", getClass().getClassLoader()));
- workManager = new GeronimoWorkManager(pool, pool, pool, Collections.<InflowContextHandler>singletonList(txInflowContextHandler));
+ workManager = new GeronimoWorkManager(pool, pool, pool, Collections.<WorkContextHandler>singletonList(txWorkContextHandler));
workManager.doStart();
}