@Override public void stop(BundleContext context) throws Exception { if (controller != null) { // Wait for the {@link HttpServiceFactoryService} to get removed // [AS7-5828] HttpService may fail to start due to already existing service FutureServiceValue<StandardContext> future = new FutureServiceValue<StandardContext>(controller, State.REMOVED); controller.setMode(Mode.REMOVE); future.get(10, TimeUnit.SECONDS); } } }
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public void resolve(XBundle bundle) throws ResolutionException { // Resolve the bundle bundleManager.resolveBundle(bundle); // In case there is no DeploymentUnit there is a possiblity // of a race between the first class load and the availability of the Module // Here we wait for the ModuleSpec service to come up before we are done resolving // https://issues.jboss.org/browse/AS7-6016 Deployment deployment = bundle.adapt(Deployment.class); DeploymentUnit depUnit = deployment.getAttachment(BundleDeploymentProcessor.DEPLOYMENT_UNIT_KEY); if (depUnit == null) { ModuleIdentifier identifier = bundle.getBundleRevision().getModuleIdentifier(); ServiceName moduleServiceName = ServiceModuleLoader.moduleServiceName(identifier); ServiceRegistry serviceRegistry = bundleManager.getServiceContainer(); ServiceController<?> controller = serviceRegistry.getRequiredService(moduleServiceName); FutureServiceValue<?> future = new FutureServiceValue(controller); try { future.get(2, TimeUnit.SECONDS); } catch (Exception ex) { throw FrameworkMessages.MESSAGES.illegalStateCannotLoadModule(ex, identifier); } } }
future.get(30, TimeUnit.SECONDS); } catch (ExecutionException ex) { LOGGER.errorf(failure, failure.getMessage());
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public void resolve(XBundle bundle) throws ResolutionException { // Resolve the bundle defaultService.resolve(bundle); // In case there is no DeploymentUnit there is a possiblity // of a race between the first class load and the availability of the Module // Here we wait for the ModuleSpec service to come up before we are done resolving // https://issues.jboss.org/browse/AS7-6016 Deployment deployment = bundle.adapt(Deployment.class); DeploymentUnit depUnit = deployment.getAttachment(DeploymentUnit.class); if (depUnit == null) { ModuleIdentifier identifier = bundle.getBundleRevision().getModuleIdentifier(); ServiceName moduleServiceName = ServiceModuleLoader.moduleServiceName(identifier); ServiceRegistry serviceRegistry = injectedBundleManager.getValue().getServiceContainer(); ServiceController<?> controller = serviceRegistry.getRequiredService(moduleServiceName); FutureServiceValue<?> future = new FutureServiceValue(controller); try { future.get(2, TimeUnit.SECONDS); } catch (Exception ex) { throw FrameworkMessages.MESSAGES.illegalStateCannotLoadModule(ex, identifier); } } }
future.get(30, TimeUnit.SECONDS); } catch (ExecutionException ex) { LOGGER.errorf(failure, failure.getMessage());