Java 8 ModelMBeanOperationInfo - 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 ModelMBeanOperationInfo class.

This code example shows how to use the following methods:getDescriptor
				get.getDescriptor().getFieldValue("visibility"),
				new Integer(4));
		assertEquals("get operation should have role \"getter\"", "getter", get.getDescriptor().getFieldValue("role"));
 
		ModelMBeanOperationInfo set = info.getOperation("setName");
		assertNotNull("set operation should not be null", set);
		assertEquals("set operation should have visibility of four", 
				set.getDescriptor().getFieldValue("visibility"),
				new Integer(4));
		assertEquals("set operation should have role \"setter\"", "setter", set.getDescriptor().getFieldValue("role"));
	} 
 
	@Test
	public void testNotificationMetadata() throws Exception {
		ModelMBeanInfo info = (ModelMBeanInfo) getMBeanInfo();
		MBeanNotificationInfo[] notifications = info.getNotifications();
		assertEquals("Incorrect number of notifications", 1, notifications.length);
		assertEquals("Incorrect notification name", "My Notification", notifications[0].getName());
 
		String[] notifTypes = notifications[0].getNotifTypes();
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getDescription
		ModelMBeanAttributeInfo metric = inf.getAttribute(QUEUE_SIZE_METRIC);
		ModelMBeanOperationInfo operation = inf.getOperation("getQueueSize");
		assertEquals("The description for the queue size metric is incorrect", 
				"The QueueSize metric", metric.getDescription());
		assertEquals("The description for the getter operation of the queue size metric is incorrect", 
				"The QueueSize metric", operation.getDescription());
	} 
 
	@Test
	public void testMetricDescriptor() throws Exception {
		ModelMBeanInfo info = getMBeanInfoFromAssembler();
		Descriptor desc = info.getAttribute(QUEUE_SIZE_METRIC).getDescriptor();
		assertEquals("Currency Time Limit should be 20", "20", desc.getFieldValue("currencyTimeLimit"));
		assertEquals("Persist Policy should be OnUpdate", "OnUpdate", desc.getFieldValue("persistPolicy"));
		assertEquals("Persist Period should be 300", "300", desc.getFieldValue("persistPeriod"));
		assertEquals("Unit should be messages", "messages",desc.getFieldValue("units"));
		assertEquals("Display Name should be Queue Size", "Queue Size",desc.getFieldValue("displayName"));
		assertEquals("Metric Type should be COUNTER", "COUNTER",desc.getFieldValue("metricType"));
		assertEquals("Metric Category should be utilization", "utilization",desc.getFieldValue("metricCategory"));
	} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getReturnType
    @Test
    public void testAttributeHasCorrespondingOperations() throws Exception {
        ModelMBeanInfo info = getMBeanInfoFromAssembler();
 
        ModelMBeanOperationInfo myOperation = info.getOperation("myOperation");
        assertNotNull("get operation should not be null", myOperation);
        assertEquals("Incorrect myOperation return type", "long", myOperation.getReturnType());
                 
        ModelMBeanOperationInfo add = info.getOperation("add");                
        assertNotNull("set operation should not be null", add);
        assertEquals("Incorrect add method description", "Add Two Numbers Together", add.getDescription());
                 
    } 
 
    @Test
    public void testNotificationMetadata() throws Exception {
        ModelMBeanInfo info = getMBeanInfoFromAssembler();
        MBeanNotificationInfo[] notifications = info.getNotifications();
        assertEquals("Incorrect number of notifications", 1, notifications.length);
        assertEquals("Incorrect notification name", "My Notification", notifications[0].getName());
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
            new ModelMBeanOperationInfo("name", "descr", null, "type", ACTION,
                                        operd);
        mmboi3 =
            new ModelMBeanOperationInfo("name", "descr", params, "type", ACTION);
        mmboi4 =
            new ModelMBeanOperationInfo("name", "descr", params, "type", ACTION,
                                        operd);
        Descriptor notifd = new DescriptorSupport(new String[] {
            "name=name", "descriptorType=notification", 
        }); 
        mmbni1 =
            new ModelMBeanNotificationInfo(null, "name", "descr");
        mmbni2 =
            new ModelMBeanNotificationInfo(null, "name", "descr", notifd);
        mmbni3 =
            new ModelMBeanNotificationInfo(new String[] {"type"}, "name", "descr");
        mmbni4 =
            new ModelMBeanNotificationInfo(new String[] {"type"}, "name",
                                           "descr", notifd);
        Descriptor mbeand = new DescriptorSupport(new String[] {
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        ModelMBeanOperationInfo[] mmboi = new ModelMBeanOperationInfo[7];
 
        mmboi[0] = new ModelMBeanOperationInfo("start", "Start DSpace Kernel", null, "void",
                ModelMBeanOperationInfo.ACTION);
        mmboi[1] = new ModelMBeanOperationInfo("stop", "Stop DSpace Kernel", null, "void",
                ModelMBeanOperationInfo.ACTION);
        mmboi[2] = new ModelMBeanOperationInfo("getManagedBean", "Get the Current Kernel", null,
                DSpaceKernel.class.getName(), ModelMBeanOperationInfo.INFO);
 
        return new ModelMBeanInfoSupport(this.getClass().getName(), "DSpace Kernel", mmbai, null, mmboi, null);
    } 
 
    public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException {
        if ("LastLoadDate".equals(attribute)) {
            return getLastLoadDate(); 
        } else if ("LastLoadTime".equals(attribute)) {
            return getLoadTime(); 
        } 
        throw new AttributeNotFoundException("invalid attribute: " + attribute);
    } 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
This code example shows how to use the following methods:
	         new ModelMBeanOperationInfo("destroy","Shutdown Runtime",
	        	null, // no params for this method 
	            VOID, ModelMBeanOperationInfo.ACTION);
		// the reloadLoggingConfigurations operation info 
		ModelMBeanOperationInfo reloadLoggingConfigurationsOperationInfo =
	         new ModelMBeanOperationInfo("reloadLoggingConfigurations","Reload Logging configuration",
	        	null, // no params for this method 
	            VOID, ModelMBeanOperationInfo.ACTION);
		// the getBootstrapConfigPath operation info 
		ModelMBeanOperationInfo getBootstrapConfigPathOperationInfo =
	         new ModelMBeanOperationInfo("getBootstrapConfigPath","Gets the bootstrap config path",
	        	null, // no params for this method 
	        	STRING, ModelMBeanOperationInfo.ACTION);
		// the setBootstrapConfigPath operation info 
		ModelMBeanOperationInfo setBootstrapConfigPathOperationInfo =
	         new ModelMBeanOperationInfo("setBootstrapConfigPath","Sets the bootstrap config path",
	        		 new MBeanParameterInfo[] {new MBeanParameterInfo("bootstrapConfigPath",STRING,"The bootstrap config path")}, 
	            VOID, ModelMBeanOperationInfo.ACTION);
		return new ModelMBeanOperationInfo[] {startOperationInfo, stopOperationInfo, destroyOperationInfo, 
				reloadLoggingConfigurationsOperationInfo,getBootstrapConfigPathOperationInfo,
3
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 ModelMBeanOperationInfo Methods: