Package org.jboss.managed.api

Examples of org.jboss.managed.api.RunState


  }

  @Override
  public AvailabilityType getAvailability() {

    RunState runState;
    try {
      runState = ProfileServiceUtil.getRuntimeEngineDeployer(getConnection()).getRunState();
    } catch (NamingException e) {
      LOG  .debug("Naming exception getting: " + PluginConstants.ComponentType.Platform.TEIID_RUNTIME_ENGINE); //$NON-NLS-1$
      return AvailabilityType.DOWN;
View Full Code Here


            nullStats.add(stat.getName());
      }
      assertTrue("There are no null stats: "+nullStats, nullStats.size() == 0);

      // Validate the component run state
      RunState state = hsqldb.getRunState();
      assertEquals("DefaultDS is running", RunState.RUNNING, state);
   }
View Full Code Here

      return result;
   }
  
   public RunState updateRunState(Object componentName)
   {
      RunState state = RunState.UNKNOWN;
      try
      {
         state = dispatcher.mapControllerState(componentName, runStateMapper);
      }
      catch(Exception ignore) { }
View Full Code Here

      return delegate.getDeployment();
   }

   public RunState getRunState()
   {
      RunState state = dispatcher.updateRunState(componentName);
      if(state == RunState.UNKNOWN)
         return delegate.getRunState();
      return state;
   }
View Full Code Here

         }
         // Update the runtime state of any ManagedComponent associated with this runtime mo
         ManagedComponent comp = md.getComponent(mo.getName());
         if (comp != null)
         {
            RunState state = updateRunState(mo, comp);
            log.debug("Updated component: "+comp+" run state to: "+state);
         }
         // There is no further processing of runtime ManagedObjects, unless its marked as a component
         if (isMC == false)
            return;
         //
         else if (merged == false)
         {
            Set<ManagedOperation> runtimeOps = mo.getOperations();
            runtimeOps = createOperationProxies(mo, runtimeOps);
            MutableManagedObject moi = (MutableManagedObject) mo;
            moi.setOperations(runtimeOps);
         }
      }
      else
      {
         // See if there is runtime info to merge
         ManagedObject runtimeMO = runtimeMOs.get(key);
         if (runtimeMO != null)
         {
            mergeRuntimeMO(mo, runtimeMO);
            runtimeMOs.remove(key);
            // Update the runtime state of any ManagedComponent associated with this runtime mo
            ManagedComponent comp = md.getComponent(mo.getName());
            if (comp != null)
            {
               RunState state = updateRunState(runtimeMO, comp);
               log.debug("Updated component: "+comp+" run state to: "+state);
            }
         }
      }

      // Update the MO registry
      // TODO - does this make sense? In case of a MetaType.isCollection we could get different results then
//      ManagedObject prevMO = moRegistry.put(key, mo);
//      if( prevMO != null )
//      {
//         // This should only matter for ManagedObjects that have a ManagementObjectID
//         log.debug("Duplicate mo for key: "+key+", prevMO: "+prevMO);
//         return;
//      }
      // Check for unresolved refs
      checkForReferences(key, mo);

      // Map any existing ManagedComponent types
      for(ManagedComponent comp : md.getComponents().values())
      {
         log.debug("Updating ManagementComponent: "+comp);
         ComponentType type = comp.getType();
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
         {
            typeComps = new HashSet<ManagedComponent>();
            compByCompType.put(type, typeComps);
         }
         typeComps.add(comp);
      }

      // Create ManagedComponents for ManagedObjects annotated with ManagementComponent
      ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
      if (mc != null && md.getComponent(mo.getName()) == null)
      {
         ComponentType type = new ComponentType(mc.type(), mc.subtype());
         ManagedComponentImpl comp = new TempManagedComponentImpl(type, md, mo);
         md.addComponent(mo.getName(), comp);
         log.debug("Processing ManagementComponent("+mo.getName()+"): "+comp);
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
         {
            typeComps = new HashSet<ManagedComponent>();
            compByCompType.put(type, typeComps);
         }
         typeComps.add(comp);
         RunState state = updateRunState(mo, comp);
      }

      // Scan for @ManagementObjectRef
      for(ManagedProperty prop : mo.getProperties().values())
      {
View Full Code Here

      return value;
   }

   protected RunState updateRunState(ManagedObject runtimeMO, ManagedComponent comp)
   {
      RunState state = comp.getRunState();
      if (state == RunState.UNKNOWN && dispatcher != null)
      {
         Object name = comp.getComponentName();
         if (name == null && runtimeMO != null)
            name = runtimeMO.getComponentName();
View Full Code Here

      return proxyFactory.createPropertyProxy(prop, componentName);
   }
  
   protected RunState updateRunState(ManagedObject runtimeMO, ManagedComponent comp)
   {
      RunState state = comp.getRunState();
      if (state == RunState.UNKNOWN && dispatcher != null)
      {
         Object name = comp.getComponentName();
         if (name == null && runtimeMO != null)
            name = runtimeMO.getComponentName();
View Full Code Here

         }
         // Update the runtime state of any ManagedComponent associated with this runtime mo
         ManagedComponent comp = md.getComponent(mo.getName());
         if (comp != null)
         {
            RunState state = updateRunState(mo, comp);
            log.debug("Updated component: "+comp+" run state to: "+state);
         }
         // There is no further processing of runtime ManagedObjects, unless its marked as a component
         if (isMC == false)
            return;
         //
         else if (merged == false)
         {
            Set<ManagedOperation> runtimeOps = mo.getOperations();
            runtimeOps = createOperationProxies(mo, runtimeOps);
            MutableManagedObject moi = (MutableManagedObject) mo;
            moi.setOperations(runtimeOps);
         }
      }
      else
      {
         // See if there is runtime info to merge
         ManagedObject runtimeMO = runtimeMOs.get(key);
         if (runtimeMO != null)
         {
            mergeRuntimeMO(mo, runtimeMO);
            runtimeMOs.remove(key);
            // Update the runtime state of any ManagedComponent associated with this runtime mo
            ManagedComponent comp = md.getComponent(mo.getName());
            if (comp != null)
            {
               RunState state = updateRunState(runtimeMO, comp);
               log.debug("Updated component: "+comp+" run state to: "+state);
            }
         }
      }
View Full Code Here

                LOG.debug("*** AFTER LOAD:\n" + DebugUtils.convertPropertiesToString(managedProperties));
            }
            resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, customProps,
                getResourceContext().getResourceType());
        } catch (Exception e) {
            RunState runState = managedComponent.getRunState();
            if (runState == RunState.RUNNING) {
                LOG.error("Failed to load configuration for " + getResourceDescription() + ".", e);
            } else if (LOG.isDebugEnabled()) {
                LOG.debug("Failed to load configuration for " + getResourceDescription()
                    + ", but managed component is not in the RUNNING state.", e);
View Full Code Here

        getValues(getManagedComponent(), report, metrics);
    }

    protected void getValues(ManagedComponent managedComponent, MeasurementReport report,
        Set<MeasurementScheduleRequest> metrics) throws Exception {
        RunState runState = managedComponent.getRunState();
        for (MeasurementScheduleRequest request : metrics) {
            try {
                String value = getMeasurement(managedComponent, request.getName());
                addValueToMeasurementReport(report, request, value);
            } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.jboss.managed.api.RunState

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.