Examples of ModelMBeanInfo


Examples of javax.management.modelmbean.ModelMBeanInfo

   {
      ExoModelMBean mbean = null;
      try
      {
         ExoMBeanInfoBuilder infoBuilder = new ExoMBeanInfoBuilder(context.getMetaData());
         ModelMBeanInfo info = infoBuilder.build();
         mbean = new ExoModelMBean(context, context.getResource(), info);
      }
      catch (Exception e)
      {
         LOG.warn("Could not create the ExoModelMBean for the class " +
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

        try {
            registerMBeanWithServer(obj, name, forceRegistration);
        } catch (NotCompliantMBeanException e) {
            // If this is not a "normal" MBean, then try to deploy it using JMX
            // annotations
            ModelMBeanInfo mbi = null;
            mbi = assembler.getMBeanInfo(obj, name.toString());
            RequiredModelMBean mbean = (RequiredModelMBean)server.instantiate(RequiredModelMBean.class
                .getName());
            mbean.setModelMBeanInfo(mbi);
            try {
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

    public DefaultManagementMBeanAssembler() {
        this.assembler = new MBeanInfoAssembler();
    }

    public ModelMBean assemble(MBeanServer mBeanServer, Object obj, ObjectName name) throws JMException {
        ModelMBeanInfo mbi = null;

        // prefer to use the managed instance if it has been annotated with JMX annotations
        if (obj instanceof ManagedInstance) {
            // there may be a custom embedded instance which have additional methods
            Object custom = ((ManagedInstance) obj).getInstance();
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

        String description = getDescription(customManagedBean != null ? customManagedBean : defaultManagedBean, objectName);
        ModelMBeanAttributeInfo[] arrayAttributes = mBeanAttributes.toArray(new ModelMBeanAttributeInfo[mBeanAttributes.size()]);
        ModelMBeanOperationInfo[] arrayOperations = mBeanOperations.toArray(new ModelMBeanOperationInfo[mBeanOperations.size()]);
        ModelMBeanNotificationInfo[] arrayNotifications = mBeanNotifications.toArray(new ModelMBeanNotificationInfo[mBeanNotifications.size()]);

        ModelMBeanInfo info = new ModelMBeanInfoSupport(name, description, arrayAttributes, null, arrayOperations, arrayNotifications);
        LOG.trace("Created ModelMBeanInfo {}", info);
        return info;
    }
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

      }
      ExoModelMBean mbean = null;
      try
      {
         ExoMBeanInfoBuilder infoBuilder = new ExoMBeanInfoBuilder(context.getMetaData());
         ModelMBeanInfo info = infoBuilder.build();
         mbean = new ExoModelMBean(context, context.getResource(), info);
      }
      catch (IllegalArgumentException e)
      {
         LOG.warn("Could not create the ExoModelMBean for the class " + context.getResource() == null ? null : context
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

   {
      ExoModelMBean mbean = null;
      try
      {
         ExoMBeanInfoBuilder infoBuilder = new ExoMBeanInfoBuilder(context.getMetaData());
         ModelMBeanInfo info = infoBuilder.build();
         mbean = new ExoModelMBean(context, context.getResource(), info);
      }
      catch (Exception e)
      {
         e.printStackTrace();
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

    public void register(Object obj, ObjectName name, boolean forceRegistration) throws JMException {
        try {
            registerMBeanWithServer(obj, name, forceRegistration);
        } catch (NotCompliantMBeanException e) {
            // If this is not a "normal" MBean, then try to deploy it using JMX annotations
            ModelMBeanInfo mbi;
            mbi = assembler.getMBeanInfo(obj, name.toString());
            RequiredModelMBean mbean = (RequiredModelMBean)server.instantiate(RequiredModelMBean.class.getName());
            mbean.setModelMBeanInfo(mbi);
            try {
                mbean.setManagedResource(obj, "ObjectReference");
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

        if (manager != null && manager.getBus() != null) {
            managedEndpoint = new ManagedRMEndpoint(this);
            instrumentationManager = manager.getBus().getExtension(InstrumentationManager.class);       
            if (instrumentationManager != null) {  
                ModelMBeanAssembler assembler = new ModelMBeanAssembler();
                ModelMBeanInfo mbi = assembler.getModelMbeanInfo(managedEndpoint.getClass());
                MBeanServer mbs = instrumentationManager.getMBeanServer();
                if (mbs == null) {
                    LOG.log(Level.WARNING, "MBeanServer not available.");
                } else {
                    try {
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

        try {
            registerMBeanWithServer(obj, persist(name), forceRegistration);          
        } catch (NotCompliantMBeanException e) {       
            //If this is not a "normal" MBean, then try to deploy it using JMX annotations
            ModelMBeanAssembler assembler = new ModelMBeanAssembler();
            ModelMBeanInfo mbi = assembler.getModelMbeanInfo(obj.getClass());
            register(obj, name, mbi, forceRegistration);
        }               
    }
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

         while(names.hasMoreElements() && infos.hasMoreElements())
         {

            ObjectName curName = (ObjectName) names.nextElement();
            logger().debug("curName: " + curName);
            ModelMBeanInfo curInfo = (ModelMBeanInfo) infos.nextElement();
            Descriptor mbeanDescriptor = curInfo.getMBeanDescriptor();
            String fieldName = ModelMBeanConstants.RESOURCE_CLASS;
            String className = (String) mbeanDescriptor.getFieldValue(fieldName);
            logger().debug("className: " + className);
            Object resource = getMBeanServer().instantiate(className);
            ModelMBean modelmbean = new RequiredModelMBean();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.