Examples of ManagedOperation


Examples of org.infinispan.jmx.annotations.ManagedOperation

                     atts.put(attributeName, new MethodAttributeEntry(info, method, null));
                  }
               }
            }
         } else if (method.isAnnotationPresent(ManagedOperation.class)) {
            ManagedOperation op = method.getAnnotation(ManagedOperation.class);
            String attName = method.getName();
            if (isSetMethod(method) || isGetMethod(method)) {
               attName = attName.substring(3);
            } else if (isIsMethod(method)) {
               attName = attName.substring(2);
            }
            // expose unless we already exposed matching attribute field
            boolean isAlreadyExposed = atts.containsKey(attName);
            if (!isAlreadyExposed) {
               ops.add(new MBeanOperationInfo(op != null ? op.description() : "", method));
            }
         }
      }
   }
View Full Code Here

Examples of org.infinispan.jmx.annotations.ManagedOperation

                     atts.put(attributeName, new MethodAttributeEntry(info, method, null));
                  }
               }
            }
         } else if (method.isAnnotationPresent(ManagedOperation.class)) {
            ManagedOperation op = method.getAnnotation(ManagedOperation.class);
            String attName = method.getName();
            if (isSetMethod(method) || isGetMethod(method)) {
               attName = attName.substring(3);
            } else if (isIsMethod(method)) {
               attName = attName.substring(2);
            }
            // expose unless we already exposed matching attribute field
            boolean isAlreadyExposed = atts.containsKey(attName);
            if (!isAlreadyExposed) {
               ops.add(new MBeanOperationInfo(op != null ? op.description() : "", method));
            }
         }
      }
   }
View Full Code Here

Examples of org.infinispan.jmx.annotations.ManagedOperation

                     atts.put(attributeName, new MethodAttributeEntry(info, method, null));
                  }
               }
            }
         } else if (method.isAnnotationPresent(ManagedOperation.class)) {
            ManagedOperation op = method.getAnnotation(ManagedOperation.class);
            String attName = method.getName();
            if (isSetMethod(method) || isGetMethod(method)) {
               attName = attName.substring(3);
            } else if (isIsMethod(method)) {
               attName = attName.substring(2);
            }
            // expose unless we already exposed matching attribute field
            boolean isAlreadyExposed = atts.containsKey(attName);
            if (!isAlreadyExposed) {
               ops.add(new MBeanOperationInfo(op != null ? op.description() : "", method));
            }
         }
      }
   }
View Full Code Here

Examples of org.infinispan.jmx.annotations.ManagedOperation

               }
            }
         }
      }
      for (Method method : ReflectionUtil.getAllMethods(getObject().getClass(), ManagedOperation.class)) {
         ManagedOperation op = method.getAnnotation(ManagedOperation.class);
         String attName = method.getName();
         if (isSetMethod(method) || isGetMethod(method)) {
            attName = attName.substring(3);
         } else if (isIsMethod(method)) {
            attName = attName.substring(2);
         }
         // expose unless we already exposed matching attribute field
         boolean isAlreadyExposed = atts.containsKey(attName);
         if (!isAlreadyExposed) {
            ops.add(new MBeanOperationInfo(op != null ? op.description() : "", method));
         }
      }
   }
View Full Code Here

Examples of org.infinispan.jmx.annotations.ManagedOperation

                     atts.put(attributeName, new MethodAttributeEntry(info, method, null));
                  }
               }
            }
         } else if (method.isAnnotationPresent(ManagedOperation.class) || isMBeanAnnotationPresentWithExposeAll()) {
            ManagedOperation op = method.getAnnotation(ManagedOperation.class);
            String attName = method.getName();
            if (isSetMethod(method) || isGetMethod(method)) {
               attName = attName.substring(3);
            } else if (isIsMethod(method)) {
               attName = attName.substring(2);
            }
            //expose unless we already exposed matching attribute field
            boolean isAlreadyExposed = atts.containsKey(attName);
            if (!isAlreadyExposed) {
               ops.add(new MBeanOperationInfo(op != null ? op.description() : "", method));
            }
         }
      }
   }
