[jboss-cvs] JBossAS SVN: r58184 - in projects/microcontainer/trunk/aop-mc-int/src: main/org/jboss/aop/microcontainer/aspects/jmx resources/tests/org/jboss/test/microcontainer/test tests/org/jboss/test/microcontainer/support tests/org/jboss/test/microcontainer/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 7 12:25:18 EST 2006


Author: kabir.khan at jboss.com
Date: 2006-11-07 12:24:38 -0500 (Tue, 07 Nov 2006)
New Revision: 58184

Added:
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/SimpleBeanAnnotatedImpl2.java
Modified:
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/aspects/jmx/JMX.java
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/SimpleBeanAnnotatedImpl.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.java
Log:
Use retention policy for @JMX and test that the object name can be used in the annotation

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/aspects/jmx/JMX.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/aspects/jmx/JMX.java	2006-11-07 15:38:22 UTC (rev 58183)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/aspects/jmx/JMX.java	2006-11-07 17:24:38 UTC (rev 58184)
@@ -21,12 +21,19 @@
 */ 
 package org.jboss.aop.microcontainer.aspects.jmx;
 
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
 /**
  * A temporary home for this annotation interface
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision$
  */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
 public @interface JMX 
 {
    Class exposedInterface();

Modified: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.xml	2006-11-07 15:38:22 UTC (rev 58183)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.xml	2006-11-07 17:24:38 UTC (rev 58184)
@@ -60,4 +60,5 @@
 
    <bean name="AnnotatedBean" class="org.jboss.test.microcontainer.support.SimpleBeanAnnotatedImpl"/>
 
+   <bean name="AnnotatedBean2" class="org.jboss.test.microcontainer.support.SimpleBeanAnnotatedImpl2"/>
 </deployment>

Modified: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/SimpleBeanAnnotatedImpl.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/SimpleBeanAnnotatedImpl.java	2006-11-07 15:38:22 UTC (rev 58183)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/SimpleBeanAnnotatedImpl.java	2006-11-07 17:24:38 UTC (rev 58184)
@@ -29,7 +29,7 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
- at JMX(name="test:name=AnnotatedBean", exposedInterface=SimpleBeanImplMBean.class)
+ at JMX(exposedInterface=SimpleBeanImplMBean.class)
 public class SimpleBeanAnnotatedImpl extends SimpleBeanImpl
 {
 }

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/SimpleBeanAnnotatedImpl2.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/SimpleBeanAnnotatedImpl2.java	2006-11-07 15:38:22 UTC (rev 58183)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/SimpleBeanAnnotatedImpl2.java	2006-11-07 17:24:38 UTC (rev 58184)
@@ -0,0 +1,35 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.test.microcontainer.support;
+
+import org.jboss.aop.microcontainer.aspects.jmx.JMX;
+
+/**
+ * SimpleBeanImpl.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 44470 $
+ */
+ at JMX(name="test:name=AnnotatedNotBean", exposedInterface=SimpleBeanImplMBean.class)
+public class SimpleBeanAnnotatedImpl2 extends SimpleBeanImpl
+{
+}

Modified: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.java	2006-11-07 15:38:22 UTC (rev 58183)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.java	2006-11-07 17:24:38 UTC (rev 58184)
@@ -71,6 +71,13 @@
       ops = info.getOperations();
       assertEquals(1, ops.length);
       assertEquals("someOtherMethod", ops[0].getName());
+      
+      name = new ObjectName("test:name=AnnotatedNotBean");
+      info = server.getMBeanInfo(name);
+      assertNotNull(info);
+      ops = info.getOperations();
+      assertEquals(1, ops.length);
+      assertEquals("someOtherMethod", ops[0].getName());
    }
    
    /**




More information about the jboss-cvs-commits mailing list