djencks 2004/01/18 22:29:08
Modified:
modules/core/src/java/org/apache/geronimo/connector/outbound/connectiontracking
ConnectionTrackingCoordinator.java
modules/core/src/java/org/apache/geronimo/transaction
TransactionManagerProxy.java
Log:
gbeanify
Revision Changes Path
1.4 +24 -1
incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java
Index: ConnectionTrackingCoordinator.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ConnectionTrackingCoordinator.java 1 Jan 2004 09:55:08 -0000
1.3
+++ ConnectionTrackingCoordinator.java 19 Jan 2004 06:29:08 -0000
1.4
@@ -68,6 +68,10 @@
import org.apache.geronimo.connector.outbound.ConnectionInfo;
import org.apache.geronimo.connector.outbound.ConnectorTransactionContext;
import org.apache.geronimo.kernel.service.GeronimoMBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoFactory;
+import org.apache.geronimo.gbean.GAttributeInfo;
+import org.apache.geronimo.gbean.GOperationInfo;
/**
* ConnectionTrackingCoordinator tracks connections that are in use by
@@ -87,6 +91,8 @@
*/
public class ConnectionTrackingCoordinator implements
TrackedConnectionAssociator, ConnectionTracker {
+ private final static GBeanInfo GBEAN_INFO;
+
private final ThreadLocal currentConnectorComponentContexts = new
ThreadLocal();
private final ThreadLocal currentConnectorTransactionContexts = new
ThreadLocal();
private final ThreadLocal currentUnshareableResources = new
ThreadLocal();
@@ -173,6 +179,23 @@
public ConnectorTransactionContext getConnectorTransactionContext() {
return (ConnectorTransactionContext)
currentConnectorTransactionContexts.get();
+ }
+
+ static {
+ GBeanInfoFactory infoFactory = new
GBeanInfoFactory(ConnectionTrackingCoordinator.class.getName());
+ infoFactory.addOperation(new GOperationInfo("enter", new String[]
{ConnectorComponentContext.class.getName()}));
+ infoFactory.addOperation(new GOperationInfo("exit", new String[]
{ConnectorComponentContext.class.getName(), Set.class.getName()}));
+ infoFactory.addOperation(new
GOperationInfo("setConnectorTransactionContext", new String[]
{ConnectorTransactionContext.class.getName()}));
+ infoFactory.addOperation(new
GOperationInfo("setUnshareableResources", new String[] {Set.class.getName()}));
+ infoFactory.addOperation(new
GOperationInfo("resetConnectorTransactionContext", new String[]
{ConnectorTransactionContext.class.getName()}));
+ infoFactory.addOperation(new GOperationInfo("handleObtained", new
String[] {ConnectionTrackingInterceptor.class.getName(),
ConnectionInfo.class.getName()}));
+ infoFactory.addOperation(new GOperationInfo("handleReleased",new
String[] {ConnectionTrackingInterceptor.class.getName(),
ConnectionInfo.class.getName()}));
+ infoFactory.addOperation(new
GOperationInfo("getConnectorTransactionContext"));
+ GBEAN_INFO = infoFactory.getBeanInfo();
+ }
+
+ public static GBeanInfo getGBeanInfo() {
+ return GBEAN_INFO;
}
public static GeronimoMBeanInfo getGeronimoMBeanInfo() {
1.4 +28 -4
incubator-geronimo/modules/core/src/java/org/apache/geronimo/transaction/TransactionManagerProxy.java
Index: TransactionManagerProxy.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/transaction/TransactionManagerProxy.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TransactionManagerProxy.java 17 Nov 2003 00:46:09 -0000 1.3
+++ TransactionManagerProxy.java 19 Jan 2004 06:29:08 -0000 1.4
@@ -68,7 +68,9 @@
import javax.transaction.xa.XAException;
import javax.transaction.xa.Xid;
-import org.apache.geronimo.connector.work.GeronimoWorkManager;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoFactory;
+import org.apache.geronimo.gbean.GOperationInfo;
import org.apache.geronimo.kernel.service.GeronimoMBeanInfo;
import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
@@ -81,6 +83,9 @@
* @version $Revision$ $Date$
*/
public class TransactionManagerProxy implements TransactionManager,
XATerminator {
+
+ private static final GBeanInfo GBEAN_INFO;
+
private final TransactionManager delegate;
private final ThreadLocal threadTx = new ThreadLocal();
@@ -199,7 +204,26 @@
public void rollback(Xid arg0) throws XAException {
throw new XAException("Not implemented.");
}
-
+
+ //for now we use the default constructor.
+ static {
+ GBeanInfoFactory infoFactory = new
GBeanInfoFactory(TransactionManagerProxy.class.getName());
+ infoFactory.addOperation(new GOperationInfo("setTransactionTimeout",
new String[] {Integer.TYPE.getName()}));
+ infoFactory.addOperation(new GOperationInfo("begin"));
+ infoFactory.addOperation(new GOperationInfo("getStatus"));
+ infoFactory.addOperation(new GOperationInfo("getTransaction"));
+ infoFactory.addOperation(new GOperationInfo("suspend"));
+ infoFactory.addOperation(new GOperationInfo("resume", new String[]
{Transaction.class.getName()}));
+ infoFactory.addOperation(new GOperationInfo("commit"));
+ infoFactory.addOperation(new GOperationInfo("rollback"));
+ infoFactory.addOperation(new GOperationInfo("setRollbackOnly"));
+ GBEAN_INFO = infoFactory.getBeanInfo();
+ }
+
+ public static GBeanInfo getGBeanInfo() {
+ return GBEAN_INFO;
+ }
+
/**
* Provides the GeronimoMBean description for this class
* @return
@@ -211,5 +235,5 @@
rc.addOperationsDeclaredIn(XATerminator.class);
return rc;
}
-
+
}