Package javax.management

Examples of javax.management.MBeanOperationInfo


            operations.put(method.getName(), method);

            String operationDescr = getDescription(annotation.description(), method.getName());

            operationInfos.add(new MBeanOperationInfo(operationDescr, method));
        }

        Class<?> clazz = annotatedMBean;
        while (!Object.class.equals(clazz) && clazz != null)
        {
View Full Code Here


    {
        MBeanParameterInfo parameterInfo[] = new MBeanParameterInfo[1];
        parameterInfo[0] = new MBeanParameterInfo("loggerPattern", "java.lang.String",
                "Name of the Logger. Use * as wildcard");
        return new MBeanOperationInfo[]
        { new MBeanOperationInfo("addLoggerMBean", "Adds a MBean for a single Logger or "
                + "a group of Loggers", parameterInfo, "void", 1) };
    }
View Full Code Here

        params[0] = new MBeanParameterInfo("class_name", "java.lang.String",
                "add an appender to this logger");
        params[1] = new MBeanParameterInfo("appender_name", "java.lang.String",
                "name of the appender");

        _operations[0] = new MBeanOperationInfo("addAppender", "addAppender(): add an appender",
                params, "void", MBeanOperationInfo.ACTION);
    }
View Full Code Here

                    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

   public synchronized MBeanInfo getMBeanInfo() {
      //the client doesn't know about IspnMBeanOperationInfo so we need to convert first
      MBeanOperationInfo[] operationInfoForClient = new MBeanOperationInfo[opInfos.length];
      for (int i = 0; i < opInfos.length; i++) {
         IspnMBeanOperationInfo current = opInfos[i];
         operationInfoForClient[i] = new MBeanOperationInfo(current.getOperationName(), current.getDescription(),
                                                            current.getSignature(), current.getReturnType(), MBeanOperationInfo.UNKNOWN);
      }
      return new MBeanInfo(getObject().getClass().getCanonicalName(), mBeanMetadata.getDescription(), attInfos, null, operationInfoForClient, null);
   }
View Full Code Here

                                                                         ReflectionException {
      if (log.isDebugEnabled()) {
         log.debugf("Invoke method called on %s", name);
      }

      MBeanOperationInfo opInfo = null;
      for (IspnMBeanOperationInfo op : opInfos) {
         if (op.getOperationName().equals(name)) {
            opInfo = op;
            break;
         }
      }

      if (opInfo == null) {
         final String msg = "Operation " + name + " not amongst operations in " + opInfos;
         throw new MBeanException(new ServiceNotFoundException(msg), msg);
      }

      try {
         Class<?>[] classes = new Class[sig.length];
         for (int i = 0; i < classes.length; i++) {
            classes[i] = ReflectionUtil.getClassForName(sig[i], null);
         }
         Method method = getObject().getClass().getMethod(opInfo.getName(), classes);
         return method.invoke(getObject(), args);
      } catch (Exception e) {
         throw new MBeanException(e);
      }
   }
View Full Code Here

                ai.setWriteable( mai.isWritable());
                                               
                mbean.addAttribute(ai);
            }

            MBeanOperationInfo opInfo[]=mbi.getOperations();
            for( int i=0; i<opInfo.length; i++ ) {
                MBeanOperationInfo moi=opInfo[i];
                OperationInfo op=new OperationInfo();

                op.setName(moi.getName());
                op.setReturnType(moi.getReturnType());
               
                MBeanParameterInfo parms[]=moi.getSignature();
                for(int j=0; j<parms.length; j++ ) {
                    ParameterInfo pi=new ParameterInfo();
                    pi.setType(parms[i].getType());
                    pi.setName(parms[i].getName());
                    op.addParameter(pi);
View Full Code Here

            info=server.getMBeanInfo(oname);
        } catch (Exception e) {
            log.info( "Can't find metadata " + oname );
            return null;
        }
        MBeanOperationInfo attInfo[]=info.getOperations();
        for( int i=0; i<attInfo.length; i++ ) {
            if( opName.equals(attInfo[i].getName())) {
                return attInfo[i];
            }
        }
View Full Code Here

            info=server.getMBeanInfo(oname);
        } catch (Exception e) {
            log.info( "Can't find metadata " + oname );
            return null;
        }
        MBeanOperationInfo attInfo[]=info.getOperations();
        for( int i=0; i<attInfo.length; i++ ) {
            if( opName.equals(attInfo[i].getName())) {
                return attInfo[i];
            }
        }
View Full Code Here

            ReflectionException {
      if (log.isDebugEnabled()) {
         log.debug("Invoke method called on " + name);
      }

      MBeanOperationInfo opInfo = null;
      for (MBeanOperationInfo op : opInfos) {
         if (op.getName().equals(name)) {
            opInfo = op;
            break;
         }
View Full Code Here

TOP

Related Classes of javax.management.MBeanOperationInfo

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.