use of com.sun.ejb.containers.EJBTimerServiceWrapper in project Payara by payara.
the class EjbNamingReferenceManagerImpl method getEJBContextObject.
public Object getEJBContextObject(String contextType) {
ComponentInvocation currentInv = invMgr.getCurrentInvocation();
if (currentInv == null) {
throw new IllegalStateException("no current invocation");
} else if (currentInv.getInvocationType() != ComponentInvocation.ComponentInvocationType.EJB_INVOCATION) {
throw new IllegalStateException("Illegal invocation type for EJB Context : " + currentInv.getInvocationType());
}
EjbInvocation ejbInv = (EjbInvocation) currentInv;
Object returnObject = ejbInv.context;
if (contextType.equals("javax.ejb.TimerService")) {
if (EJBTimerService.getEJBTimerService() == null) {
throw new IllegalStateException("EJB Timer Service not " + "available");
}
returnObject = new EJBTimerServiceWrapper(EJBTimerService.getEJBTimerService(), (EJBContextImpl) ejbInv.context);
}
return returnObject;
}
Aggregations