return newResource;
}
protected ManagedExecutorService createConfigBean(Resources param, Properties properties) throws PropertyVetoException,
TransactionFailure {
ManagedExecutorService managedExecutorService = null;
if (getResourceType().equals(ServerTags.MANAGED_EXECUTOR_SERVICE)) {
managedExecutorService = param.createChild(ManagedExecutorService.class);
} else {
managedExecutorService = param.createChild(ManagedScheduledExecutorService.class);
}
managedExecutorService.setJndiName(jndiName);
if (description != null) {
managedExecutorService.setDescription(description);
}
managedExecutorService.setContextInfoEnabled(contextInfoEnabled);
managedExecutorService.setContextInfo(contextInfo);
managedExecutorService.setThreadPriority(threadPriority);
managedExecutorService.setHungAfterSeconds(hungAfterSeconds);
managedExecutorService.setCorePoolSize(corePoolSize);
managedExecutorService.setMaximumPoolSize(maximumPoolSize);
managedExecutorService.setKeepAliveSeconds(keepAliveSeconds);
managedExecutorService.setThreadLifetimeSeconds(threadLifetimeSeconds);
managedExecutorService.setTaskQueueCapacity(taskQueueCapacity);
managedExecutorService.setEnabled(enabled);
if (properties != null) {
for ( Map.Entry e : properties.entrySet()) {
Property prop = managedExecutorService.createChild(Property.class);
prop.setName((String)e.getKey());
prop.setValue((String)e.getValue());
managedExecutorService.getProperty().add(prop);
}
}
return managedExecutorService;
}