Examples of refreshAttributes()


Examples of org.mc4j.ems.connection.bean.EmsBean.refreshAttributes()

         String metric = req.getName();
         try {
            EmsBean bean = queryComponentBean(metric);
            if (bean != null) {
               if (trace) log.tracef("Retrieved mbean with name %s", bean.getBeanName());
               bean.refreshAttributes();
               String attName = metric.substring(metric.indexOf(".") + 1);
               EmsAttribute att = bean.getAttribute(attName);
               // Attribute values are of various data types
               if (att != null) {
                  Object o = att.getValue();
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean.refreshAttributes()

      EmsConnection conn = getEmsConnection();
      try {
         conn.refresh();
         EmsBean bean = queryCacheManagerBean(conn);
         if (bean != null) {
            bean.refreshAttributes();
            if (trace) log.tracef("Cache manager %s could be found and attributes where refreshed, so it's up.", bean);
            return AvailabilityType.UP;
         }
         if (trace) log.trace("Cache manager could not be found, so cache manager is down");
         return AvailabilityType.DOWN;
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean.refreshAttributes()

      boolean trace = log.isTraceEnabled();
      if (trace) log.tracef("Get values for these metrics: %s", metrics);
      EmsConnection conn = getEmsConnection();
      if (trace) log.tracef("Connection to ems server established: %s", conn);
      EmsBean bean = queryCacheManagerBean(conn);
      bean.refreshAttributes();
      if (trace) log.tracef("Querying returned bean: %s", bean);
      for (MeasurementScheduleRequest req : metrics) {
         DataType type = req.getDataType();
         if (type == DataType.MEASUREMENT) {
            String tmp = (String) bean.getAttribute(req.getName()).getValue();
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean.refreshAttributes()

      EmsConnection conn = getConnection();
      try {
         conn.refresh();
         EmsBean bean = conn.getBean(context.getResourceKey());
         if (bean != null)
            bean.refreshAttributes();
         return AvailabilityType.UP;
      } catch (Exception e) {
         return AvailabilityType.DOWN;
      }
   }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean.refreshAttributes()

    */
   public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {

      EmsConnection conn = getConnection();
      EmsBean bean = conn.getBean(context.getPluginConfiguration().getSimpleValue("objectName", null));
      bean.refreshAttributes();

      for (MeasurementScheduleRequest req : metrics) {
         // TODO check with Traits in the future - also why are the values Strings?
         String tmp = (String) bean.getAttribute(req.getName()).getValue();
         Double val = Double.valueOf(tmp);
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean.refreshAttributes()

         try {
            String abbrev = metric.substring(0, metric.indexOf("."));
            String mbean = abbrevToMBean.get(abbrev);
            mbean = myNamePattern + mbean;
            EmsBean bean = conn.getBean(mbean);
            bean.refreshAttributes();
            String attName = metric.substring(metric.indexOf(".") + 1);
            EmsAttribute att = bean.getAttribute(attName);

            // Attribute values are of various data types ...
            Object o = att.getValue();
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean.refreshAttributes()

      EmsConnection conn = getEmsConnection();
      try {
         conn.refresh();
         EmsBean bean = queryCacheManagerBean(conn);
         if (bean != null) {
            bean.refreshAttributes();
            if (trace) log.trace("Cache manager {0} could be found and attributes where refreshed, so it's up.", bean);
            return AvailabilityType.UP;
         }
         if (trace) log.trace("Cache manager could not be found, so cache manager is down");
         return AvailabilityType.DOWN;
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean.refreshAttributes()

      boolean trace = log.isTraceEnabled();
      if (trace) log.trace("Get values for these metrics: {0}", metrics);
      EmsConnection conn = getEmsConnection();
      if (trace) log.trace("Connection to ems server established: {0}", conn);
      EmsBean bean = queryCacheManagerBean(conn);
      bean.refreshAttributes();
      if (trace) log.trace("Querying returned bean: {0}", bean);
      for (MeasurementScheduleRequest req : metrics) {
         DataType type = req.getDataType();
         if (type == DataType.MEASUREMENT) {
            String tmp = (String) bean.getAttribute(req.getName()).getValue();
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean.refreshAttributes()

      EmsConnection conn = getConnection();
      try {
         conn.refresh();
         EmsBean bean = queryCacheBean();
         if (bean != null && bean.getAttribute("CacheStatus").getValue().equals(ComponentStatus.RUNNING.toString())) {
            bean.refreshAttributes();
            if (trace) log.trace("Cache {0} within {1} cache manager is running and attributes could be refreshed, so it's up.", cacheName, cacheManagerName);
            return AvailabilityType.UP;
         }
         if (trace) log.trace("Cache status for {0} within {1} cache manager is anything other than running, so it's down.", cacheName, cacheManagerName);
         return AvailabilityType.DOWN;
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean.refreshAttributes()

         String metric = req.getName();
         try {
            EmsBean bean = queryComponentBean(metric);
            if (bean != null) {
               if (trace) log.trace("Retrieved mbean with name {0}", bean.getBeanName());
               bean.refreshAttributes();
               String attName = metric.substring(metric.indexOf(".") + 1);
               EmsAttribute att = bean.getAttribute(attName);
               // Attribute values are of various data types
               if (att != null) {
                  Object o = att.getValue();
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.