geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r280904 - in /geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector: JCAResourceImpl.java JCAResourceImplGBean.java
Date Wed, 14 Sep 2005 18:41:08 GMT
Author: jboynes
Date: Wed Sep 14 11:41:05 2005
New Revision: 280904

URL: http://svn.apache.org/viewcvs?rev=280904&view=rev
Log:
add ManagedObject attributes for JCAResource

Modified:
    geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java
    geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImplGBean.java

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java?rev=280904&r1=280903&r2=280904&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java
Wed Sep 14 11:41:05 2005
@@ -16,8 +16,8 @@
  */
 package org.apache.geronimo.connector;
 
-import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
@@ -25,30 +25,56 @@
 import org.apache.geronimo.j2ee.management.impl.Util;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.management.JCAResource;
 
 /**
  * @version $Rev:  $ $Date:  $
  */
-public class JCAResourceImpl {
+public class JCAResourceImpl implements JCAResource  {
     private final Kernel kernel;
+    private final String objectName;
     private final J2eeContext moduleContext;
 
     private static final String[] CONNECTION_FACTORY_TYPES = {NameFactory.JCA_CONNECTION_FACTORY};
     private static final String[] RESOURCE_ADAPTER_INSTANCE_TYPES = {NameFactory.JCA_RESOURCE_ADAPTER};
 
     public JCAResourceImpl(String objectName, Kernel kernel) {
+        this.objectName = objectName;
+        this.kernel = kernel;
+
         ObjectName myObjectName = JMXUtil.getObjectName(objectName);
         moduleContext = J2eeContextImpl.newContext(myObjectName, NameFactory.JCA_RESOURCE);
+    }
 
-        this.kernel = kernel;
+    public String[] getConnectionFactories() {
+        try {
+            return Util.getObjectNames(kernel, moduleContext, CONNECTION_FACTORY_TYPES);
+        } catch (MalformedObjectNameException e) {
+            throw new AssertionError();
+        }
     }
 
-    public String[] getConnectionFactories() throws MalformedObjectNameException {
-        return Util.getObjectNames(kernel, moduleContext, CONNECTION_FACTORY_TYPES);
+    public String[] getResourceAdapterInstances() {
+        try {
+            return Util.getObjectNames(kernel, moduleContext, RESOURCE_ADAPTER_INSTANCE_TYPES);
+        } catch (MalformedObjectNameException e) {
+            throw new AssertionError();
+        }
     }
 
-    public String[] getResourceAdapterInstances() throws MalformedObjectNameException {
-        return Util.getObjectNames(kernel, moduleContext, RESOURCE_ADAPTER_INSTANCE_TYPES);
+    public String getObjectName() {
+        return objectName;
     }
 
+    public boolean isStateManageable() {
+        return false;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public boolean isEventProvider() {
+        return false;
+    }
 }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImplGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImplGBean.java?rev=280904&r1=280903&r2=280904&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImplGBean.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImplGBean.java
Wed Sep 14 11:41:05 2005
@@ -21,6 +21,7 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.management.JCAResource;
 
 public class JCAResourceImplGBean {
 
@@ -30,9 +31,7 @@
         GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(JCAResourceImpl.class, NameFactory.JCA_RESOURCE);
         infoBuilder.addAttribute("objectName", String.class, false);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
-
-        infoBuilder.addAttribute("connectionFactories", String[].class, false);
-        infoBuilder.addAttribute("resourceAdapterInstances", String[].class, false);
+        infoBuilder.addInterface(JCAResource.class);
 
         infoBuilder.setConstructor(new String[]{
             "objectName",



Mime
View raw message