// Describe the factory
BeanInfo factoryInfo = config.getBeanInfo(factory.getClass());
// Find the method
MethodJoinpoint joinPoint = findMethod(trace, factoryInfo, cl, metaData.getFactoryMethod(), parameters, false, true);
joinPoint.setTarget(factory);
MethodInfo minfo = joinPoint.getMethodInfo();
// Set the parameters
if (minfo != null)
{
TypeInfo[] pinfos = minfo.getParameterTypes();
Object[] params = getParameters(trace, cl, pinfos, parameters);
joinPoint.setArguments(params);
}
return joinPoint;
}
String factoryClassName = metaData.getFactoryClass();
if (factoryClassName != null)
{
// Get the parameters
List parameters = metaData.getParameters();
BeanInfo factoryInfo = config.getBeanInfo(factoryClassName, cl);
// Find the method
MethodJoinpoint joinPoint = findMethod(trace, factoryInfo, cl, metaData.getFactoryMethod(), parameters, true, true);
MethodInfo minfo = joinPoint.getMethodInfo();
// Set the parameters
if (minfo != null)
{
TypeInfo[] pinfos = minfo.getParameterTypes();
Object[] params = getParameters(trace, cl, pinfos, parameters);
joinPoint.setArguments(params);
}
return joinPoint;
}
// Find the constructor
ConstructorJoinpoint joinPoint = findConstructor(trace, info, metaData, beanMetaData);
ConstructorInfo cinfo = joinPoint.getConstructorInfo();
// Set the parameters
if (cinfo != null)
{
TypeInfo[] pinfos = cinfo.getParameterTypes();
Object[] params = getParameters(trace, cl, pinfos, metaData.getParameters());
joinPoint.setArguments(params);
}
return joinPoint;
}
// Default constructor