Methods Summary |
---|
protected void | appendMethodString(java.lang.StringBuffer buf, java.lang.String methodType, java.lang.reflect.Method m)
if (m != null)
{
buf.append(", " + methodType + "=" + m.getName());
}
|
protected void | appendMethods(java.lang.StringBuffer sb)
appendMethodString(sb, "aroundInvoke", aroundInvoke);
appendMethodString(sb, "postConstruct", postConstruct);
appendMethodString(sb, "postActivate", postActivate);
appendMethodString(sb, "prePassivate", prePassivate);
appendMethodString(sb, "preDestroy", preDestroy);
|
public void | calculateHierarchy(org.jboss.ejb3.interceptor.InterceptorInfo superInfo)
if (haveCalculatedHierarchy)
{
return;
}
postConstructHierarchy = initaliseMethods((superInfo != null) ? superInfo.postConstructHierarchy : null, postConstruct);
postActivateHierarchy = initaliseMethods((superInfo != null) ? superInfo.postActivateHierarchy : null, postActivate);
aroundInvokeHierarchy = initaliseMethods((superInfo != null) ? superInfo.aroundInvokeHierarchy : null, aroundInvoke);
prePassivateHierarchy = initaliseMethods((superInfo != null) ? superInfo.prePassivateHierarchy : null, prePassivate);
preDestroyHierarchy = initaliseMethods((superInfo != null) ? superInfo.preDestroyHierarchy : null, preDestroy);
haveCalculatedHierarchy = true;
|
public boolean | equals(java.lang.Object obj)
if (obj instanceof InterceptorInfo)
{
return clazz.equals(((InterceptorInfo)obj).getClazz());
}
return false;
|
public java.lang.reflect.Method | getAroundInvoke()
return aroundInvoke;
|
public java.lang.reflect.Method[] | getAroundInvokes()
return aroundInvokeHierarchy;
|
public java.lang.Class | getClazz()
return clazz;
|
public java.lang.reflect.Method | getPostActivate()
return postActivate;
|
public java.lang.reflect.Method[] | getPostActivates()
return postActivateHierarchy;
|
public java.lang.reflect.Method | getPostConstruct()
return postConstruct;
|
public java.lang.reflect.Method[] | getPostConstructs()
return postConstructHierarchy;
|
public java.lang.reflect.Method | getPreDestroy()
return preDestroy;
|
public java.lang.reflect.Method[] | getPreDestroys()
return preDestroyHierarchy;
|
public java.lang.reflect.Method | getPrePassivate()
return prePassivate;
|
public java.lang.reflect.Method[] | getPrePassivates()
return prePassivateHierarchy;
|
public org.jboss.ejb3.metamodel.Interceptor | getXml()
return xml;
|
public int | hashCode()
return clazz.getName().hashCode();
|
public boolean | haveCalculatedHierarchy()
return haveCalculatedHierarchy;
|
private boolean | haveMethod(java.lang.reflect.Method method)
try
{
clazz.getDeclaredMethod(method.getName(), method.getParameterTypes());
return true;
}
catch (NoSuchMethodException e)
{
return false;
}
|
private java.lang.reflect.Method[] | initaliseMethods(java.lang.reflect.Method[] superMethods, java.lang.reflect.Method myMethod)
if (superMethods == null && myMethod == null)
{
return null;
}
ArrayList hierarchy = new ArrayList();
if (superMethods != null)
{
//We only want to add superclass interceptor/lifecycle methods if we do not override them
for (int i = 0 ; i < superMethods.length ; ++i)
{
if (!haveMethod(superMethods[i]))
{
hierarchy.add(superMethods[i]);
}
}
}
if (myMethod != null)
{
hierarchy.add(myMethod);
}
return (Method[])hierarchy.toArray(new Method[hierarchy.size()]);
|
private java.lang.reflect.Method | makeAccessible(java.lang.reflect.Method method)
try
{
AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run()
{
method.setAccessible(true);
return null;
}
});
}
catch (PrivilegedActionException e)
{
throw new RuntimeException(e.getException());
}
return method;
|
protected void | setAroundInvoke(java.lang.reflect.Method aroundInvoke)
if (aroundInvoke == null) return;
if (this.aroundInvoke != null && !this.aroundInvoke.equals(aroundInvoke))
{
throw new RuntimeException("Interceptors can only have one around-invoke/@AroundInvoke method - " + clazz.getName());
}
this.aroundInvoke = makeAccessible(aroundInvoke);
|
protected void | setPostActivate(java.lang.reflect.Method postActivate)
if (postActivate == null) return;
if (this.postActivate != null && !this.postActivate.equals(postActivate))
{
throw new RuntimeException("Interceptors can only have one post-activate/@PostActivate method - " + clazz.getName());
}
this.postActivate = makeAccessible(postActivate);
|
protected void | setPostConstruct(java.lang.reflect.Method postConstruct)
if (postConstruct == null) return;
if (this.postConstruct != null && !this.postConstruct.equals(postConstruct))
{
throw new RuntimeException("Interceptors can only have one post-construct/@PostConstruct method - " + clazz.getName());
}
this.postConstruct = makeAccessible(postConstruct);
|
protected void | setPreDestroy(java.lang.reflect.Method preDestroy)
if (preDestroy == null) return;
if (this.preDestroy != null && !this.preDestroy.equals(preDestroy))
{
throw new RuntimeException("Interceptors can only have one pre-destroy/@PreDestroy method - " + clazz.getName());
}
this.preDestroy = makeAccessible(preDestroy);
|
protected void | setPrePassivate(java.lang.reflect.Method prePassivate)
if (prePassivate == null) return;
if (this.prePassivate != null && !this.prePassivate.equals(prePassivate))
{
throw new RuntimeException("Interceptors can only have one pre-passivate/@PrePassivate method - " + clazz.getName());
}
this.prePassivate = makeAccessible(prePassivate);
|
protected void | setXml(org.jboss.ejb3.metamodel.Interceptor xml)
this.xml = xml;
|
public java.lang.String | toString()
StringBuffer sb = new StringBuffer("InterceptorInfo{class=" + clazz);
appendMethods(sb);
sb.append("}");
return sb.toString();
|