Package org.gatein.management.core.api

Examples of org.gatein.management.core.api.AbstractManagedResource


      managedRole = (role == null) ? null : role.value();
   }

   public void registerOperation(AbstractManagedResource managedResource)
   {
      final AbstractManagedResource resource = registerOrGetResource(managedResource, method.getAnnotation(Managed.class));
      ManagedOperation mo = method.getAnnotation(ManagedOperation.class);
      String operationName = OperationNames.READ_RESOURCE;
      String desc = "";
      if (mo != null)
      {
         operationName = mo.name();
         desc = mo.description();
      }

      final boolean debug = log.isDebugEnabled();
      if (debug) log.debug("Registering operation " + operationName + " for path " + resource.getPath());

      Class<?> returnType = method.getReturnType();
      Managed subManaged = returnType.getAnnotation(Managed.class);
      if (subManaged != null)
      {
         if ("".equals(subManaged.value()))
         {
            AnnotatedResource ar = new AnnotatedResource(returnType, owner, this);
            ar.register(resource);
         }
         else
         {
            throw new RuntimeException("Cannot register method " + methodName + " for class " + owner.managedClass.getName()
               + " because return type " + returnType.getName() + " is annotated with a value for the @" + Managed.class.getSimpleName() + " annotation.");
         }
      }
      else
      {
         resource.registerOperationHandler(operationName, this, description(desc));
      }
   }
View Full Code Here


      managedRole = (role == null) ? null : role.value();
   }

   public void register(AbstractManagedResource resource)
   {
      AbstractManagedResource amr = registerOrGetResource(resource, managedClass.getAnnotation(Managed.class));
      for (AnnotatedOperation operation : getAnnotatedMethods())
      {
         operation.registerOperation(amr);
      }
   }
View Full Code Here

         String description = "";
         if (iterator.hasNext())
         {
            description = managed.description();
         }
         AbstractManagedResource child = (AbstractManagedResource) resource.getSubResource(path);
         if (child == null)
         {
            if (log.isDebugEnabled()) log.debug("Registering managed resource " + path);
            child = (AbstractManagedResource) resource.registerSubResource(path, description(description));
         }
View Full Code Here

TOP

Related Classes of org.gatein.management.core.api.AbstractManagedResource

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.