Methods Summary |
---|
public java.lang.reflect.Method | getTimeoutCallback()
return timeoutCallbackMethod;
|
public long | getTimeoutCalllbackHash()
return timeoutCalllbackHash;
|
public void | postActivate(org.jboss.ejb3.BeanContext ctx)
try
{
InvocationContext ic = LifecycleInvocationContextImpl.getLifecycleInvocationContext(
PostActivate.class,
ctx,
postActivates,
beanPostActivates);
ic.proceed();
}
catch (Exception e)
{
throw new RuntimeException(e);
}
|
public void | postConstruct(org.jboss.ejb3.BeanContext ctx)
try
{
InvocationContext ic = LifecycleInvocationContextImpl.getLifecycleInvocationContext(
PostConstruct.class,
ctx,
postConstructs,
beanPostConstructs);
ic.proceed();
}
catch (Exception e)
{
throw new RuntimeException(e);
}
|
public void | preDestroy(org.jboss.ejb3.BeanContext ctx)
Object id = null;
if (ctx instanceof StatefulBeanContext)
{
id = ((StatefulBeanContext)ctx).getId();
}
try
{
InvocationContext ic = LifecycleInvocationContextImpl.getLifecycleInvocationContext(
PreDestroy.class,
ctx,
preDestroys,
beanPreDestroys);
ic.proceed();
}
catch (Exception e)
{
throw new RuntimeException(e);
}
|
public void | prePassivate(org.jboss.ejb3.BeanContext ctx)
try
{
InvocationContext ic = LifecycleInvocationContextImpl.getLifecycleInvocationContext(
PrePassivate.class,
ctx,
prePassivates,
beanPrePassivates);
ic.proceed();
}
catch (Exception e)
{
throw new RuntimeException(e);
}
|
private void | resolveTimeoutCallback()
for (Method method : container.getBeanClass().getMethods())
{
if (container.resolveAnnotation(method, Timeout.class) != null)
{
if (Modifier.isPublic(method.getModifiers()) &&
method.getReturnType().equals(Void.TYPE) &&
method.getParameterTypes().length == 1 &&
method.getParameterTypes()[0].equals(Timer.class))
{
timeoutCallbackMethod = method;
}
else
{
throw new RuntimeException("@Timeout methods must have the signature: public void <METHOD>(javax.ejb.Timer timer) - " + method);
}
}
}
try
{
if (timeoutCallbackMethod == null && javax.ejb.TimedObject.class.isAssignableFrom(container.getBeanClass()))
{
Class[] params = new Class[]{Timer.class};
timeoutCallbackMethod = container.getBeanClass().getMethod("ejbTimeout", params);
}
}
catch (Exception e)
{
e.printStackTrace();
}
if (timeoutCallbackMethod != null)
{
timeoutCalllbackHash = MethodHashing.calculateHash(timeoutCallbackMethod);
}
|