geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r393679 - in /geronimo/branches/1.1/modules: connector/src/java/org/apache/geronimo/connector/ connector/src/java/org/apache/geronimo/connector/outbound/ management/src/java/org/apache/geronimo/management/geronimo/
Date Thu, 13 Apr 2006 01:43:57 GMT
Author: djencks
Date: Wed Apr 12 18:43:53 2006
New Revision: 393679

URL: http://svn.apache.org/viewcvs?rev=393679&view=rev
Log:
Fix getConnectionManager method, allow navigation through actual objects rather than names
through ResourceAdapterModule tree

Added:
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapter.java
Modified:
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImpl.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/AbstractConnectionManager.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerContainer.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResource.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapterModule.java

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java?rev=393679&r1=393678&r2=393679&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java
(original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java
Wed Apr 12 18:43:53 2006
@@ -18,8 +18,7 @@
 
 import org.apache.geronimo.management.geronimo.JCAResource;
 import org.apache.geronimo.management.geronimo.JCAResourceAdapter;
-import org.apache.geronimo.management.JCAConnectionFactory;
-import org.apache.geronimo.connector.outbound.JCAConnectionFactoryImpl;
+import org.apache.geronimo.management.geronimo.JCAConnectionFactory;
 
 import java.util.Collection;
 import java.util.ArrayList;
@@ -49,13 +48,21 @@
         return (String[])temp.toArray(new String[temp.size()]);
     }
 
