User: osh
Date: 01/01/23 22:07:01
Added: src/main/org/jboss/tm
JRMPTransactionPropagationContextFactory.java
TransactionPropagationContextFactory.java
Log:
New files needed (but not really used yet).
Revision Changes Path
1.1
jboss/src/main/org/jboss/tm/JRMPTransactionPropagationContextFactory.java
Index: JRMPTransactionPropagationContextFactory.java
===================================================================
/*
* JBoss, the OpenSource EJB server
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.tm;
/**
* A class for getting a transaction propagation context
* at the client-side, suited for same-VM JRMP propagation.
* This class is meant to be used with the parts of JBoss
* that act as clients to JBoss in the same VM.
* In particular, this is <em>not</em> for standalone clients.
*
* @see TransactionPropagationContextFactory
* @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a>
* @version $Revision: 1.1 $
*/
public class JRMPTransactionPropagationContextFactory
implements TransactionPropagationContextFactory
{
/**
* Our singleton instance.
*/
static private JRMPTransactionPropagationContextFactory singleton
= new JRMPTransactionPropagationContextFactory();
/**
* Returns the singleton instance of this class.
*/
static public JRMPTransactionPropagationContextFactory getInstance()
{
return singleton;
}
/**
* A reference to the TxManager singleton instance.
* This could be obtained by simply doing
* <code>TxManager.getInstance()</code> when needed, but we
* do this for <em>every</em> outgoing JRMP call.
*/
private TxManager tm;
/**
* Private constructor for singleton.
*/
private JRMPTransactionPropagationContextFactory()
{
tm = TxManager.getInstance();
}
/**
* Return the XidImpl of the current transaction.
*/
public Object getTransactionPropagationContext()
{
return tm.getXid();
}
}
1.1
jboss/src/main/org/jboss/tm/TransactionPropagationContextFactory.java
Index: TransactionPropagationContextFactory.java
===================================================================
/*
* JBoss, the OpenSource EJB server
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.tm;
/**
* Implementations of this interface are used for getting
* a transaction propagation context at the client-side.
* We need a specific implementation of this interface for
* each kind of DTM we are going to interoperate with. (So
* we may have 20 new classes if we are going to interoperate
* with 20 different kinds of distributed transaction
* managers.)
*
* @see TransactionImpl
* @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a>
* @version $Revision: 1.1 $
*/
public interface TransactionPropagationContextFactory
{
/**
* Return a transaction propagation context for the transaction
* currently associated with the invoking thread, or <code>null</code>
* if the invoking thread is not associated with a transaction.
* The reason for having this method return Object is that we do not
* really know what kind of transaction propagation context we get.
*/
public Object getTransactionPropagationContext();
}