Methods Summary |
---|
public java.util.Map | getContextData()
if (metadata == null) {
metadata = new HashMap();
}
return metadata;
|
public static javax.interceptor.InvocationContext | getLifecycleInvocationContext(java.lang.Class type, org.jboss.ejb3.BeanContext beanContext, InterceptorInfo[] interceptorInfos, java.lang.reflect.Method[] beanMethods)
LifecycleInvocationContextImpl ic = null;
if (type == PostConstruct.class) ic = new PostConstructICtxImpl();
else if (type == PostActivate.class) ic = new PostActivateICtxImpl();
else if (type == PrePassivate.class) ic = new PrePassivateICtxImpl();
else if (type == PreDestroy.class) ic = new PreDestroyICtxImpl();
else throw new RuntimeException("Unsupported lifecycle event: " + type);
ic.instances = beanContext.getInterceptorInstances(interceptorInfos);
if (interceptorInfos.length != ic.instances.length)
{
throw new RuntimeException("interceptorInfos and instances have different length");
}
ic.beanContext = beanContext;
ic.beanMethods = beanMethods;
ic.interceptorInfos = interceptorInfos;
return ic;
|
abstract java.lang.reflect.Method[] | getLifecycleMethods(InterceptorInfo info)
|
public java.lang.reflect.Method | getMethod()
return null;
|
public java.lang.Object[] | getParameters()
return new Object[0];
|
public java.lang.Object | getTarget()
return beanContext.getInstance();
|
public java.lang.Object | proceed()
if (currentInterceptor < interceptorInfos.length)
{
int oldInterceptor = currentInterceptor;
int oldMethod = currentMethod;
try
{
int curr = currentInterceptor;
int currMethod = currentMethod++;
InterceptorInfo info = interceptorInfos[curr];
if (currMethod == getLifecycleMethods(info).length)
{
curr = ++currentInterceptor;
currentMethod = 0;
currMethod = currentMethod++;
info = (curr < interceptorInfos.length) ? interceptorInfos[curr] : null;
}
if (info != null)
{
try
{
Method[] methods = getLifecycleMethods(info);
return methods[currMethod].invoke(instances[curr], this);
}
catch (InvocationTargetException e)
{
if (e.getTargetException() instanceof Exception)
{
throw ((Exception) e.getCause());
}
else
{
throw new RuntimeException(e.getCause());
}
}
}
}
finally
{
// so that interceptors like clustering can reinvoke down the chain
currentInterceptor = oldInterceptor;
currentMethod = oldMethod;
}
}
if (beanMethods != null)
{
try
{
for (Method beanMethod : beanMethods)
{
beanMethod.invoke(getTarget(), new Object[0]);
}
}
catch (InvocationTargetException e)
{
if (e.getTargetException() instanceof Exception)
{
throw ((Exception) e.getCause());
}
else
{
throw new RuntimeException(e.getCause());
}
}
finally
{
}
}
return null;
|
public void | setParameters(java.lang.Object[] params)
//Do nothing
|