webappBuilder.addDependencies(action.dependencies());
}
if (metaData.getDistributable() != null) {
DistributedCacheManagerFactoryService factoryService = new DistributedCacheManagerFactoryService();
DistributedCacheManagerFactory factory = factoryService.getValue();
if (factory != null) {
ServiceName factoryServiceName = webappServiceName.append("session");
webappBuilder.addDependency(DependencyType.OPTIONAL, factoryServiceName, DistributedCacheManagerFactory.class, config.getDistributedCacheManagerFactoryInjector());
ServiceBuilder<DistributedCacheManagerFactory> factoryBuilder = serviceTarget.addService(factoryServiceName, factoryService);
boolean enabled = factory.addDeploymentDependencies(webappServiceName, deploymentUnit.getServiceRegistry(), serviceTarget, factoryBuilder, metaData);
factoryBuilder.setInitialMode(enabled ? Mode.ON_DEMAND : Mode.NEVER).install();
}
}
// OSGi web applications are activated in {@link WebContextActivationProcessor} according to bundle lifecycle changes