Examples of ObjectName


Examples of javax.management.ObjectName

      return false;
    }
  }

  public void registerMBean(String name, Object bean) throws MalformedObjectNameException, MBeanRegistrationException, NotCompliantMBeanException {
    ObjectName mbeanObjectName = new ObjectName(name);
    unregister(name, mbeanObjectName);
    register(name, bean, mbeanObjectName);
  }
View Full Code Here

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

Examples of javax.management.ObjectName

  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

Examples of javax.management.ObjectName

    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

Examples of javax.management.ObjectName

    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

Examples of javax.management.ObjectName

  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

Examples of javax.management.ObjectName

      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

Examples of javax.management.ObjectName

      // 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

Examples of javax.management.ObjectName

            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

Examples of javax.management.ObjectName

    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
TOP
Copyright © 2018 www.massapi.com. 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.