Examples of ServiceContext


Examples of org.jboss.system.ServiceContext

         mbeanName = instance.getObjectName();

         mbeans.add(mbeanName);
         if (mbeanName != null)
         {
            ServiceContext ctx = serviceController.createServiceContext(mbeanName);
            try
            {
               configure(mbeanName, loaderName, mbeanElement, mbeans);
               ctx.state = ServiceContext.CONFIGURED;
               ctx.problem = null;
View Full Code Here

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

Examples of org.jboss.system.ServiceContext

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

Examples of org.jboss.system.ServiceContext

   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

Examples of org.jboss.system.ServiceContext

      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

Examples of org.jboss.system.ServiceContext

      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

Examples of org.jboss.system.ServiceContext

      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

Examples of org.jboss.system.ServiceContext

      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

Examples of org.jmanage.core.services.ServiceContext

            attributeNames = new String[args.length - 1];
            for(int i=0; i< attributeNames.length; i++){
                attributeNames[i] = args[i+1];
            }
        }
        ServiceContext serviceContext =
                context.getServiceContext(expression.getAppName(),
                            expression.getMBeanName());
        AttributeListData[] attributeValues = null;
        if(attributeNames != null){
            attributeValues = service.getAttributes(serviceContext,
View Full Code Here

Examples of org.jmanage.core.services.ServiceContext

        for(int index =0; index < signature.length; index++){
            params[index] = properties.get(PARAM + (index + 1));
        }
       
        MBeanService mbeanService = ServiceFactory.getMBeanService();
        ServiceContext srvcContext = context.getWebContext().getServiceContext();
        OperationResultData[] operationResult =
            mbeanService.invoke(srvcContext, objectName, operation, params, signature);
        assert operationResult.length == 1;
        assert !operationResult[0].isError();
        output.append("<pre class=\"plaintext\">" + operationResult[0].getDisplayOutput() + "</pre>");
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.