Package org.jboss.system

Examples of org.jboss.system.ServiceContext


            }
            mbeanElement.appendChild(attributeElement);
         }
      }

      ServiceContext sc = serviceController.getServiceContext(name);
      for (Iterator i = sc.iDependOn.iterator(); i.hasNext();)
      {
         ServiceContext needs = (ServiceContext) i.next();
         Element dependsElement = doc.createElement("depends");
         dependsElement.appendChild(doc.createTextNode(needs.objectName.toString()));
         mbeanElement.appendChild(dependsElement);
      }
View Full Code Here


      // Weed services that are waiting for other deployments
      Collection<ServiceContext> rootCause = new HashSet<ServiceContext>(waitingForDepends);
      Collection<ServiceContext> missing = new HashSet<ServiceContext>();
      for (Iterator i = rootCause.iterator(); i.hasNext();)
      {
         ServiceContext ctx = (ServiceContext) i.next();
         for (Iterator j = ctx.iDependOn.iterator(); j.hasNext(); )
         {
            ServiceContext dependee = (ServiceContext) j.next();
            if (dependee.state != ServiceContext.RUNNING)
            {
               // Add missing mbean
               if (allServices.contains(dependee) == false)
                  missing.add(dependee);
View Full Code Here

   protected void checkIncomplete(IncompleteDeploymentException e, ObjectName name, Class<? extends Throwable> expected) throws Exception
   {
      Collection incomplete = e.getMbeansWaitingForDepends();
      for (Iterator i = incomplete.iterator(); i.hasNext();)
      {
         ServiceContext ctx = (ServiceContext) i.next();
         if (name.equals(ctx.objectName))
         {
            Throwable problem = ctx.getProblem();
            if (e != null || expected != null)
            {
               if (expected != null && problem == null)
                  throw new AssertionFailedError("Did not get expected " + expected.getName() + " for " + ctx);
               if (expected == null && problem != null)
View Full Code Here

      return getController().getServiceContext(name);
   }
  
   protected void assertNoService(ObjectName name) throws Exception
   {
      ServiceContext ctx = getServiceContext(name);
      if (ctx != null && ctx.state != ServiceContext.NOTYETINSTALLED)
         throw new AssertionFailedError("Should not be a service context for " + ctx);
   }
View Full Code Here

      assertMBeanFailed(name, registered);
   }
  
   protected void assertServiceState(ObjectName name, int expectedState, boolean registered) throws Exception
   {
      ServiceContext ctx = getServiceContext(name);
      if (registered == false && ctx == null)
         return;
      if (ctx == null)
         throw new AssertionFailedError("Incorrect state for " + name + " expected " + ServiceContext.getStateString(expectedState) + " but there is no context/state");
      if (expectedState != ctx.state)
         throw new AssertionFailedError("Incorrect state for " + name + " expected " + ServiceContext.getStateString(expectedState) + " got " + ctx.getStateString());
   }
View Full Code Here

      assertServiceState(name, ServiceContext.DESTROYED, true);
   }
  
   protected void assertServiceState(ObjectName name, int expectedState) throws Exception
   {
      ServiceContext ctx = getServiceContext(name);
      assertTrue("Incorrect state for " + name + " expected " + ServiceContext.getStateString(expectedState) + " got " + ctx.getStateString(), expectedState == ctx.state);
   }
View Full Code Here

      getControllerDelegate().assertServiceState(name, expectedState, registered);
   }
  
   protected void assertNoService(ObjectName name) throws Exception
   {
      ServiceContext ctx = getServiceContext(name);
      assertNull("Should not be a service context for " + name, ctx);
   }
View Full Code Here

   public List<ServiceContext> listIncompletelyDeployed()
   {
      List<ServiceContext> id = new ArrayList<ServiceContext>();
      for (Iterator<ServiceContext> i = installedServices.iterator(); i.hasNext();)
      {
         ServiceContext sc = i.next();
         if ( sc.state != ServiceContext.CREATED &&
              sc.state != ServiceContext.RUNNING &&
              sc.state != ServiceContext.STOPPED &&
              sc.state != ServiceContext.DESTROYED )
         {
View Full Code Here

   public List<ObjectName> listDeployedNames()
   {
      List<ObjectName> names = new ArrayList<ObjectName>(installedServices.size());
      for (Iterator<ServiceContext> i = installedServices.iterator(); i.hasNext();)
      {
         ServiceContext ctx = i.next();
         names.add(ctx.objectName);
      }

      return names;
   }
View Full Code Here

         mbeans.add(di.deployedObject);
      boolean mbeansStateIsValid = true;
      for (int m = 0; m < mbeans.size(); m++)
      {
         ObjectName serviceName = mbeans.get(m);
         ServiceContext ctx = this.getServiceContext(serviceName);
         if (ctx != null && state == DeploymentState.STARTED)
            mbeansStateIsValid &= ctx.state == ServiceContext.RUNNING;
      }
      if (mbeansStateIsValid == true)
         di.state = state;
View Full Code Here

TOP

Related Classes of org.jboss.system.ServiceContext

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.