Examples of ServiceController


Examples of org.jboss.msc.service.ServiceController

        boolean reloadRequired = false;
        final String connectionName = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue();
        final ServiceName serviceName = RemoteOutboundConnectionService.OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(connectionName);
        final ServiceRegistry registry = context.getServiceRegistry(true);
        ServiceController sc = registry.getService(serviceName);
        if (sc != null && sc.getState() == ServiceController.State.UP) {
            reloadRequired = true;
        } else {
            // Service isn't up so we can bounce it
            context.removeService(serviceName); // safe even if the service doesn't exist
            // install the service with new values
View Full Code Here

Examples of org.jboss.msc.service.ServiceController

    }

    @Override
    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
        final ModelNode fullModel = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
        final ServiceController serviceController = installRuntimeService(context, operation, fullModel, verificationHandler);
        newControllers.add(serviceController);
    }
View Full Code Here

Examples of org.jboss.msc.service.ServiceController

        boolean reloadRequired = false;
        final String connectionName = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue();
        final ServiceName serviceName = LocalOutboundConnectionService.OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(connectionName);
        final ServiceRegistry registry = context.getServiceRegistry(true);
        ServiceController sc = registry.getService(serviceName);
        if (sc != null && sc.getState() == ServiceController.State.UP) {
                reloadRequired = true;
        } else {
            // Service isn't up so we can bounce it
            context.removeService(serviceName); // safe even if the service doesn't exist
            // install the service with new values
View Full Code Here

Examples of org.jboss.msc.service.ServiceController

    }

    @Override
    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
        final ModelNode fullModel = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
        final ServiceController serviceController = installRuntimeService(context, operation, fullModel, verificationHandler);
        newControllers.add(serviceController);
    }
View Full Code Here

Examples of org.jboss.msc.service.ServiceController

    public void testActivateOperation() throws Exception {
        ModelNode activateOp = new ModelNode();
        activateOp.get(ModelDescriptionConstants.OP_ADDR).add(ModelDescriptionConstants.SUBSYSTEM, "osgi");
        activateOp.get(ModelDescriptionConstants.OP).set(ModelConstants.ACTIVATE);

        ServiceController sc = Mockito.mock(ServiceController.class);

        ServiceRegistry sr = Mockito.mock(ServiceRegistry.class);
        Mockito.when(sr.getRequiredService(Services.FRAMEWORK_ACTIVE)).thenReturn(sc);

        OperationContext context = Mockito.mock(OperationContext.class);
View Full Code Here

Examples of org.jboss.msc.service.ServiceController

    @Override
    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model,
                                  ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers)
            throws OperationFailedException {
        final ModelNode fullModel = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
        final ServiceController serviceController = installRuntimeService(context, operation, fullModel, verificationHandler);
        newControllers.add(serviceController);
    }
View Full Code Here

Examples of org.jboss.msc.service.ServiceController

        Mockito.when(bundleContext.getService(startLevelSRef)).thenReturn(startLevelService);

        Bundle systemBundle = Mockito.mock(Bundle.class);
        Mockito.when(systemBundle.getBundleContext()).thenReturn(bundleContext);

        ServiceController sbsc = Mockito.mock(ServiceController.class);
        Mockito.when(sbsc.getValue()).thenReturn(systemBundle);

        ServiceRegistry sr = Mockito.mock(ServiceRegistry.class);
        Mockito.when(sr.getService(Services.SYSTEM_BUNDLE)).thenReturn(sbsc);

        contextResult = new ModelNode();
View Full Code Here

Examples of org.jboss.msc.service.ServiceController

    @Test
    public void testReadHandler() throws Exception {
        StartLevel sls = Mockito.mock(StartLevel.class);
        Mockito.when(sls.getStartLevel()).thenReturn(999);

        ServiceController sc = Mockito.mock(ServiceController.class);
        Mockito.when(sc.getValue()).thenReturn(sls);
        Mockito.when(sc.getState()).thenReturn(ServiceController.State.UP);

        ServiceRegistry sr = Mockito.mock(ServiceRegistry.class);
        Mockito.when(sr.getRequiredService(Services.START_LEVEL)).thenReturn(sc);

        OperationContext ctx = Mockito.mock(OperationContext.class);
View Full Code Here

Examples of org.jboss.msc.service.ServiceController

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Test
    public void testWriteHandler() throws Exception {
        StartLevel sls = Mockito.mock(StartLevel.class);

        ServiceController sc = Mockito.mock(ServiceController.class);
        Mockito.when(sc.getValue()).thenReturn(sls);
        Mockito.when(sc.getState()).thenReturn(ServiceController.State.UP);

        ServiceRegistry sr = Mockito.mock(ServiceRegistry.class);
        Mockito.when(sr.getRequiredService(Services.START_LEVEL)).thenReturn(sc);

        OperationContext ctx = Mockito.mock(OperationContext.class);
View Full Code Here

Examples of org.jboss.msc.service.ServiceController

    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Test
    public void testSubsystemDown() throws Exception {
        ServiceController sc = Mockito.mock(ServiceController.class);
        Mockito.when(sc.getState()).thenReturn(ServiceController.State.DOWN);

        ServiceRegistry sr = Mockito.mock(ServiceRegistry.class);
        Mockito.when(sr.getRequiredService(Services.START_LEVEL)).thenReturn(sc);

        ModelNode result = new ModelNode("test");
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.