Package org.jboss.managed.api.annotation

Examples of org.jboss.managed.api.annotation.ManagementComponent


                        String name = comp.getName().getCanonicalName();
                        ManagementObject moAnn = createMOAnnotation(name, comp.getType(), comp.getSubtype());

                        // Both the ManagementObject and ManagementComponent annotation need to be in the MO annotations
                        mo.getAnnotations().put(ManagementObject.class.getName(), moAnn);
                        ManagementComponent mcAnn = moAnn.componentType();
                        mo.getAnnotations().put(ManagementComponent.class.getName(), mcAnn);
                        unitMOs.put(name, mo);
                     }
                     catch(Exception e)
                     {
View Full Code Here


                     String name = comp.getName().getCanonicalName();
                     ManagementObject moAnn = createMOAnnotation(name, comp.getType(), comp.getSubtype());
                    
                     // Both the ManagementObject and ManagementComponent annotation need to be in the MO annotations
                     mo.getAnnotations().put(ManagementObject.class.getName(), moAnn);
                     ManagementComponent mcAnn = moAnn.componentType();
                     mo.getAnnotations().put(ManagementComponent.class.getName(), mcAnn);
                     unitMOs.put(name, mo);
                  }
                  catch(Exception e)
                  {
View Full Code Here

      Map<String, Annotation> moAnns = mo.getAnnotations();
      ManagementObject managementObject = (ManagementObject) moAnns.get(ManagementObject.class.getName());
      if (managementObject != null && managementObject.isRuntime())
      {
         boolean merged = false;
         ManagementComponent mc = managementObject.componentType();
         boolean isMC = !(mc.type().length() == 0 && mc.subtype().length() == 0);

         // Merge this with the ManagedObject
         ManagedObject parentMO = moRegistry.get(key);
         if (parentMO == null && isMC == false)
         {
            log.debug("Deferring resolution of runtime ManagedObject: "+managementObject);
            // Save the runtime mo for merging
            runtimeMOs.put(key, mo);
         }
         else
         {
            mergeRuntimeMO(parentMO, mo);
            merged = true;
            runtimeMOs.remove(key);
         }
         // Update the runtime state of any ManagedComponent associated with this runtime mo
         ManagedComponent comp = md.getComponent(mo.getName());
         if (comp != null)
         {
            RunState state = updateRunState(mo, comp);
            log.debug("Updated component: "+comp+" run state to: "+state);
         }
         // There is no further processing of runtime ManagedObjects, unless its marked as a component
         if (isMC == false)
            return;
         //
         else if (merged == false)
         {
            Set<ManagedOperation> runtimeOps = mo.getOperations();
            runtimeOps = createOperationProxies(mo, runtimeOps);
            MutableManagedObject moi = (MutableManagedObject) mo;
            moi.setOperations(runtimeOps);
         }
      }
      else
      {
         // See if there is runtime info to merge
         ManagedObject runtimeMO = runtimeMOs.get(key);
         if (runtimeMO != null)
         {
            mergeRuntimeMO(mo, runtimeMO);
            runtimeMOs.remove(key);
            // Update the runtime state of any ManagedComponent associated with this runtime mo
            ManagedComponent comp = md.getComponent(mo.getName());
            if (comp != null)
            {
               RunState state = updateRunState(runtimeMO, comp);
               log.debug("Updated component: "+comp+" run state to: "+state);
            }
         }
      }

      // Update the MO registry
      // TODO - does this make sense? In case of a MetaType.isCollection we could get different results then
//      ManagedObject prevMO = moRegistry.put(key, mo);
//      if( prevMO != null )
//      {
//         // This should only matter for ManagedObjects that have a ManagementObjectID
//         log.debug("Duplicate mo for key: "+key+", prevMO: "+prevMO);
//         return;
//      }
      // Check for unresolved refs
      checkForReferences(key, mo);

      // Map any existing ManagedComponent types
      for(ManagedComponent comp : md.getComponents().values())
      {
         log.debug("Updating ManagementComponent: "+comp);
         ComponentType type = comp.getType();
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
         {
            typeComps = new HashSet<ManagedComponent>();
            compByCompType.put(type, typeComps);
         }
         typeComps.add(comp);
      }

      // Create ManagedComponents for ManagedObjects annotated with ManagementComponent
      ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
      if (mc != null && md.getComponent(mo.getName()) == null)
      {
         ComponentType type = new ComponentType(mc.type(), mc.subtype());
         ManagedComponentImpl comp = new TempManagedComponentImpl(type, md, mo);
         md.addComponent(mo.getName(), comp);
         log.debug("Processing ManagementComponent("+mo.getName()+"): "+comp);
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
View Full Code Here

                     // System.err.println(annotationExpr);
                     ManagementObject moAnn = (ManagementObject) AnnotationCreator.createAnnotation(
                           annotationExpr, ManagementObject.class);
                     // Bot the ManagementObject and ManagementComponent annotation need to be in the MO annotations
                     mo.getAnnotations().put(ManagementObject.class.getName(), moAnn);
                     ManagementComponent mcAnn = moAnn.componentType();
                     mo.getAnnotations().put(ManagementComponent.class.getName(), mcAnn);
                     unitMOs.put(comp.getName().getCanonicalName(), mo);
                  }
                  catch(Exception e)
                  {
View Full Code Here

      Map<String, Annotation> moAnns = mo.getAnnotations();
      ManagementObject managementObject = (ManagementObject) moAnns.get(ManagementObject.class.getName());
      if (managementObject.isRuntime())
      {
         boolean merged = false;
         ManagementComponent mc = managementObject.componentType();
         boolean isMC = !(mc.type().length() == 0 && mc.subtype().length() == 0);
        
         // Merge this with the ManagedObject
         ManagedObject parentMO = moRegistry.get(key);
         if (parentMO == null && isMC == false)
         {
            log.debug("Deferring resolution of runtime ManagedObject: "+managementObject);
            // Save the runtime mo for merging
            runtimeMOs.put(key, mo);
         }
         else
         {
            mergeRuntimeMO(parentMO, mo);
            merged = true;
            runtimeMOs.remove(key);
         }
         // Update the runtime state of any ManagedComponent associated with this runtime mo
         ManagedComponent comp = md.getComponent(mo.getName());
         if (comp != null)
         {
            RunState state = updateRunState(mo, comp);
            log.debug("Updated component: "+comp+" run state to: "+state);
         }
         // There is no further processing of runtime ManagedObjects, unless its marked as a component
         if (isMC == false)
            return;
         //
         else if (merged == false)
         {
            Set<ManagedOperation> runtimeOps = mo.getOperations();
            runtimeOps = createOperationProxies(mo, runtimeOps);
            MutableManagedObject moi = (MutableManagedObject) mo;
            moi.setOperations(runtimeOps);
         }
      }
      else
      {
         // See if there is runtime info to merge
         ManagedObject runtimeMO = runtimeMOs.get(key);
         if (runtimeMO != null)
         {
            mergeRuntimeMO(mo, runtimeMO);
            runtimeMOs.remove(key);
            // Update the runtime state of any ManagedComponent associated with this runtime mo
            ManagedComponent comp = md.getComponent(mo.getName());
            if (comp != null)
            {
               RunState state = updateRunState(runtimeMO, comp);
               log.debug("Updated component: "+comp+" run state to: "+state);
            }
         }
      }

      // Update the MO registry
      // TODO - does this make sense? In case of a MetaType.isCollection we could get different results then
//      ManagedObject prevMO = moRegistry.put(key, mo);
//      if( prevMO != null )
//      {
//         // This should only matter for ManagedObjects that have a ManagementObjectID
//         log.debug("Duplicate mo for key: "+key+", prevMO: "+prevMO);
//         return;
//      }
      // Check for unresolved refs
      checkForReferences(key, mo);

      // Map any existing ManagedComponent types
      for(ManagedComponent comp : md.getComponents().values())
      {
         log.debug("Updating ManagementComponent: "+comp);
         ComponentType type = comp.getType();
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
         {
            typeComps = new HashSet<ManagedComponent>();
            compByCompType.put(type, typeComps);
         }
         typeComps.add(comp);
      }

      // Create ManagedComponents for ManagedObjects annotated with ManagementComponent
      ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
      if (mc != null && md.getComponent(mo.getName()) == null)
      {
         ComponentType type = new ComponentType(mc.type(), mc.subtype());
         ManagedComponentImpl comp = new ManagedComponentImpl(type, md, mo);
         md.addComponent(mo.getName(), comp);
         log.debug("Processing ManagementComponent("+mo.getName()+"): "+comp);
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
View Full Code Here

            nameType = null;
         attachmentName = managementObject.attachmentName();
         if (attachmentName.length() == 0)
            attachmentName = classInfo.getName();
         // Check for a component specification
         ManagementComponent mc = null;
         if (metaData != null )
            mc = metaData.getAnnotation(ManagementComponent.class);
         if (mc == null)
            mc = managementObject.componentType();
         // Work around JBMDR-51 by checking type/subtype
         // if (mc.equals(AnnotationDefaults.COMP_TYPE) == false)
         if (mc.type().length() > 0 || mc.subtype().length() > 0)
         {
            log.debug("ManagedObject("+name+") is ManagedComponent type: "+mc);
            moAnnotations.put(ManagementComponent.class.getName(), mc);
         }
         // ManagementObject level default factory classes
View Full Code Here

            nameType = null;
         attachmentName = managementObject.attachmentName();
         if (attachmentName.length() == 0)
            attachmentName = classInfo.getName();
         // Check for a component specification
         ManagementComponent mc = managementObject.componentType();
         if (mc.equals(AnnotationDefaults.COMP_TYPE) == false)
            moAnnotations.put(ManagementComponent.class.getName(), mc);
         // ManagementObject level default factory classes
         moFieldsFactory = managementObject.fieldsFactory();
         moConstraintsFactory = managementObject.constraintsFactory();
         moPropertyFactory = managementObject.propertyFactory();
View Full Code Here

            nameType = null;
         attachmentName = managementObject.attachmentName();
         if (attachmentName.length() == 0)
            attachmentName = classInfo.getName();
         // Check for a component specification
         ManagementComponent mc = managementObject.componentType();
         if (mc.equals(AnnotationDefaults.COMP_TYPE) == false)
            moAnnotations.put(ManagementComponent.class.getName(), mc);
         // ManagementObject level default factory classes
         moFieldsFactory = managementObject.fieldsFactory();
         moConstraintsFactory = managementObject.constraintsFactory();
         moPropertyFactory = managementObject.propertyFactory();
View Full Code Here

            nameType = null;
         attachmentName = managementObject.attachmentName();
         if (attachmentName.length() == 0)
            attachmentName = classInfo.getName();
         // Check for a component specification
         ManagementComponent mc = managementObject.componentType();
         if (mc.equals(AnnotationDefaults.COMP_TYPE) == false)
            moAnnotations.put(ManagementComponent.class.getName(), mc);
         // ManagementObject level default factory classes
         moFieldsFactory = managementObject.fieldsFactory();
         moConstraintsFactory = managementObject.constraintsFactory();
         moPropertyFactory = managementObject.propertyFactory();
View Full Code Here

   protected void validateComponentType(ManagedObject mo)
   {
      Map<String, Annotation> moAnns = mo.getAnnotations();
      assertNotNull(moAnns);
      ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
      assertNotNull(mc);
      assertEquals("MBean", mc.type());
      assertEquals("Platform", mc.subtype());     
   }
View Full Code Here

TOP

Related Classes of org.jboss.managed.api.annotation.ManagementComponent

Copyright © 2018 www.massapicom. 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.