Java 8 MBeanParameterInfo - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 MBeanParameterInfo class.

This code example shows how to use the following methods:getType
		} 
	} 
 
	private boolean valueTypeMatchesParameterType(Object value, MBeanParameterInfo paramInfo) {
		Class<? extends Object> valueClass = value.getClass();
		if (valueClass.getName().equals(paramInfo.getType())) {
			return true; 
		} 
		else { 
			Class<?> primitiveType = ClassUtils.resolvePrimitiveType(valueClass);
			return primitiveType != null && primitiveType.getName().equals(paramInfo.getType());
		} 
	} 
 
	/** 
	 * First checks if defaultObjectName is set, otherwise falls back on  {@link JmxHeaders#OBJECT_NAME} header. 
	 */ 
	private ObjectName resolveObjectName(Message<?> message) {
		ObjectName objectName = this.objectName;
		if (objectName == null){
5
CodeRank
This code example shows how to use the following methods:
					   true, 
					   false)); 
 
    MBeanParameterInfo[] params = new MBeanParameterInfo[1];
    params[0] = new MBeanParameterInfo("name", "java.lang.String",
				       "Create a logger MBean" ); 
    dOperations[0] = new MBeanOperationInfo("addLoggerMBean",
				    "addLoggerMBean(): add a loggerMBean", 
				    params ,
				    "javax.management.ObjectName", 
				    MBeanOperationInfo.ACTION);
  } 
 
 
  public 
  ObjectName addLoggerMBean(String name) {
    Logger cat = LogManager.exists(name);
 
    if(cat != null) { 
      return addLoggerMBean(cat);
4
CodeRank
This code example shows how to use the following methods:
 
    MBeanParameterInfo[] params = new MBeanParameterInfo[2];
    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"); 
 
    dOperations[0] = new MBeanOperationInfo("addAppender",
					    "addAppender(): add an appender", 
					    params,
					    "void", 
					    MBeanOperationInfo.ACTION);
  } 
 
  protected 
  Logger getLogger() { 
    return logger; 
  } 
 
 
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
    } 
    private static void init() throws Exception {
        mbai =
            new MBeanAttributeInfo("name", "type", "descr", true, false, false);
        mbpi =
            new MBeanParameterInfo("name", "type", "descr");
        MBeanParameterInfo[] params = new MBeanParameterInfo[] {mbpi};
        mbci1 =
            new MBeanConstructorInfo("name", "descr", null);
        mbci2 =
            new MBeanConstructorInfo("name", "descr", params);
        mbni1 =
            new MBeanNotificationInfo(null, "name", "descr");
        mbni2 =
            new MBeanNotificationInfo(new String[] {"type"}, "name", "descr");
        mboi1 =
            new MBeanOperationInfo("name", "descr", null, "type", ACTION);
        mboi2 =
            new MBeanOperationInfo("name", "descr", params, "type", INFO);
        mbi1 =
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
        final String opReturnPrefix = "my result prefix/";
        String opParam1 = "my param 1";
        MBeanOperationInfo opInfo = new MBeanOperationInfo(
                opName, 
                "my descr",  
                new MBeanParameterInfo[] {new MBeanParameterInfo("myParam1", String.class.getName(), "my param1 descr")}, 
                String.class.getName(), 
                MBeanOperationInfo.ACTION);
        Function<Object[],String> opImpl = new Function<Object[],String>() {
            public String apply(Object[] input) { 
                return opReturnPrefix+input[0]; 
            } 
        }; 
        GeneralisedDynamicMBean mbean = jmxService.registerMBean(ImmutableMap.of(), ImmutableMap.of(opInfo, opImpl), objectName);
         
        assertEquals(jmxHelper.operation(objectName, opName, opParam1), opReturnPrefix+opParam1);
    } 
 
    @Test
    public void testReconnectsOnJmxServerTemporaryFailure() throws Exception {
3
CodeRank
This code example shows how to use the following methods:
    private static final AttributeList ATTRIBUTE_LIST = new AttributeList();
    private static final MBeanAttributeInfo[] EMPTY_ATTRIBUTES = new MBeanAttributeInfo[0];
    private static final MBeanNotificationInfo[] EMPTY_NOTIFICATIONS = new MBeanNotificationInfo[0];
    private static final MBeanParameterInfo[] EMPTY_PARAMETERS = new MBeanParameterInfo[0];
    private static final MBeanOperationInfo PING_INFO = new MBeanOperationInfo("ping", "ping the parameter host", new MBeanParameterInfo[]{
        new MBeanParameterInfo("host", String.class.getName(), "the host to ping")
    }, String.class.getName(), MBeanOperationInfo.INFO);
 
    private final Collection<String> hosts = new CopyOnWriteArraySet<String>();
    private ObjectName objectName;
    private MBeanInfo info;
 
    public synchronized void addHost(final String host) {
        hosts.add(host);
        buildMBeanInfo(); 
    } 
 
    public synchronized void removeHost(final String host) {
        hosts.remove(host);
        buildMBeanInfo(); 
3
CodeRank
This code example shows how to use the following methods:getDescription, getDescriptor
        } 
    } 
 
    @Override 
    public String getDescription(final MBeanOperationInfo operation, final MBeanParameterInfo info, final int sequence) {
        final Descriptor descriptor = info.getDescriptor();
        if (descriptor != null && descriptor.getFieldValue("Description") != null) {
            return (String) descriptor.getFieldValue("Description");
        } else { 
            return info.getDescription();
        } 
    } 
 
    @Override 
    public String getParameterName(final MBeanOperationInfo operation, final MBeanParameterInfo info, final int sequence) {
        final Descriptor descriptor = info.getDescriptor();
        if (descriptor != null && descriptor.getFieldValue(PName.PNAME) != null) {
            return (String) descriptor.getFieldValue(PName.PNAME);
        } else { 
            return info.getName();
4
CodeRank
This code example shows how to use the following methods:
See Code Examples for Java 8 MBeanParameterInfo Methods: