use of org.glassfish.concurrent.config.ManagedExecutorService in project Payara by payara.
the class ManagedExecutorServiceDeployer method deployResource.
@Override
public void deployResource(Object resource) throws Exception {
ManagedExecutorService managedExecutorServiceResource = (ManagedExecutorService) resource;
ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(managedExecutorServiceResource);
deployResource(resource, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
}
use of org.glassfish.concurrent.config.ManagedExecutorService in project Payara by payara.
the class ManagedExecutorServiceDeployer method deployResource.
@Override
public void deployResource(Object resource, String applicationName, String moduleName) throws Exception {
ManagedExecutorService managedExecutorServiceRes = (ManagedExecutorService) resource;
if (managedExecutorServiceRes == null) {
_logger.log(Level.WARNING, LogFacade.DEPLOY_ERROR_NULL_CONFIG, "ManagedExecutorService");
return;
}
String jndiName = managedExecutorServiceRes.getJndiName();
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "ManagedExecutorServiceDeployer.deployResource() : jndi-name [" + jndiName + "], ");
}
ResourceInfo resourceInfo = new ResourceInfo(managedExecutorServiceRes.getJndiName(), applicationName, moduleName);
ManagedExecutorServiceConfig config = new ManagedExecutorServiceConfig(managedExecutorServiceRes);
javax.naming.Reference ref = new javax.naming.Reference(javax.enterprise.concurrent.ManagedExecutorService.class.getName(), "org.glassfish.concurrent.runtime.deployer.ConcurrentObjectFactory", null);
RefAddr addr = new SerializableObjectRefAddr(ManagedExecutorServiceConfig.class.getName(), config);
ref.add(addr);
RefAddr resAddr = new SerializableObjectRefAddr(ResourceInfo.class.getName(), resourceInfo);
ref.add(resAddr);
try {
// Publish the object ref
namingService.publishObject(resourceInfo, ref, true);
} catch (NamingException ex) {
LogHelper.log(_logger, Level.SEVERE, LogFacade.UNABLE_TO_BIND_OBJECT, ex, "ManagedExecutorService", jndiName);
}
registerMonitorableComponent(managedExecutorServiceRes);
}
Aggregations