geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r280972 - in /geronimo/trunk/modules: j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java mail/project.xml mail/src/java/org/apache/geronimo/mail/MailGBean.java
Date Wed, 14 Sep 2005 23:59:39 GMT
Author: jboynes
Date: Wed Sep 14 16:59:34 2005
New Revision: 280972

URL: http://svn.apache.org/viewcvs?rev=280972&view=rev
Log:
JSR77 attributes for MEJB and javamail

Modified:
    geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java
    geronimo/trunk/modules/mail/project.xml
    geronimo/trunk/modules/mail/src/java/org/apache/geronimo/mail/MailGBean.java

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java?rev=280972&r1=280971&r2=280972&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java (original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java Wed Sep 14
16:59:34 2005
@@ -40,7 +40,8 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.MBeanServerDelegate;
- 
+import org.apache.geronimo.management.J2EEManagedObject;
+
 /**
  * GBean implementing Management interface and supplying proxies to act as the MEJB container.
  *
@@ -48,9 +49,11 @@
  */
 public class MEJB implements Management {
     private final MBeanServer mbeanServer;
+    private final String objectName;
 
-    public MEJB(Kernel kernel) {
+    public MEJB(String objectName, Kernel kernel) {
         mbeanServer = new MBeanServerDelegate(kernel);
+        this.objectName = objectName;
     }
 
     public MBeanInfo getMBeanInfo(ObjectName objectName) throws InstanceNotFoundException,
IntrospectionException, ReflectionException {
@@ -118,14 +121,32 @@
     public void remove() throws RemoveException {
     }
 
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isStateManageable() {
+        return false;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public boolean isEventProvider() {
+        return false;
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(MEJB.class);
+        infoBuilder.addAttribute("objectName", String.class, false);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(Management.class);
+        infoBuilder.addInterface(J2EEManagedObject.class);
 
-        infoBuilder.setConstructor(new String[]{"kernel"});
+        infoBuilder.setConstructor(new String[]{"objectName", "kernel"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/trunk/modules/mail/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/mail/project.xml?rev=280972&r1=280971&r2=280972&view=diff
==============================================================================
--- geronimo/trunk/modules/mail/project.xml (original)
+++ geronimo/trunk/modules/mail/project.xml Wed Sep 14 16:59:34 2005
@@ -56,6 +56,12 @@
         </dependency>
 
         <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-management</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
             <groupId>geronimo-spec</groupId>
             <artifactId>geronimo-spec-javamail</artifactId>
             <version>${geronimo_spec_javamail_version}</version>

Modified: geronimo/trunk/modules/mail/src/java/org/apache/geronimo/mail/MailGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/mail/src/java/org/apache/geronimo/mail/MailGBean.java?rev=280972&r1=280971&r2=280972&view=diff
==============================================================================
--- geronimo/trunk/modules/mail/src/java/org/apache/geronimo/mail/MailGBean.java (original)
+++ geronimo/trunk/modules/mail/src/java/org/apache/geronimo/mail/MailGBean.java Wed Sep 14
16:59:34 2005
@@ -29,6 +29,7 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.management.JavaMailResource;
 
 
 /**
@@ -44,7 +45,7 @@
  * @see POP3StoreGBean
  * @see IMAPStoreGBean
  */
-public class MailGBean implements GBeanLifecycle {
+public class MailGBean implements GBeanLifecycle, JavaMailResource {
 
     private final Log log = LogFactory.getLog(MailGBean.class);
 
@@ -92,13 +93,6 @@
     }
 
     /**
-     * Returns the GBean name of this Mail GBean
-     */
-    public String getObjectName() {
-        return objectName;
-    }
-
-    /**
      * Returns the set of protocol GBeans that contain protocol specific configurations.
      */
     public Collection getProtocols() {
@@ -345,6 +339,25 @@
         log.info("Failed " + objectName);
     }
 
+    /**
+     * Returns the GBean name of this Mail GBean
+     */
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isStateManageable() {
+        return false;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public boolean isEventProvider() {
+        return false;
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
@@ -362,6 +375,7 @@
         infoFactory.addAttribute("debug", Boolean.class, true);
         infoFactory.addOperation("$getResource");
         infoFactory.addOperation("getProtocols");
+        infoFactory.addInterface(JavaMailResource.class);
 
         infoFactory.setConstructor(new String[]{"objectName",
                                                 "Protocols",



Mime
View raw message