org.jboss.system.microcontainer.jmx
Class JMXAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo>

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.kernel.plugins.annotations.BaseMetaDataAnnotationPlugin<T,C>
          extended by org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin<T,org.jboss.aop.microcontainer.aspects.jmx.JMX>
              extended by org.jboss.system.microcontainer.jmx.JMXAnnotationPlugin<T>
Type Parameters:
T - exact info type
All Implemented Interfaces:
Cloneable, org.jboss.kernel.plugins.annotations.AnnotationPlugin<T,org.jboss.aop.microcontainer.aspects.jmx.JMX>, org.jboss.kernel.plugins.annotations.MetaDataAnnotationPlugin<T,org.jboss.aop.microcontainer.aspects.jmx.JMX>, org.jboss.util.JBossInterface
Direct Known Subclasses:
JMXFieldAnnotationPlugin, JMXPropertyAnnotationPlugin

public abstract class JMXAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo>
extends org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin<T,org.jboss.aop.microcontainer.aspects.jmx.JMX>

Supporting @JMX on attributes.

Author:
Ales Justin

Field Summary
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
protected JMXAnnotationPlugin()
           
 
Method Summary
protected  String createId(org.jboss.kernel.spi.dependency.KernelControllerContext context, T info, org.jboss.aop.microcontainer.aspects.jmx.JMX jmx)
          Create unique id for the exposed pojo attribute.
protected  String createObjectName(org.jboss.dependency.spi.ControllerContext context, T info, org.jboss.aop.microcontainer.aspects.jmx.JMX jmx)
          Create object name.
protected abstract  Class<?> getExposedInterface(T info)
          Get exposed interface from info.
protected static String getJmxName(org.jboss.aop.microcontainer.aspects.jmx.JMX jmx)
          Get jmx name.
protected abstract  String getName(T info)
          Get name from info.
protected  List<? extends org.jboss.beans.metadata.spi.MetaDataVisitorNode> internalApplyAnnotation(T info, org.jboss.metadata.spi.MetaData metaData, org.jboss.aop.microcontainer.aspects.jmx.JMX jmx, org.jboss.kernel.spi.dependency.KernelControllerContext context)
           
protected  void internalCleanAnnotation(T info, org.jboss.metadata.spi.MetaData metaData, org.jboss.aop.microcontainer.aspects.jmx.JMX jmx, org.jboss.kernel.spi.dependency.KernelControllerContext context)
           
protected  boolean isCleanup()
           
protected  org.jboss.aop.microcontainer.aspects.jmx.JMX wrapJMX(org.jboss.aop.microcontainer.aspects.jmx.JMX original, String name, Class<?> exposedInterface)
          Should we wrap the original in order to get the name we created.
 
Methods inherited from class org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin
applyAnnotation, checkIfNotAbstractBeanMetaDataSpecific, cleanAnnotation, internalApplyAnnotation, internalApplyAnnotation, isMetaDataAlreadyPresent
 
Methods inherited from class org.jboss.kernel.plugins.annotations.BaseMetaDataAnnotationPlugin
applyAnnotation, getAnnotation, getSupportedTypes, isAttributePresent, isAttributePresent, isCleanupOnly, isElementTypeSupported, isMetaDataAlreadyPresent, toShortString, toString
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, hashCode, list, notEqual, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.kernel.plugins.annotations.MetaDataAnnotationPlugin
applyAnnotation, getAnnotation, getSupportedTypes
 

Constructor Detail

JMXAnnotationPlugin

protected JMXAnnotationPlugin()
Method Detail

isCleanup

protected boolean isCleanup()
Overrides:
isCleanup in class org.jboss.kernel.plugins.annotations.BaseMetaDataAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,org.jboss.aop.microcontainer.aspects.jmx.JMX>

internalApplyAnnotation

protected List<? extends org.jboss.beans.metadata.spi.MetaDataVisitorNode> internalApplyAnnotation(T info,
                                                                                                   org.jboss.metadata.spi.MetaData metaData,
                                                                                                   org.jboss.aop.microcontainer.aspects.jmx.JMX jmx,
                                                                                                   org.jboss.kernel.spi.dependency.KernelControllerContext context)
                                                                                            throws Throwable
Overrides:
internalApplyAnnotation in class org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,org.jboss.aop.microcontainer.aspects.jmx.JMX>
Throws:
Throwable

createId

protected String createId(org.jboss.kernel.spi.dependency.KernelControllerContext context,
                          T info,
                          org.jboss.aop.microcontainer.aspects.jmx.JMX jmx)
Create unique id for the exposed pojo attribute.

Parameters:
context - the context
info - the info
jmx - the annotation
Returns:
generated id

wrapJMX

protected org.jboss.aop.microcontainer.aspects.jmx.JMX wrapJMX(org.jboss.aop.microcontainer.aspects.jmx.JMX original,
                                                               String name,
                                                               Class<?> exposedInterface)
                                                        throws Throwable
Should we wrap the original in order to get the name we created.

Parameters:
original - the original
name - the new created name
exposedInterface - the exposed interface
Returns:
jmx annoation instance
Throws:
Throwable - for any error

internalCleanAnnotation

protected void internalCleanAnnotation(T info,
                                       org.jboss.metadata.spi.MetaData metaData,
                                       org.jboss.aop.microcontainer.aspects.jmx.JMX jmx,
                                       org.jboss.kernel.spi.dependency.KernelControllerContext context)
                                throws Throwable
Overrides:
internalCleanAnnotation in class org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin<T extends org.jboss.reflect.spi.AnnotatedInfo,org.jboss.aop.microcontainer.aspects.jmx.JMX>
Throws:
Throwable

getExposedInterface

protected abstract Class<?> getExposedInterface(T info)
Get exposed interface from info.

Parameters:
info - the info
Returns:
exposed interface

getName

protected abstract String getName(T info)
Get name from info.

Parameters:
info - the info
Returns:
info's name

getJmxName

protected static String getJmxName(org.jboss.aop.microcontainer.aspects.jmx.JMX jmx)
Get jmx name.

Parameters:
jmx - the JMX annotation
Returns:
valid jmx name

createObjectName

protected String createObjectName(org.jboss.dependency.spi.ControllerContext context,
                                  T info,
                                  org.jboss.aop.microcontainer.aspects.jmx.JMX jmx)
                           throws Exception
Create object name.

Parameters:
context - the context
info - the info
jmx - the annotation
Returns:
object name
Throws:
Exception - for any error


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.