Package javax.management

Examples of javax.management.ObjectName


    unregister(name, mbeanObjectName);
    register(name, bean, mbeanObjectName);
  }

  public void unregisterMBean(String name) throws MBeanRegistrationException, MalformedObjectNameException {
    ObjectName mbeanObjectName = new ObjectName(name);
    unregister(name, mbeanObjectName);
  }
View Full Code Here


  public void createServiceMBean(String serviceName){
    ServiceStat service = new ServiceStat();

    try {
      ObjectName objectName = new ObjectName("XFire:name="+serviceName+",type=management");
      objectNames.put(serviceName,objectName);
      mbs.registerMBean(service, objectName);
      createCounterMonitor(objectName,serviceName,new Long(500),new Long(200));
      createGaugeMonitor(objectName,serviceName,new Long(500),new Long(200),new Long(100));
    } catch (Exception e) {
View Full Code Here

    cm.setInitThreshold(new Long(threshold));
    cm.setDifferenceMode(true);
    cm.setNotify(true);
    cm.addNotificationListener(new CounterListener(),null,null);
    try {
      ObjectName objectNameC = new ObjectName("XFire:name="+serviceName+"CounterMonitor,"+"type=management");
      cm.start();
      mbs.registerMBean(cm, objectNameC);
   
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

    gm.setNotifyLow(true);
    gm.setThresholds(thresholdHigh,thresholdLow);
    gm.setDifferenceMode(true);
    gm.addNotificationListener(new GaugeListener(),null,null);
    try {
      ObjectName objectNameG = new ObjectName("XFire:name="+serviceName+"GaugeMonitor,"+"type=management");
      gm.start()
      mbs.registerMBean(gm, objectNameG);
   
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  public MBeanServer getMBeanServer(){
    return mbs;
  }
 
  public void recordFailedRequest(String serviceName){
    ObjectName objName = (ObjectName)objectNames.get(serviceName);
    try {
      mbs.invoke(objName,"setFailedRequestCount",null,null);
    } catch (InstanceNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

      e.printStackTrace();
    }
  }
  public void recordSuccessfulRequest(String serviceName){
   
    ObjectName objName = (ObjectName)objectNames.get(serviceName);
    try {
      mbs.invoke(objName,"setSuccessfulRequestCount",null,null);
    } catch (InstanceNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
  public void setLastResponseTime(String serviceName,Long arg){
    ObjectName objName = (ObjectName)objectNames.get(serviceName);
    Attribute attrib = new Attribute("LastResponseTime",arg);
    try {
      mbs.setAttribute(objName,attrib);
    } catch (Exception e) {
      // TODO Auto-generated catch block
View Full Code Here

            dbunitImporter.importDatasets();
        }

        if (hibernateStatistics) {
            log.info("registering Hibernate statistics MBean");
            hibernateMBeanName = new ObjectName("Hibernate:type=statistics,application="+appname);
            StatisticsService mBean = new StatisticsService();
            mBean.setSessionFactoryJNDIName("SessionFactories/"+appname+"SF");
            ManagementFactory.getPlatformMBeanServer().registerMBean(mBean, hibernateMBeanName);
        }
       
View Full Code Here

    loadData();
  }

  public void loadData() {
    try {
      ObjectName name = new ObjectName(objectName);
      boolean isLoaded = ((Boolean) (connectorClient.getServer().isRegistered(name).get())).booleanValue();
      if (!isLoaded) {
        loadMBean(objectName, className);
      }
    }
View Full Code Here

    catch (ConnectorException ex) {
      ex.printStackTrace();
    }

    try {
      RequestBroker = new ObjectName(objectName);
    }
    catch (MalformedObjectNameException ex) {
    }
    MBeanAttributeInfo[] attrInfo = connectorClient.exploreMBeansByObjectName(objectName);
    for (int i =0; i<attrInfo.length; i++) {
View Full Code Here

TOP

Related Classes of javax.management.ObjectName

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.