Object obj = invocation.invokeNext();
try
{
Object[] arg = {TransactionManagerLocator.getInstance().locate()};
Method[] methods = obj.getClass().getMethods();
for (int i = 0; i < methods.length; i++)
{
if (methods[i].getParameterTypes().length == 1)
{
if (methods[i].getParameterTypes()[0].equals(TransactionManager.class))
{
if (AnnotationElement.isAnyAnnotationPresent(methods[i], Injected.class))
{
methods[i].invoke(obj, arg);
}
}
}
}
}
catch (Exception e)
{
throw new RuntimeException(e); //To change body of catch statement use Options | File Templates.
}
return obj;