Package javax.management

Examples of javax.management.Attribute


        {
            String attr = attrs[i];
            try
            {
                Object val = getAttribute(attr);
                al.add(new Attribute(attr, val));
            }
            catch (Exception e)
            {
                if (logger.isLoggable(MLevel.WARNING))
                    logger.log(MLevel.WARNING, "Failed to get requested attribute (for list): " + attr, e);
View Full Code Here


                String attr = Character.toLowerCase(operation.charAt(i)) + operation.substring(i + 1);
                return getAttribute( attr );
            }
            else if (signature.length == 1 && operation.startsWith("set"))
            {
                setAttribute(new Attribute(Character.toLowerCase(operation.charAt(3)) + operation.substring(4), paramVals[0]));
                return null;
            }
            else
                throw new MBeanException(e);
            }
View Full Code Here

    public synchronized AttributeList setAttributes(AttributeList al)
    {
        AttributeList out = new AttributeList();
        for (int i = 0, len = al.size(); i < len; ++i)
        {
            Attribute attrObj = (Attribute) al.get(i);
           
            try
            {
                this.setAttribute( attrObj );
                out.add(attrObj);
View Full Code Here

                                           (col.isNativeValueAlwaysNeeded() ?
                                            server.getAttribute(oname, col.getName()):
                                            null),
                                           oname);
          if (colValue != null) {
            server.setAttribute(oname, new Attribute(col.getName(), colValue));
          }
        }
        catch (Exception ex) {
          ex.printStackTrace();
        }
View Full Code Here

   * Sets an attribute.
   */
  public boolean __setField(String attrName, Object value)
  {
    try {
      _server.setAttribute(_name, new Attribute(attrName, value));

      return true;
    } catch (Exception e) {
      log.log(Level.FINE, e.toString(), e);

View Full Code Here

     * @param attrName
     * @param attrValue
     * @throws Exception
     */
    public void setAttribute(String objectName, String attrName, Object attrValue) throws Exception {
        Attribute attr = new Attribute(attrName, attrValue);
        mbServer.setAttribute(new ObjectName(objectName), attr);
    }
View Full Code Here

    public final AttributeList getAttributes(String names[]) {
        AttributeList answer = new AttributeList();
        for (int i = 0; i < names.length; i++) {
            try {
                answer.add(new Attribute(names[i], getAttribute(names[i])));
            } catch (Exception e) {
                // Ignore.
            }
        }
        return answer;
View Full Code Here

        // Prepare and return our response, eating all exceptions
        String names[] = new String[attributes.size()];
        int n = 0;
        Iterator<Object> items = attributes.iterator();
        while (items.hasNext()) {
            Attribute item = (Attribute) items.next();
            names[n++] = item.getName();
            try {
                setAttribute(item);
            } catch (Exception e) {
                // Ignore all exceptions
            }
View Full Code Here

     * @param attrValue
     * @throws Exception
     */
    @RolesAllowed("mejbadmin")
    public void setAttribute(String objectName, String attrName, Object attrValue) throws Exception {
        Attribute attr = new Attribute(attrName, attrValue);
        mejb.setAttribute(new ObjectName(objectName), attr);
    }
View Full Code Here

    MBeanInfo mbeanInfo = mbs.getMBeanInfo(objectName);

    for (MBeanAttributeInfo aInfo : mbeanInfo.getAttributes()) {
      Object value = mbs.getAttribute(objectName, aInfo.getName());
      if (aInfo.isWritable()) {
        mbs.setAttribute(objectName, new Attribute(aInfo.getName(), value));
      }
    }

    for (MBeanOperationInfo oInfo : mbeanInfo.getOperations()) {
      if (oInfo.getSignature().length == 0) {
View Full Code Here

TOP

Related Classes of javax.management.Attribute

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.