Methods Summary |
---|
public java.lang.Object | createPerClass(org.jboss.aop.Advisor advisor)
throw new RuntimeException("NOT ALLOWED");
|
public java.lang.Object | createPerInstance(org.jboss.aop.Advisor advisor, org.jboss.aop.InstanceAdvisor instanceAdvisor)
throw new RuntimeException("NOT ALLOWED");
|
public java.lang.Object | createPerJoinpoint(org.jboss.aop.Advisor advisor, org.jboss.aop.InstanceAdvisor instanceAdvisor, org.jboss.aop.joinpoint.Joinpoint jp)
throw new RuntimeException("NOT ALLOWED");
|
public java.lang.Object | createPerJoinpoint(org.jboss.aop.Advisor advisor, org.jboss.aop.joinpoint.Joinpoint jp)
if (jp instanceof MethodJoinpoint)
{
EJBContainer container = (EJBContainer) advisor;
Class beanClass = container.getBeanClass();
try
{
Method method = ((MethodJoinpoint) jp).getMethod();
if (isBusinessMethod(container, method))
{
InterceptorInfo[] infos = container.getInterceptorRepository().getBusinessInterceptors(container, method);
Method[] beanAroundInvoke = container.getInterceptorRepository().getBeanClassAroundInvokes(container);
log.debug("Bound interceptors for joinpoint: " + method + " - " + infos);
return new EJB3InterceptorsInterceptor(infos, beanAroundInvoke);
}
}
catch (RuntimeException e)
{
throw new RuntimeException("An exception occurred initialising interceptors for " + beanClass + "." + ((MethodJoinpoint) jp).getMethod().getName(), e);
}
}
return new EJB3InterceptorsInterceptor(new InterceptorInfo[0], null);
|
public java.lang.Object | createPerVM()
throw new RuntimeException("NOT ALLOWED");
|
private java.util.ArrayList | getBusinessInterfaces(org.jboss.ejb3.EJBContainer container)
ArrayList<Class> interfaces = new ArrayList<Class>();
if (container instanceof ConsumerContainer)
{
Producers producers = (Producers) container.resolveAnnotation(Producers.class);
if (producers != null)
{
for (Producer producer : producers.value())
{
interfaces.add(producer.producer());
}
}
Producer producer = (Producer) container.resolveAnnotation(Producer.class);
if (producer != null)
{
interfaces.add(producer.producer());
}
for (Class implIf : container.getBeanClass().getInterfaces())
{
if (implIf.getAnnotation(Producer.class) != null)
{
interfaces.add(implIf);
}
}
}
else if (container instanceof MDB)
{
interfaces.add(((MDB)container).getMessagingType());
}
else
{
Class[] remotes = ProxyFactoryHelper.getRemoteInterfaces(container);
Class[] locals = ProxyFactoryHelper.getLocalInterfaces(container);
if (remotes != null)
{
interfaces.addAll(Arrays.asList(remotes));
}
if (locals != null)
{
interfaces.addAll(Arrays.asList(locals));
}
if (container instanceof ServiceContainer)
{
Management man = (Management) container.resolveAnnotation(Management.class);
if (man != null)
{
Class iface = man.value();
if (iface != null)
{
interfaces.add(iface);
}
}
Class[] implIfaces = container.getBeanClass().getInterfaces();
for (Class iface : implIfaces)
{
if (iface.getAnnotation(Management.class) != null)
{
interfaces.add(iface);
}
}
}
}
return interfaces;
|
public java.lang.String | getName()
try
{
Class clazz = MessageListener.class;
Method m = clazz.getDeclaredMethod("onMessage", new Class[]{javax.jms.Message.class});
MESSAGE_LISTENER_ON_MESSAGE = MethodHashing.calculateHash(m);
}
catch (Exception e)
{
throw new RuntimeException("Error initialising hash for MessageListener.onMessage()", e);
}
return getClass().getName();
|
private boolean | isBusinessMethod(org.jboss.ejb3.EJBContainer container, java.lang.reflect.Method method)
long hash = MethodHashing.calculateHash(method);
ArrayList<Class> businessInterfaces = getBusinessInterfaces(container);
for (Class businessInterface : businessInterfaces)
{
for (Method interfaceMethod : businessInterface.getMethods())
{
if (MethodHashing.calculateHash(interfaceMethod) == hash)
{
return true;
}
}
}
return false;
|