protected boolean isMetaDataAlreadyPresent(ClassInfo info, C annotation, BeanMetaData beanMetaData) { return beanMetaData.getConstructor() != null; }
protected boolean isMetaDataAlreadyPresent(ClassInfo info, Factory annotation, BeanMetaData beanMetaData) { return beanMetaData.getConstructor() != null; }
protected boolean isMetaDataAlreadyPresent(ConstructorInfo info, Constructor annotation, BeanMetaData beanMetaData) { return beanMetaData.getConstructor() != null; }
/** * Find a constructor * * @param trace whether trace is enabled * @param info the bean info * @param metaData the bean metadata * @return the constructor join point * @throws Exception for any error */ public static ConstructorJoinpoint findConstructor(boolean trace, BeanInfo info, BeanMetaData metaData) throws Exception { return findConstructor(trace, info, metaData.getConstructor()); }
protected boolean isMetaDataAlreadyPresent(MethodInfo info, FactoryMethod annotation, BeanMetaData beanMetaData) { if (info.isPublic() == false || info.isStatic() == false) throw new IllegalArgumentException("Method marked as @FactoryMethod must be public and static"); return beanMetaData.getConstructor() != null; }
public Joinpoint getConstructorJoinPoint(BeanMetaData metaData) throws Throwable { BeanInfo info = getBeanInfo(metaData); return getConstructorJoinPoint(info, metaData.getConstructor(), metaData); }
/** * Instantiate a bean * * @param config the kernel config * @param info the bean info * @param metaData the bean metadata * @return the instantiated object * @throws Throwable for any error */ public static Object instantiate(KernelConfig config, BeanInfo info, BeanMetaData metaData) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Instantiating info=" + info + " metaData=" + metaData); ConstructorMetaData constructor = null; if (metaData != null) constructor = metaData.getConstructor(); Joinpoint joinPoint = getConstructorJoinPoint(config, info, constructor, metaData); return joinPoint.dispatch(); }
@SuppressWarnings({"SynchronizationOnLocalVariableOrMethodParameter"}) public Object getBean(String name, Object[] parameters) throws BeansException { AbstractBeanFactory result = getBeanWithType(name, AbstractBeanFactory.class); ConstructorMetaData cmd = result.getConstructor(); BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Temp"); for (Object parameter : parameters) { builder.addConstructorParameter(null, parameter); } ConstructorMetaData tempCMD = builder.getBeanMetaData().getConstructor(); synchronized (result) { result.setConstructor(tempCMD); try { return createBean(result); } finally { result.setConstructor(cmd); } } }
Joinpoint joinPoint = configurator.getConstructorJoinPoint(info, metaData.getConstructor(), metaData, repositoryMetaData);