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

This code example shows how to use the following methods:get, add
    } 
 
    public void testAttributes() throws Exception {
        // Attributes are not implemented 
        HtmlAdaptorParser parser = new HtmlAdaptorParser(mBeanServer);
        AttributeList list = new AttributeList();
        list.add(new Attribute("foo", "bar"));
        list.add(new Attribute("bar", "foo"));
        parser.setAttribute((Attribute)list.get(0));
        parser.setAttributes(list);
        assertNull(parser.getAttribute("foo"));
        assertNull(parser.getAttributes(new String[] {"foo", "bar"}));
    } 
 
    private String[] getGCNames(String request) {
        Pattern p = Pattern.compile("~Name~([^~\\|]+)", Pattern.CASE_INSENSITIVE);
        Matcher m = p.matcher(request);
        List<String> gcNames = new ArrayList<String>();
        while (m.find()) {
            gcNames.add(m.group(1));
5
CodeRank
This code example shows how to use the following methods:get, size
This code example shows how to use the following methods:
    } 
    return list;
  } 
 
  public AttributeList setAttributes(AttributeList aAttributeList) {
    return new AttributeList();
  } 
 
  public Object invoke(String string, Object[] aObjects, String[] aStrings) throws MBeanException, ReflectionException {
    if ("reset".equals(string)) {
      etmMonitor.reset(aggregate.getName());
    } 
 
    return null; 
  } 
 
  public MBeanInfo getMBeanInfo() {
    return new OpenMBeanInfoSupport(
      Aggregate.class.getName(),
      "Performance results for " + aggregate.getName(),
4
CodeRank
This code example shows how to use the following methods:
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeUnit;
 
public class RemoteResourceMonitor implements DynamicMBean {
    private static final String PING = "ping";
    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(); 
3
CodeRank
This code example shows how to use the following methods:
	/** 
	 * Set a multiple attributes at once on the server. 
	 */ 
	public void setAttributes(ObjectName name, List<Attribute> attributes) throws Exception {
		checkClientConnected(); 
		mbeanConn.setAttributes(name, new AttributeList(attributes));
	} 
 
	/** 
	 * Set a multiple attributes at once on the server. 
	 */ 
	public void setAttributes(String domainName, String beanName, List<Attribute> attributes) throws Exception {
		setAttributes(ObjectNameUtil.makeObjectName(domainName, beanName), attributes);
	} 
 
	/** 
	 * Invoke a JMX method with a domain/object-name as an array of parameter strings. 
	 *  
	 * @return The value returned by the method or null if none. 
	 */ 
3
CodeRank
See Code Examples for Java 8 AttributeList Methods: