Package org.jboss.as.osgi.parser.SubsystemState

Examples of org.jboss.as.osgi.parser.SubsystemState.OSGiModule


            // Install a service that starts the bundles
            builder = serviceTarget.addService(Services.AUTOINSTALL_PROVIDER_COMPLETE, new AbstractService<Void>() {
                public void start(StartContext context) throws StartException {
                    for (ServiceName serviceName : pendingServices.keySet()) {
                        OSGiModule moduleMetaData = pendingServices.get(serviceName);
                        startBundle(serviceContainer, serviceName, moduleMetaData);
                    }
                    ROOT_LOGGER.debugf("Auto bundles bundles started");
                }
            });
View Full Code Here


    @Override
    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
        String identifier = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(CommonAttributes.MODULE).asString();

        SubsystemState stateService = (SubsystemState) context.getServiceRegistry(true).getRequiredService(SubsystemState.SERVICE_NAME).getValue();
        OSGiModule prevModule = stateService.removeModule(identifier);
        if (context.completeStep() == OperationContext.ResultAction.ROLLBACK) {
            stateService.addModule(prevModule);
        }
    }
View Full Code Here

        if (context.getType() == OperationContext.Type.SERVER) {
            context.addStep(new OperationStepHandler() {
                @Override
                public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                    String identifier = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(CommonAttributes.MODULE).asString();
                    OSGiModule module = new OSGiModule(ModuleIdentifier.fromString(identifier), startLevel);
                    SubsystemState stateService = (SubsystemState) context.getServiceRegistry(true).getRequiredService(SubsystemState.SERVICE_NAME).getValue();
                    stateService.addModule(module);

                    if (context.completeStep() == OperationContext.ResultAction.ROLLBACK) {
                        stateService.removeModule(identifier);
View Full Code Here

            ModelNode modules = operation.get(MODULES);
            Set<String> keys = modules.keys();
            if (keys != null) {
                for (String current : keys) {
                    String value = modules.get(current).get(START).asString();
                    subsystemState.addModule(new OSGiModule(ModuleIdentifier.fromString(current), Boolean.parseBoolean(value)));
                }
            }
        }

        return subsystemState;
View Full Code Here

            // Install a service that starts the bundles
            builder = serviceTarget.addService(ServiceNames.AUTOINSTALL_BUNDLES_COMPLETE, new AbstractService<Void>() {
                public void start(StartContext context) throws StartException {
                    for (ServiceName serviceName : pendingServices.keySet()) {
                        OSGiModule moduleMetaData = pendingServices.get(serviceName);
                        if (moduleMetaData.isStart()) {
                            @SuppressWarnings("unchecked")
                            ServiceController<Bundle> controller = (ServiceController<Bundle>) serviceContainer.getRequiredService(serviceName);
                            Bundle bundle = controller.getValue();
                            try {
                                bundle.start();
View Full Code Here

            // Install a service that starts the bundles
            builder = serviceTarget.addService(Services.AUTOINSTALL_PROVIDER_COMPLETE, new AbstractService<Void>() {
                public void start(StartContext context) throws StartException {
                    for (ServiceName serviceName : pendingServices.keySet()) {
                        OSGiModule moduleMetaData = pendingServices.get(serviceName);
                        startBundle(serviceContainer, serviceName, moduleMetaData);
                    }
                    log.debugf("Auto bundles bundles started");
                }
            });
View Full Code Here

        if (operation.has(MODULES)) {
            ModelNode modules = operation.get(MODULES);
            Set<String> keys = modules.keys();
            for (String current : keys) {
                String value = modules.get(current).get(START).asString();
                subsystemState.addModule(new OSGiModule(ModuleIdentifier.fromString(current), Boolean.parseBoolean(value)));
            }
        }

        return subsystemState;
    }
View Full Code Here

            Set<String> keys = modules.keys();
            if (keys != null) {
                for (String current : keys) {
                    ModelNode modelNode = modules.get(current).get(STARTLEVEL);
                    Integer startLevel = modelNode.isDefined() ? modelNode.asInt() : null;
                    subsystemState.addModule(new OSGiModule(ModuleIdentifier.fromString(current), startLevel));
                }
            }
        }

        return subsystemState;
View Full Code Here

            // Install a service that starts the bundles
            builder = serviceTarget.addService(Services.AUTOINSTALL_PROVIDER_COMPLETE, new AbstractService<Void>() {
                public void start(StartContext context) throws StartException {
                    for (ServiceName serviceName : pendingServices.keySet()) {
                        OSGiModule moduleMetaData = pendingServices.get(serviceName);
                        if (moduleMetaData.getStartLevel() != null) {
                            @SuppressWarnings("unchecked")
                            ServiceController<Bundle> controller = (ServiceController<Bundle>) serviceContainer.getRequiredService(serviceName);
                            Bundle bundle = controller.getValue();
                            StartLevel startLevel = injectedStartLevel.getValue();
                            startLevel.setBundleStartLevel(bundle, moduleMetaData.getStartLevel());
                            try {
                                bundle.start();
                            } catch (BundleException ex) {
                                log.errorf(ex, "Cannot start bundle: %s", bundle);
                            }
View Full Code Here

TOP

Related Classes of org.jboss.as.osgi.parser.SubsystemState.OSGiModule

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.