-    public String[] getResourceAdapterInstances() {
+    public String[] getResourceAdapterInstanceNames() {
         ArrayList temp = new ArrayList();
         for (Iterator iterator = resourceAdapters.iterator(); iterator.hasNext();) {
             JCAResourceAdapter resourceAdapter = (JCAResourceAdapter) iterator.next();
             temp.add(resourceAdapter.getObjectName());
         }
         return (String[])temp.toArray(new String[temp.size()]);
+    }
+
+    public JCAResourceAdapter[] getResourceAdapterInstances() {
+        return (JCAResourceAdapter[])resourceAdapters.toArray(new JCAResourceAdapter[resourceAdapters.size()]);
+    }
+
+    public JCAConnectionFactory[] getConnectionFactoryInstances() {
+        return (JCAConnectionFactory[])connectionFactories.toArray(new JCAConnectionFactory[connectionFactories.size()]);
     }
 
     public String getObjectName() {

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImpl.java?rev=393679&r1=393678&r2=393679&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImpl.java
(original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImpl.java
Wed Apr 12 18:43:53 2006
@@ -16,7 +16,7 @@
  */
 package org.apache.geronimo.connector;
 
-import org.apache.geronimo.management.ResourceAdapter;
+import org.apache.geronimo.management.geronimo.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.JCAResource;
 
 /**
@@ -49,5 +49,9 @@
 
     public boolean isEventProvider() {
         return false;
+    }
+
+    public JCAResource[] getJCAResourceImplementations() {
+        return new JCAResource[] {jcaResource};
     }
 }

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java?rev=393679&r1=393678&r2=393679&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
(original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
Wed Apr 12 18:43:53 2006
@@ -24,7 +24,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
-import org.apache.geronimo.management.ResourceAdapter;
+import org.apache.geronimo.management.geronimo.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
@@ -157,6 +157,10 @@
 
     public String getEISType() {
         return eisType;
+    }
+
+    public ResourceAdapter[] getResourceAdapterInstances() {
+        return new ResourceAdapter[] {resourceAdapter};
     }
 
     /**

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/AbstractConnectionManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/AbstractConnectionManager.java?rev=393679&r1=393678&r2=393679&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/AbstractConnectionManager.java
(original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/AbstractConnectionManager.java
Wed Apr 12 18:43:53 2006
@@ -45,6 +45,10 @@
         return mcf.createConnectionFactory(this);
     }
 
+    public ConnectionManager getConnectionManager() {
+        return this;
+    }
+    
     /**
      * in: mcf != null, is a deployed mcf
      * out: useable connection object.

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerContainer.java?rev=393679&r1=393678&r2=393679&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerContainer.java
(original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionManagerContainer.java
Wed Apr 12 18:43:53 2006
@@ -19,6 +19,7 @@
 
 import javax.resource.ResourceException;
 import javax.resource.spi.ManagedConnectionFactory;
+import javax.resource.spi.ConnectionManager;
 import javax.transaction.xa.XAException;
 import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
@@ -35,6 +36,8 @@
     Object createConnectionFactory(ManagedConnectionFactory mcf) throws ResourceException;
 
     ReturnableXAResource getRecoveryXAResource(ManagedConnectionFactory managedConnectionFactory)
throws ResourceException;
+
+    ConnectionManager getConnectionManager();
 
     public class ReturnableXAResource implements NamedXAResource {
         private final ConnectionInterceptor stack;

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java?rev=393679&r1=393678&r2=393679&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java
(original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java
Wed Apr 12 18:43:53 2006
@@ -18,7 +18,7 @@
 
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
-import org.apache.geronimo.management.JCAConnectionFactory;
+import org.apache.geronimo.management.geronimo.JCAConnectionFactory;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 
 import javax.management.ObjectName;
@@ -44,6 +44,10 @@
         return managedConnectionFactory.getObjectName();
     }
 
+    public JCAManagedConnectionFactory getManagedConnectionFactoryInstance() {
+        return managedConnectionFactory;
+    }
+
     public String getObjectName() {
         return objectName;
     }
@@ -86,5 +90,4 @@
 //            throw new InvalidObjectNameException("JCAConnectionFactory object name can
only have j2eeType, name, JCAResource, and J2EEServer properties", objectName);
 //        }
     }
-
 }

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java?rev=393679&r1=393678&r2=393679&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
(original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
Wed Apr 12 18:43:53 2006
@@ -175,19 +175,7 @@
     }
 
     public Object getConnectionManager() {
-        try {
-            ObjectName mine = ObjectName.getInstance(objectName);
-            Properties other = new Properties();
-            other.setProperty(NameFactory.J2EE_APPLICATION, mine.getKeyProperty(NameFactory.J2EE_APPLICATION));
-            other.setProperty(NameFactory.J2EE_SERVER, mine.getKeyProperty(NameFactory.J2EE_SERVER));
-            other.setProperty(NameFactory.JCA_RESOURCE, mine.getKeyProperty(NameFactory.JCA_RESOURCE));
-            other.setProperty(NameFactory.J2EE_TYPE, NameFactory.JCA_CONNECTION_MANAGER);
-            other.setProperty(NameFactory.J2EE_NAME, mine.getKeyProperty(NameFactory.J2EE_NAME));
-            return kernel.getProxyManager().createProxy(new ObjectName(mine.getDomain(),
other), getClass().getClassLoader());
-        } catch (MalformedObjectNameException e) {
-            log.error("Unable to construct ObjectName", e);
-            return null;
-        }
+        return connectionManagerContainer.getConnectionManager();
     }
 
     public void doStart() throws Exception {

Added: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java?rev=393679&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java
(added)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java
Wed Apr 12 18:43:53 2006
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2006 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 org.apache.geronimo.management.geronimo;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface JCAConnectionFactory extends org.apache.geronimo.management.JCAConnectionFactory
{
+    JCAManagedConnectionFactory getManagedConnectionFactoryInstance();
+}

Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResource.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResource.java?rev=393679&r1=393678&r2=393679&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResource.java
(original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResource.java
Wed Apr 12 18:43:53 2006
@@ -29,5 +29,8 @@
      * @return the ObjectNames of the resource adapter instances provided by this
      *         resource
      */
-    public String[] getResourceAdapterInstances();
+    String[] getResourceAdapterInstanceNames();
+
+    JCAResourceAdapter[] getResourceAdapterInstances();
+    JCAConnectionFactory[] getConnectionFactoryInstances();
 }

Added: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapter.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapter.java?rev=393679&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapter.java
(added)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapter.java
Wed Apr 12 18:43:53 2006
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2006 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 org.apache.geronimo.management.geronimo;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface ResourceAdapter extends org.apache.geronimo.management.ResourceAdapter {
+    JCAResource[] getJCAResourceImplementations();
+}

Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapterModule.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapterModule.java?rev=393679&r1=393678&r2=393679&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapterModule.java
(original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapterModule.java
Wed Apr 12 18:43:53 2006
@@ -20,9 +20,10 @@
  * @version $Rev$ $Date$
  */
 public interface ResourceAdapterModule extends org.apache.geronimo.management.ResourceAdapterModule
{
-    public String getDisplayName();
-    public String getDescription();
-    public String getVendorName();
-    public String getResourceAdapterVersion();
-    public String getEISType();
+    String getDisplayName();
+    String getDescription();
+    String getVendorName();
+    String getResourceAdapterVersion();
+    String getEISType();
+    ResourceAdapter[] getResourceAdapterInstances();
 }



Mime
View raw message