Package javax.management

Examples of javax.management.Attribute


          String valueString = value.toString();
          System.out.println("Attribute::" + attName + ": "
              + valueString);

          if (attrs[i].getName().equals("ruleMemoryValue")) {
            Attribute attr = new Attribute("ruleMemoryValue", 100);
            mBeanServer.setAttribute(oname, attr);

            System.out.println(".......set finished..........");

            Object attribute = mBeanServer.getAttribute(oname,
View Full Code Here


                            host + path);
                }
                if( mserver.isRegistered(parent ))  {
                    if(log.isDebugEnabled())
                        log.debug("Register with " + parent);
                    mserver.setAttribute(parent, new Attribute("realm", this));
                }
            } catch (Exception e) {
                log.error("Parent not available yet: " + parent)
            }
        }
View Full Code Here

        EJBContainer container = EJBContainer.createEJBContainer(properties);

        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
        ObjectName objectName = new ObjectName(OBJECT_NAME);
        assertEquals(0, server.getAttribute(objectName, "value"));
        server.setAttribute(objectName, new Attribute("value", 3));
        assertEquals(3, server.getAttribute(objectName, "value"));
        assertEquals("winner", server.invoke(objectName, "tryValue", new Object[]{3}, null));
        assertEquals("not the correct value, please have another try", server.invoke(objectName, "tryValue", new Object[]{2}, null));

        container.close();
View Full Code Here

  @Override
  public Object getAttribute(String attribute)
      throws AttributeNotFoundException, MBeanException, ReflectionException {
    updateJmxCache();
    synchronized(this) {
      Attribute a = attrCache.get(attribute);
      if (a == null) {
        throw new AttributeNotFoundException(attribute +" not found");
      }
      if (LOG.isDebugEnabled()) {
        LOG.debug(attribute +": "+ a);
      }
      return a.getValue();
    }
  }
View Full Code Here

  public AttributeList getAttributes(String[] attributes) {
    updateJmxCache();
    synchronized(this) {
      AttributeList ret = new AttributeList();
      for (String key : attributes) {
        Attribute attr = attrCache.get(key);
        if (LOG.isDebugEnabled()) {
          LOG.debug(key +": "+ attr);
        }
        ret.add(attr);
      }
View Full Code Here

    return sb.toString();
  }

  private void setAttrCacheTag(MetricsTag tag, int recNo) {
    String key = tagName(tag.name(), recNo);
    attrCache.put(key, new Attribute(key, tag.value()));
  }
View Full Code Here

    return sb.toString();
  }

  private void setAttrCacheMetric(AbstractMetric metric, int recNo) {
    String key = metricName(metric.name(), recNo);
    attrCache.put(key, new Attribute(key, metric.value()));
  }
View Full Code Here

                debug = Integer.parseInt(vform.getDebugLvl());
            } catch (Throwable t) {
                debug = 0;
            }
            mBServer.setAttribute(voname,
                                  new Attribute("debug", new Integer(debug)));

        } catch (Exception e) {

            getServlet().log
                (resources.getMessage(locale, "users.error.attribute.set",
View Full Code Here

                debug = Integer.parseInt(vform.getDebugLvl());
            } catch (Throwable t) {
                debug = 0;
            }
            mBServer.setAttribute(voname,
                                  new Attribute("debug", new Integer(debug)));
 
            attribute = "directory";
            mBServer.setAttribute(voname,
                         new Attribute("directory", vform.getDirectory()));
            attribute = "pattern";
            mBServer.setAttribute(voname,
                        new Attribute("pattern", vform.getPattern()));
            attribute = "prefix";
            mBServer.setAttribute(voname,
                        new Attribute("prefix", vform.getPrefix()));
            attribute = "suffix";
            mBServer.setAttribute(voname,
                        new Attribute("suffix", vform.getSuffix()));
            attribute = "resolveHosts";
            mBServer.setAttribute(voname,
                        new Attribute("resolveHosts", new Boolean(vform.getResolveHosts())));

        } catch (Exception e) {

            getServlet().log
                (resources.getMessage(locale, "users.error.attribute.set",
View Full Code Here

                debug = Integer.parseInt(lform.getDebugLvl());
            } catch (Throwable t) {
                debug = 0;
            }
            mBServer.setAttribute(loname,
                                  new Attribute("debug", new Integer(debug)));
            attribute = "verbosity";
            int verbosity = 0;
            try {
                verbosity = Integer.parseInt(lform.getVerbosityLvl());
            } catch (Throwable t) {
                verbosity = 0;
            }
            mBServer.setAttribute(loname,
                                  new Attribute("verbosity", new Integer(verbosity)));           
            if("FileLogger".equalsIgnoreCase(loggerType)) {
                attribute = "directory";             
                mBServer.setAttribute(loname,
                                  new Attribute("directory", lform.getDirectory()));           
                attribute = "prefix";             
                mBServer.setAttribute(loname,
                                  new Attribute("prefix", lform.getPrefix()));           
                attribute = "suffix";             
                mBServer.setAttribute(loname,
                                  new Attribute("suffix", lform.getSuffix()));           
                attribute = "timestamp";             
                mBServer.setAttribute(loname,
                       new Attribute("timestamp", new Boolean(lform.getTimestamp())));;                           
            }
           
        } catch (Exception e) {

            getServlet().log
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.