Package org.jboss.managed.api.annotation

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


               defines the ManagedObject id name from the property value.
             */
            Map<String, Annotation> annotations = property.getAnnotations();
            if (annotations == null)
               continue;
            ManagementObjectID id = (ManagementObjectID) annotations.get(ManagementObjectID.class.getName());
            if (id != null)
            {
               if (value == null || value.getMetaType().isSimple() == false)
               {
                  log.warn("Cannot create String name from non-Simple property: "
View Full Code Here


/* 282 */       log.debug("Checking property: " + prop);
/*     */
/* 284 */       Map pannotations = prop.getAnnotations();
/* 285 */       if ((pannotations != null) && (!pannotations.isEmpty()))
/*     */       {
/* 287 */         ManagementObjectID id = (ManagementObjectID)pannotations.get(ManagementObjectID.class.getName());
/* 288 */         if (id != null)
/*     */         {
/* 290 */           Object refName = getRefName(prop.getValue());
/* 291 */           if (refName == null)
/* 292 */             refName = id.name();
/* 293 */           String propKey = refName + "/" + id.type();
/* 294 */           log.debug("ManagedProperty level ID for ManagedObject: " + propKey + ", attachmentName: " + mo.getAttachmentName());
/* 295 */           this.moRegistry.put(propKey, mo);
/* 296 */           checkForReferences(propKey, mo);
/*     */         }
/*     */
View Full Code Here

/* 266 */       return null;
/*     */     }
/*     */
/* 269 */     HashMap moAnnotations = new HashMap();
/* 270 */     moAnnotations.put(ManagementObject.class.getName(), managementObject);
/* 271 */     ManagementObjectID moID = (ManagementObjectID)classInfo.getUnderlyingAnnotation(ManagementObjectID.class);
/* 272 */     if (moID != null) {
/* 273 */       moAnnotations.put(ManagementObjectID.class.getName(), moID);
/*     */     }
/*     */
/* 276 */     boolean isRuntime = managementObject.isRuntime();
/* 277 */     String name = classInfo.getName();
/* 278 */     String nameType = null;
/* 279 */     String attachmentName = classInfo.getName();
/* 280 */     Class moFieldsFactory = null;
/* 281 */     Class moConstraintsFactory = null;
/* 282 */     Class moPropertyFactory = null;
/* 283 */     if (managementObject != null)
/*     */     {
/* 285 */       name = managementObject.name();
/* 286 */       if ((name.length() == 0) || (name.equals("%Generated%")))
/* 287 */         name = classInfo.getName();
/* 288 */       nameType = managementObject.type();
/* 289 */       if (nameType.length() == 0)
/* 290 */         nameType = null;
/* 291 */       attachmentName = managementObject.attachmentName();
/* 292 */       if (attachmentName.length() == 0) {
/* 293 */         attachmentName = classInfo.getName();
/*     */       }
/* 295 */       ManagementComponent mc = managementObject.componentType();
/* 296 */       if (!mc.equals(AnnotationDefaults.COMP_TYPE)) {
/* 297 */         moAnnotations.put(ManagementComponent.class.getName(), mc);
/*     */       }
/* 299 */       moFieldsFactory = managementObject.fieldsFactory();
/* 300 */       moConstraintsFactory = managementObject.constraintsFactory();
/* 301 */       moPropertyFactory = managementObject.propertyFactory();
/*     */     }
/*     */
/* 304 */     if (trace)
/*     */     {
/* 306 */       log.trace("Building MangedObject(name=" + name + ",nameType=" + nameType + ",attachmentName=" + attachmentName + ",isRuntime=" + isRuntime + ")");
/*     */     }
/*     */
/* 310 */     ManagementProperties propertyType = ManagementProperties.ALL;
/* 311 */     if (managementObject != null) {
/* 312 */       propertyType = managementObject.properties();
/*     */     }
/*     */
/* 315 */     Set properties = new HashSet();
/*     */
/* 317 */     Set propertyInfos = beanInfo.getProperties();
/* 318 */     if ((propertyInfos != null) && (!propertyInfos.isEmpty()))
/*     */     {
/* 320 */       for (PropertyInfo propertyInfo : propertyInfos)
/*     */       {
/* 323 */         if ("class".equals(propertyInfo.getName())) {
/*     */           continue;
/*     */         }
/* 326 */         ManagementProperty managementProperty = (ManagementProperty)propertyInfo.getUnderlyingAnnotation(ManagementProperty.class);
/* 327 */         ManagementObjectID id = (ManagementObjectID)propertyInfo.getUnderlyingAnnotation(ManagementObjectID.class);
/* 328 */         ManagementObjectRef ref = (ManagementObjectRef)propertyInfo.getUnderlyingAnnotation(ManagementObjectRef.class);
/* 329 */         ManagementRuntimeRef runtimeRef = (ManagementRuntimeRef)propertyInfo.getUnderlyingAnnotation(ManagementRuntimeRef.class);
/* 330 */         HashMap propAnnotations = new HashMap();
/* 331 */         if (managementProperty != null)
/* 332 */           propAnnotations.put(ManagementProperty.class.getName(), managementProperty);
/* 333 */         if (id != null)
/*     */         {
/* 335 */           propAnnotations.put(ManagementObjectID.class.getName(), id);
/*     */
/* 337 */           nameType = id.type();
/*     */         }
/* 339 */         if (ref != null)
/* 340 */           propAnnotations.put(ManagementObjectRef.class.getName(), ref);
/* 341 */         if (runtimeRef != null) {
/* 342 */           propAnnotations.put(ManagementRuntimeRef.class.getName(), runtimeRef);
View Full Code Here

/*     */         }
/*     */
/* 596 */         Map annotations = property.getAnnotations();
/* 597 */         if (annotations == null)
/*     */           continue;
/* 599 */         ManagementObjectID id = (ManagementObjectID)annotations.get(ManagementObjectID.class.getName());
/* 600 */         if (id != null)
/*     */         {
/* 602 */           if ((value == null) || (!value.getMetaType().isSimple()))
/*     */           {
/* 604 */             log.warn("Cannot create String name from non-Simple property: " + property + ", value=" + value);
View Full Code Here

      HashMap<String, Annotation> moAnnotations = new HashMap<String, Annotation>();
      moAnnotations.put(ManagementObject.class.getName(), managementObject);
      ManagementDeployment mnagementDeployment = getAnnotation(ManagementDeployment.class, classInfo, metaData);
      if(mnagementDeployment != null)
         moAnnotations.put(ManagementDeployment.class.getName(), mnagementDeployment);
      ManagementObjectID moID = getAnnotation(ManagementObjectID.class, classInfo, metaData);
      if (moID != null)
         moAnnotations.put(ManagementObjectID.class.getName(), moID);

      // Process the ManagementObject fields
      boolean isRuntime = managementObject.isRuntime();
      String name = classInfo.getName();
      String nameType = null;
      String attachmentName = classInfo.getName();
      Class<? extends Fields> moFieldsFactory = null;
      ConstraintsPopulatorFactory moCPF = null;
      Class<? extends ManagedPropertyConstraintsPopulatorFactory> moConstraintsFactory = null;
      Class<? extends ManagedProperty> moPropertyFactory = null;
      if (managementObject != null)
      {
         name = managementObject.name();
         if (name.length() == 0 || name.equals(ManagementConstants.GENERATED))
            name = classInfo.getName();
         nameType = managementObject.type();
         if (nameType.length() == 0)
            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
         FieldsFactory ff = getAnnotation(FieldsFactory.class, classInfo, metaData);
         if(ff != null)
            moFieldsFactory = ff.value();
         moCPF = getAnnotation(ConstraintsPopulatorFactory.class, classInfo, metaData);
         if(moCPF != null)
            moConstraintsFactory = moCPF.value();
         ManagementPropertyFactory mpf = getAnnotation(ManagementPropertyFactory.class, classInfo, metaData);
         if(mpf != null)
            moPropertyFactory = mpf.value();
      }

      if (trace)
      {
         log.trace("Building MangedObject(name="+name+",nameType="+nameType
               +",attachmentName="+attachmentName+",isRuntime="+isRuntime+")");
      }

      ManagementProperties propertyType = ManagementProperties.ALL;
      Set<String> classProperties = null;
      if (managementObject != null)
      {
         propertyType = managementObject.properties();
         if(propertyType == ManagementProperties.CLASS || propertyType == ManagementProperties.CLASS_AND_EXPLICIT)
         {
            classProperties = new HashSet<String>();
            for(ManagementProperty mp : managementObject.classProperties())
            {
               if(mp.name().length() > 0)
                  classProperties.add(mp.name());
               if(mp.mappedName().length() > 0)
                  classProperties.add(mp.mappedName());
            }
         }
      }

      // Build the ManagedProperties
      Set<ManagedProperty> properties = new HashSet<ManagedProperty>();

      Set<PropertyInfo> propertyInfos = beanInfo.getProperties();
      if (propertyInfos != null && propertyInfos.isEmpty() == false)
      {
         for (PropertyInfo propertyInfo : propertyInfos)
         {
            // Ignore the "class" property
            if ("class".equals(propertyInfo.getName()))
               continue;

            ManagementProperty managementProperty = getAnnotation(ManagementProperty.class, propertyInfo, metaData);
            ManagementObjectID id = getAnnotation(ManagementObjectID.class, propertyInfo, metaData);
            ManagementObjectRef ref = getAnnotation(ManagementObjectRef.class, propertyInfo, metaData);
            ManagementRuntimeRef runtimeRef = getAnnotation(ManagementRuntimeRef.class, propertyInfo, metaData);
            RunStateProperty rsp = getAnnotation(RunStateProperty.class, propertyInfo, metaData);
            Masked masked = getAnnotation(Masked.class, propertyInfo, metaData);
            DefaultValueBuilderFactory defaultsFactory = getAnnotation(DefaultValueBuilderFactory.class, propertyInfo, metaData);
            HashMap<String, Annotation> propAnnotations = new HashMap<String, Annotation>();
            if (managementProperty != null)
               propAnnotations.put(ManagementProperty.class.getName(), managementProperty);
            if (id != null)
            {
               propAnnotations.put(ManagementObjectID.class.getName(), id);
               // This overrides the MO nameType
               nameType = id.type();
            }
            if (ref != null)
               propAnnotations.put(ManagementObjectRef.class.getName(), ref);
            if (runtimeRef != null)
               propAnnotations.put(ManagementRuntimeRef.class.getName(), runtimeRef);
View Full Code Here

TOP

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

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.