Package org.jboss.msc.service

Examples of org.jboss.msc.service.ServiceRegistry


        final String name = address.getLastElement().getValue();

        if (context.isNormalServer()) {
            context.addStep(new OperationStepHandler() {
                public void execute(final OperationContext context, ModelNode operation) {
                    final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
                    @SuppressWarnings("unchecked")
                    final ServiceController<Handler> controller = (ServiceController<Handler>) serviceRegistry.getService(LogServices.handlerName(name));
                    if (controller != null) {
                        Handlers.disableHandler(controller.getValue(), name);
                    }
                    context.completeStep();
                }
View Full Code Here


        final String name = address.getLastElement().getValue();

        if (context.isNormalServer()) {
            context.addStep(new OperationStepHandler() {
                public void execute(final OperationContext context, ModelNode operation) {
                    final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
                    @SuppressWarnings("unchecked")
                    final ServiceController<Handler> controller = (ServiceController<Handler>) serviceRegistry.getService(LogServices.handlerName(name));
                    if (controller != null) {
                        Handlers.enableHandler(controller.getValue(), name);
                    }
                    context.completeStep();
                }
View Full Code Here

        ConnectorServices.unregisterResourceIdentifier(raName, identifier);

    }

    public static void activate(OperationContext context, String raName, String rarNamethrows OperationFailedException {
        ServiceRegistry registry = context.getServiceRegistry(true);
        if (rarName.contains(ConnectorServices.RA_SERVICE_NAME_SEPARATOR)) {
            rarName = rarName.substring(0, rarName.indexOf(ConnectorServices.RA_SERVICE_NAME_SEPARATOR));
        }
        final ServiceController<?> inactiveRaController = registry.getService(ConnectorServices.INACTIVE_RESOURCE_ADAPTER_SERVICE.append(rarName));
        if (inactiveRaController == null) {
            throw new OperationFailedException("rar not yet deployed");
        }
        InactiveResourceAdapterDeploymentService.InactiveResourceAdapterDeployment inactive = (InactiveResourceAdapterDeploymentService.InactiveResourceAdapterDeployment) inactiveRaController.getValue();
        final ServiceController<?> RaxmlController = registry.getService(ServiceName.of(ConnectorServices.RA_SERVICE, raName));
        ResourceAdapter raxml = (ResourceAdapter) RaxmlController.getValue();

        RaServicesFactory.createDeploymentService(inactive.getRegistration(), inactive.getConnectorXmlDescriptor(), inactive.getModule(), context.getServiceTarget(), inactive.getDeployment(), inactive.getDeployment(), raxml);
    }
View Full Code Here

        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final String name = address.getLastElement().getValue();
        // Make sure the handler isn't attached
        checkHandler(context, name);
        final ServiceName serviceName = LogServices.handlerName(name);
        final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
        @SuppressWarnings("unchecked")
        final ServiceController<Handler> controller = (ServiceController<Handler>) serviceRegistry.getService(serviceName);
        controller.getValue().close();
        context.removeService(serviceName);
        removeAdditionalServices(context, name);
    }
View Full Code Here

        if (requiresRuntime(context)) {
            context.addStep(new OperationStepHandler() {
                public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                    final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
                    final String name = address.getLastElement().getValue();
                    final ServiceRegistry serviceRegistry = context.getServiceRegistry(false);
                    @SuppressWarnings("unchecked")
                    final ServiceController<T> controller = (ServiceController<T>) serviceRegistry.getService(LogServices.handlerName(name));
                    if (controller != null) {
                        final T handler = controller.getValue();
                        final ModelNode level = LEVEL.resolveModelAttribute(context, model);
                        final ModelNode formatter = FORMATTER.resolveModelAttribute(context, model);
                        final ModelNode encoding = ENCODING.resolveModelAttribute(context, model);
View Full Code Here

                requiresRestart = true;
            } else {
                final ServiceName serviceName = LogServices.handlerFileName(name);

                // Retrieve the current service
                final ServiceRegistry registry = context.getServiceRegistry(true);
                final ServiceController<?> fileController = registry.getService(serviceName);
                if (fileController == null) {
                    throw new OperationFailedException(new ModelNode().set(MESSAGES.serviceNotFound(serviceName)));
                }
                final HandlerFileService fileService = (HandlerFileService) fileController.getService();
                fileService.setPath(path.asString());

                // Find the handler and set the new file
                @SuppressWarnings("unchecked")
                final ServiceController<?> handlerController = registry.getService(LogServices.handlerName(name));
                final AbstractFileHandlerService handlerService = (AbstractFileHandlerService) handlerController.getService();
                final String fileName = fileService.getValue();
                try {
                    handlerService.setFile(fileName);
                } catch (FileNotFoundException e) {
View Full Code Here

        if (file.isDefined()) {
            final ModelNode path = PATH.resolveModelAttribute(context, file);
            final ServiceName serviceName = LogServices.handlerFileName(name);

            // Retrieve the current service
            final ServiceRegistry registry = context.getServiceRegistry(true);
            final ServiceController<?> fileController = registry.getService(serviceName);
            if (fileController == null) {
                throw new OperationFailedException(new ModelNode().set(MESSAGES.serviceNotFound(serviceName)));
            }
            final HandlerFileService fileService = (HandlerFileService) fileController.getService();
            fileService.setPath(path.asString());

            // Find the handler and set the new file
            @SuppressWarnings("unchecked")
            final ServiceController<?> handlerController = registry.getService(LogServices.handlerName(name));
            final AbstractFileHandlerService handlerService = (AbstractFileHandlerService) handlerController.getService();
            final String fileName = fileService.getValue();
            try {
                handlerService.setFile(fileName);
            } catch (FileNotFoundException e) {
View Full Code Here

    }

    @Override
    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {

        ServiceRegistry registry = context.getServiceRegistry(false);
        final ServiceName hqServiceName = MessagingServices.getHornetQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)));
        ServiceController<?> hqService = registry.getService(hqServiceName);
        if (hqService != null) {
            context.reloadRequired();
        } else {
            final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
            final String name = address.getLastElement().getValue();
View Full Code Here

    }

    @Override
    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {

        ServiceRegistry registry = context.getServiceRegistry(true);
        final ServiceName hqServiceName = MessagingServices.getHornetQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)));
        ServiceController<?> hqService = registry.getService(hqServiceName);
        if (hqService != null) {

            // The original subsystem initialization is complete; use the control object to create the divert
            if (hqService.getState() != ServiceController.State.UP) {
                throw MESSAGES.invalidServiceState(hqServiceName, ServiceController.State.UP, hqService.getState());
View Full Code Here

    }

    @Override
    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {

        ServiceRegistry registry = context.getServiceRegistry(false);
        final ServiceName hqServiceName = MessagingServices.getHornetQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)));
        ServiceController<?> hqService = registry.getService(hqServiceName);
        if (hqService != null) {
            context.reloadRequired();
        }
        // else MessagingSubsystemAdd will add a handler that calls addBroadcastGroupConfigs
    }
View Full Code Here

TOP

Related Classes of org.jboss.msc.service.ServiceRegistry

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.