View Full Code Here

Examples of org.jboss.cache.jmx.annotations.ManagedOperation

               }
            }
         }
         else if (method.isAnnotationPresent(ManagedOperation.class) || isMBeanAnnotationPresentWithExposeAll())
         {
            ManagedOperation op = method.getAnnotation(ManagedOperation.class);
            String attName = method.getName();
            if (isSetMethod(method) || isGetMethod(method))
            {
               attName = attName.substring(3);
            }
            else if (isIsMethod(method))
            {
               attName = attName.substring(2);
            }
            //expose unless we already exposed matching attribute field
            boolean isAlreadyExposed = atts.containsKey(attName);
            if (!isAlreadyExposed)
            {
               ops.add(new MBeanOperationInfo(op != null ? op.description() : "", method));
               if (log.isDebugEnabled())
               {
                  log.debug("@Operation found for method " + method.getName());
               }
            }
View Full Code Here

Examples of org.jboss.managed.api.ManagedOperation

      ManagedComponent hsqldb = mgtView.getComponent("DefaultDS", type);
      Set<ManagedOperation> ops = hsqldb.getOperations();
      log.info("DefaultDS ops: "+ops);
      assertNotNull("Set<ManagedOperation>", ops);
      assertTrue("Set<ManagedOperation> > 0", ops.size() > 0);
      ManagedOperation listFormattedSubPoolStatistics = null;
      HashMap<String, ManagedOperation> opsByName = new HashMap<String, ManagedOperation>();
      for (ManagedOperation op : ops)
      {
         opsByName.put(op.getName(), op);
      }
      // Validate the listFormattedSubPoolStatistics op
      listFormattedSubPoolStatistics = opsByName.get("listFormattedSubPoolStatistics");
      assertNotNull("listFormattedSubPoolStatistics", listFormattedSubPoolStatistics);
      MetaValue[] params = {};
      Object result = listFormattedSubPoolStatistics.invoke(params);
      assertNotNull("Expecting non null result", result);
      log.info("listFormattedSubPoolStatistics.invoke: "+result);
      // It needs to be a MetaValue as well
      assertTrue("result is a MetaValue", result instanceof MetaValue);
      // Validate the listStatistics op
      ManagedOperation listStatistics = opsByName.get("listStatistics");
      assertNotNull("listStatistics", listStatistics);
      result = listStatistics.invoke(params);
      assertNotNull("Expecting non null result", result);
      log.info("listStatistics.invoke: "+result);
      // It needs to be a MetaValue as well
      assertTrue("result is a MetaValue", result instanceof MetaValue);
   }
View Full Code Here

Examples of org.jboss.managed.api.ManagedOperation

      return dispatcher.get(componentName, mp);
   }

   public MetaValue invoke(Long opID, Object componentName, String methodName, MetaValue... param)
   {
      ManagedOperation op = this.registry.getManagedOperation(opID);
      if(param == null)
         param = new MetaValue[0];
     
      MetaValue result = null;
      if (componentName != null)
View Full Code Here

Examples of org.jboss.managed.api.ManagedOperation

    * @return the operation
    * @throws IllegalStateException if the operation is not registered
    */
   public ManagedOperation getManagedOperation(Long opID)
   {
      ManagedOperation op = this.operations.get(opID);
      if(op == null)
         throw new IllegalStateException("operation not found for id " + opID);
      return op;
   }
View Full Code Here

Examples of org.jboss.managed.api.ManagedOperation

      // The gc op
      Set<ManagedOperation> ops = mo.getOperations();
      assertNotNull(ops);
      assertEquals("There is 1 op", 1, ops.size());
      ManagedOperation gc = ops.iterator().next();
      assertEquals("gc", gc.getName());
      assertEquals("Runs the garbage collector", gc.getDescription());
      gc.invoke();
   }
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.