XaDataSourcePropertiesService xaPropService = (XaDataSourcePropertiesService) xaConfigPropertyController.getService(); if (!ServiceController.State.UP.equals(xaConfigPropertyController.getState())) { propertiesCount++; xaConfigPropertyController.setMode(ServiceController.Mode.ACTIVE); ConnectionPropertiesService connPropService = (ConnectionPropertiesService) connPropServiceController.getService(); if (!ServiceController.State.UP.equals(connPropServiceController.getState())) { connPropServiceController.setMode(ServiceController.Mode.ACTIVE); builder.addDependency(name, String.class, configService.getConnectionPropertyInjector(connPropService.getName())); if (!ServiceController.State.UP.equals(dataSourceController.getState())) { final boolean statsEnabled = STATISTICS_ENABLED.resolveModelAttribute(context, model).asBoolean(); DataSourceStatisticsService statsService = new DataSourceStatisticsService(datasourceRegistration, statsEnabled);
throw NamingLogger.ROOT_LOGGER.cannotResolveServiceBug(serviceName, getClass().getName(), controller.getState().toString());
XaDataSourcePropertiesService xaPropService = (XaDataSourcePropertiesService) xaConfigPropertyController.getService(); if (!ServiceController.State.UP.equals(xaConfigPropertyController.getState())) { propertiesCount++; xaConfigPropertyController.setMode(ServiceController.Mode.ACTIVE); ConnectionPropertiesService connPropService = (ConnectionPropertiesService) connPropServiceController.getService(); if (!ServiceController.State.UP.equals(connPropServiceController.getState())) { connPropServiceController.setMode(ServiceController.Mode.ACTIVE); builder.addDependency(name, String.class, configService.getConnectionPropertyInjector(connPropService.getName())); if (!ServiceController.State.UP.equals(dataSourceController.getState())) { final boolean statsEnabled = STATISTICS_ENABLED.resolveModelAttribute(context, model).asBoolean(); DataSourceStatisticsService statsService = new DataSourceStatisticsService(datasourceRegistration, statsEnabled);
XaDataSourcePropertiesService xaPropService = (XaDataSourcePropertiesService) xaConfigPropertyController.getService(); if (!ServiceController.State.UP.equals(xaConfigPropertyController.getState())) { propertiesCount++; xaConfigPropertyController.setMode(ServiceController.Mode.ACTIVE); ConnectionPropertiesService connPropService = (ConnectionPropertiesService) dataSourceController.getService(); if (!ServiceController.State.UP.equals(dataSourceController.getState())) { dataSourceController.setMode(ServiceController.Mode.ACTIVE); builder.addDependency(name, String.class, configService.getConnectionPropertyInjector(connPropService.getName())); if (!ServiceController.State.UP.equals(dataSourceController.getState())) { dataSourceController.setMode(ServiceController.Mode.ACTIVE); } else {
final ServiceController<?> dataSourceController = registry.getService(dataSourceServiceName); if (dataSourceController != null) { if (ServiceController.State.UP.equals(dataSourceController.getState())) { dataSourceController.setMode(ServiceController.Mode.NEVER); } else { if (ServiceController.State.UP.equals(connPropertyController.getState())) { connPropertyController.setMode(ServiceController.Mode.NEVER); } else { if (ServiceController.State.UP.equals(xaConfigPropertyController.getState())) { xaConfigPropertyController.setMode(ServiceController.Mode.NEVER); } else {
throw MESSAGES.cannotResolveServiceBug(serviceName, getClass().getName(), listener.getState().toString());
serviceClass, mode.name(), state.getState().name(), state.name(), dependencyNames,
serviceClass, mode.name(), state.getState().name(), state.name(), dependencyNames,
throw NamingLogger.ROOT_LOGGER.cannotResolveServiceBug(serviceName, getClass().getName(), controller.getState().toString());
throw NamingLogger.ROOT_LOGGER.cannotResolveServiceBug(serviceName, getClass().getName(), controller.getState().toString());
public void deActivate() { // passivate the activation service only if the ActiveMQ server is deactivated when it fails back // and *not* during AS7 service container shutdown or reload (AS7-6840 / AS7-6881) if (activeMQActivationController != null) { if (!activeMQActivationController.getState().in(STOPPING, REMOVED)) { // [WFLY-4597] When Artemis is deactivated during failover, we block until its // activation controller is REMOVED before giving back control to Artemis. // This allow to properly stop any service depending on the activation controller // and avoid spurious warning messages because the resources used by the services // are stopped outside the control of the services. final CountDownLatch latch = new CountDownLatch(1); activeMQActivationController.compareAndSetMode(ACTIVE, REMOVE); activeMQActivationController.addListener(new LifecycleListener() { @Override public void handleEvent(ServiceController<?> controller, LifecycleEvent event) { if (event == LifecycleEvent.REMOVED) { latch.countDown(); } } }); try { latch.await(5, TimeUnit.SECONDS); } catch (InterruptedException e) { } activeMQActivationController = null; } } } });
public void deActivate() { // passivate the activation service only if the ActiveMQ server is deactivated when it fails back // and *not* during AS7 service container shutdown or reload (AS7-6840 / AS7-6881) if (activeMQActivationController != null) { if (!activeMQActivationController.getState().in(STOPPING, REMOVED)) { // [WFLY-4597] When Artemis is deactivated during failover, we block until its // activation controller is REMOVED before giving back control to Artemis. // This allow to properly stop any service depending on the activation controller // and avoid spurious warning messages because the resources used by the services // are stopped outside the control of the services. final CountDownLatch latch = new CountDownLatch(1); activeMQActivationController.compareAndSetMode(ACTIVE, REMOVE); activeMQActivationController.addListener(new LifecycleListener() { @Override public void handleEvent(ServiceController<?> controller, LifecycleEvent event) { if (event == LifecycleEvent.REMOVED) { latch.countDown(); } } }); try { latch.await(5, TimeUnit.SECONDS); } catch (InterruptedException e) { } activeMQActivationController = null; } } } });
@Override protected void performRuntime( OperationContext context, ModelNode operation, ModelNode model ) throws OperationFailedException { String repositoryName = null; for (ServiceName serviceName : servicesToRemove(context, operation, model)) { ServiceController<?> serviceController = context.getServiceRegistry(false).getService(serviceName); //only remove a service if it's up an running if (serviceController != null && serviceController.getState().in(ServiceController.State.UP)) { context.removeService(serviceController); removedServices().put(serviceName, serviceController.getService()); if (log.isDebugEnabled()) { if (repositoryName == null) { repositoryName = repositoryName(operation); } log.debugf("service '%s' removed for repository '%s'", serviceName, repositoryName); } } } }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void transition(ServiceController controller, Transition transition) { if(!typeToTrack.isParentOf(controller.getName())) { return; } if(transition.getAfter().getState().equals(State.UP)) { serviceCollection.add((S) controller.getValue()); } else { serviceCollection.remove(controller.getValue()); } }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void transition(ServiceController controller, Transition transition) { if(!typeToTrack.isParentOf(controller.getName())) { return; } if(transition.getAfter().getState().equals(State.UP)) { serviceCollection.add((S) controller.getValue()); } else { serviceCollection.remove(controller.getValue()); } }
/** * Populate the supplied response {@link ModelNode} with information about the supplied {@link ServiceController} * * @param response the response to populate. * @param serviceController the {@link ServiceController} to use when populating the response. */ static void populateResponse(final ModelNode response, final ServiceController<?> serviceController) { response.set(serviceController.getState().toString()); }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void transition(ServiceController controller, Transition transition) { if(!typeToTrack.isParentOf(controller.getName())) { return; } if(transition.getAfter().getState().equals(State.UP)) { serviceCollection.add((S) controller.getValue()); } else { serviceCollection.remove(controller.getValue()); } }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void transition(ServiceController controller, Transition transition) { if(!typeToTrack.isParentOf(controller.getName())) { return; } if(transition.getAfter().getState().equals(State.UP)) { serviceCollection.add((S) controller.getValue()); } else { serviceCollection.remove(controller.getValue()); } }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void transition(ServiceController controller, Transition transition) { if(!typeToTrack.isParentOf(controller.getName())) { return; } if(transition.getAfter().getState().equals(State.UP)) { serviceCollection.add((S) controller.getValue()); } else { serviceCollection.remove(controller.getValue()); } }