Package org.jboss.msc.service

Examples of org.jboss.msc.service.ServiceRegistry


        if (attr == null) {
            // Not a runtime attribute; restart required
            return true;
        }
        else {
            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 service isn't installed, so the work done in the Stage.MODEL part is all there is to it
                return false;
            } else if (hqService.getState() != ServiceController.State.UP) {
                // Service is installed but not up?
View Full Code Here


                                         final String attributeName, final ModelNode valueToRestore,
                                         final ModelNode valueToRevert,
                                         final Void handback) throws OperationFailedException {

        if (runtimeAttributes.containsKey(attributeName)) {
            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 && hqService.getState() == ServiceController.State.UP) {
                // Create and execute a write-attribute operation that uses the valueToRestore
                ModelNode revertOp = operation.clone();
                revertOp.get(attributeName).set(valueToRestore);
                applyOperationToHornetQService(context, revertOp, attributeName, hqService);
View Full Code Here

        if (attr.getFlags().contains(AttributeAccess.Flag.RESTART_ALL_SERVICES)) {
            // Restart required
            return true;
        } else {

            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 service isn't installed, so the work done in the Stage.MODEL part is all there is to it
                return false;
            } else if (hqService.getState() != ServiceController.State.UP) {
                // Service is installed but not up?
View Full Code Here

                                         final ModelNode valueToRevert,
                                         final Void handback) throws OperationFailedException {

        AttributeDefinition attr = getAttributeDefinition(attributeName);
        if (!attr.getFlags().contains(AttributeAccess.Flag.RESTART_ALL_SERVICES)) {
            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 && hqService.getState() == ServiceController.State.UP) {
                // Create and execute a write-attribute operation that uses the valueToRestore
                ModelNode revertOp = operation.clone();
                revertOp.get(attributeName).set(valueToRestore);
                applyOperationToHornetQService(context, revertOp, attributeName, hqService);
View Full Code Here

            applyModelToRuntime(context, restored);
        }


        private void applyModelToRuntime(OperationContext context, final ModelNode model) throws OperationFailedException {
            final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
            ServiceController<IIOPSettingsService> controller = (ServiceController<IIOPSettingsService>) serviceRegistry.getService(IIOPSettingsService.SERVICE_NAME);
            if (controller != null) {
                IIOPSettingsService service = controller.getValue();
                applySetting(service, context, model);
            }
        }
View Full Code Here

    }

    void updateDefaultDistinctName(final OperationContext context, final ModelNode model) throws OperationFailedException {

        final ModelNode defaultDistinctName = this.attributeDefinition.resolveModelAttribute(context, model);
        final ServiceRegistry registry = context.getServiceRegistry(true);

        final ServiceController<?> existingDefaultLocalEJBReceiverServiceController = registry.getService(DefaultDistinctNameService.SERVICE_NAME);
        DefaultDistinctNameService service = (DefaultDistinctNameService) existingDefaultLocalEJBReceiverServiceController.getValue();
        if (!defaultDistinctName.isDefined()) {
            service.setDefaultDistinctName(null);
        } else {
            service.setDefaultDistinctName(defaultDistinctName.asString());
View Full Code Here

        final boolean enableStatistics = enableStatisticsModel.isDefined() && enableStatisticsModel.asBoolean();
        utilities(context).setStatisticsEnabled(enableStatistics);
    }

    private static EJBUtilities utilities(final OperationContext context) {
        final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
        return (EJBUtilities) serviceRegistry.getRequiredService(EJBUtilities.SERVICE_NAME).getValue();
    }
View Full Code Here

    void updatePoolService(final OperationContext context, final ModelNode model, List<ServiceController<?>> newControllers) throws OperationFailedException {

        final ModelNode poolName = poolAttribute.resolveModelAttribute(context, model);

        final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
        ServiceController existingDefaultPoolConfigService = serviceRegistry.getService(poolConfigServiceName);
        // if a default MDB pool is already installed, then remove it first
        if (existingDefaultPoolConfigService != null) {
            context.removeService(existingDefaultPoolConfigService);
        }
View Full Code Here

    }

    void updateDefaultLocalEJBReceiverService(final OperationContext context, final ModelNode model, List<ServiceController<?>> newControllers) throws OperationFailedException {

        final ModelNode passByValueModel = this.attributeDefinition.resolveModelAttribute(context, model);
        final ServiceRegistry registry = context.getServiceRegistry(true);
        final ServiceName localEJBReceiverServiceName;
        if (passByValueModel.isDefined()) {
            final boolean passByValue = passByValueModel.asBoolean(true);
            if (passByValue) {
                localEJBReceiverServiceName = LocalEjbReceiver.BY_VALUE_SERVICE_NAME;
            } else {
                localEJBReceiverServiceName = LocalEjbReceiver.BY_REFERENCE_SERVICE_NAME;
            }
        } else {
            localEJBReceiverServiceName = LocalEjbReceiver.BY_VALUE_SERVICE_NAME;
        }
        // uninstall the existing default local EJB receiver service
        final ServiceController<?> existingDefaultLocalEJBReceiverServiceController = registry.getService(LocalEjbReceiver.DEFAULT_LOCAL_EJB_RECEIVER_SERVICE_NAME);
        if (existingDefaultLocalEJBReceiverServiceController != null) {
            context.removeService(existingDefaultLocalEJBReceiverServiceController);
        }
        final ServiceTarget serviceTarget = context.getServiceTarget();
        // now install the new default local EJB receiver service which points to a existing Local EJB receiver service
View Full Code Here

        if (ejbClientContext != null) {
            return ejbClientContext;
        }
        logger.debug("Deployment unit " + deploymentUnit + " doesn't have any explicit EJB client context configured. " +
                "Falling back on the default " + DefaultEjbClientContextService.DEFAULT_SERVICE_NAME + " EJB client context service");
        final ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry();
        final ServiceController<EJBClientContext> ejbClientContextServiceController = (ServiceController<EJBClientContext>) serviceRegistry.getRequiredService(DefaultEjbClientContextService.DEFAULT_SERVICE_NAME);
        return ejbClientContextServiceController.getValue();
    }
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.