* @return target instance
* @throws Throwable for any error
*/
private Object createTarget(ContainerCache cache, AOPProxyFactoryParameters params) throws Throwable
{
Advisor advisor = cache.getAdvisor();
if (advisor != null)
{
org.jboss.aop.ConstructorInfo aopinfo = findAopConstructorInfo(advisor);
Interceptor[] interceptors = (aopinfo != null) ? aopinfo.getInterceptors() : null;
if (interceptors != null)
{
ConstructorInvocation inv = new ConstructorInvocation(aopinfo, aopinfo.getInterceptors());
inv.setArguments(getArguments());
return inv.invokeNext();
}
if (getConstructorInfo().getParameterTypes().length > 0)
{
Constructor<?> constructor = null;
if (aopinfo == null)
{
//Fall back to using the class;
Class<?> clazz = advisor.getClazz();
Constructor<?>[] ctors = clazz.getConstructors();
for (Constructor<?> ctor : ctors)
{
if (matchConstructor(ctor))
{