use of org.glassfish.ejb.config.EjbContainer in project Payara by payara.
the class EJBTimerService method initProperties.
private void initProperties() {
try {
// Check for property settings from domain.xml
EjbContainer ejbc = ejbContainerUtil.getEjbContainer();
EjbTimerService ejbt = ejbc.getEjbTimerService();
if (ejbt != null) {
String valString = ejbt.getMinimumDeliveryIntervalInMillis();
long val = (valString != null) ? Long.parseLong(valString) : -1;
if (val > 0) {
minimumDeliveryInterval_ = val;
}
valString = ejbt.getMaxRedeliveries();
val = (valString != null) ? Long.parseLong(valString) : -1;
// EJB 2.1 specification minimum is 1
if (val > 0) {
maxRedeliveries_ = val;
}
valString = ejbt.getRedeliveryIntervalInternalInMillis();
val = (valString != null) ? Long.parseLong(valString) : -1;
if (val > 0) {
redeliveryInterval_ = val;
}
rescheduleFailedTimer = Boolean.valueOf(ejbt.getPropertyValue(RESCHEDULE_FAILED_TIMER));
// Load confing listener
ejbContainerUtil.getServices().getService(EJBTimerServiceConfigListener.class);
}
} catch (Exception e) {
logger.log(Level.FINE, "Exception converting timer service " + "domain.xml properties. Defaults will be used instead.", e);
}
logger.log(Level.FINE, "EJB Timer Service properties : " + "min delivery interval = " + getMinimumDeliveryInterval() + "\nmax redeliveries = " + maxRedeliveries_ + "\nredelivery interval = " + getRedeliveryInterval());
}
use of org.glassfish.ejb.config.EjbContainer in project Payara by payara.
the class PersistentEJBTimerService method initProperties.
private void initProperties() {
try {
// Check for property settings from domain.xml
EjbContainer ejbc = ejbContainerUtil.getEjbContainer();
ejbt = ejbc.getEjbTimerService();
if (ejbt != null) {
// If the system property com.sun.ejb.timer.ReadDBBeforeTimeout
// is defined by the user use that the value of the flag
// performDBReadBeforeTimeout
foundSysPropDBReadBeforeTimeout = getDBReadBeforeTimeoutProperty();
operationOnConnectionFailure = ejbt.getPropertyValue(ON_CONECTION_FAILURE);
}
} catch (Exception e) {
logger.log(Level.FINE, "Exception converting timer service " + "domain.xml properties. Defaults will be used instead.", e);
}
}
use of org.glassfish.ejb.config.EjbContainer in project Payara by payara.
the class EjbContainerUtilImpl method postConstruct.
@Override
public void postConstruct() {
ejbContainer = serverConfig.getExtensionByType(EjbContainer.class);
ClassLoader ejbImplClassLoader = EjbContainerUtilImpl.class.getClassLoader();
if (callFlowAgent == null) {
callFlowAgent = (Agent) Proxy.newProxyInstance(ejbImplClassLoader, new Class[] { Agent.class }, new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method m, Object[] args) {
return null;
}
});
}
defaultThreadPoolExecutor = createThreadPoolExecutor(DEFAULT_THREAD_POOL_NAME);
// avoid starting JDK timer in application class loader. The life of _timer
// field is longer than deployed apps, and any reference to app class loader
// in JDK timer thread will cause class loader leak. Issue 17468
ClassLoader originalClassLoader = null;
try {
originalClassLoader = Utility.setContextClassLoader(ejbImplClassLoader);
_timer = new Timer("EJB Container Timer", true);
} finally {
if (originalClassLoader != null) {
Utility.setContextClassLoader(originalClassLoader);
}
}
EJBObjectOutputStreamHandler.setJavaEEIOUtils(javaEEIOUtils);
javaEEIOUtils.addGlassFishOutputStreamHandler(new EJBObjectOutputStreamHandler());
javaEEIOUtils.addGlassFishInputStreamHandler(new EJBObjectInputStreamHandler());
_me = this;
}
Aggregations