this.proxyFactory = proxyFactory;
final Class<T> delegationType = delegate.getComponentImplementation();
this.isCompatible = type.isAssignableFrom(delegationType);
if (!isCompatible) {
if (!proxyFactory.canProxy(type)) {
throw new PicoCompositionException("Cannot create proxy for type " + type.getName());
}
final Method[] methods = type.getMethods();
for (final Method method : methods) {
try {
delegationType.getMethod(method.getName(), method.getParameterTypes());
} catch (final NoSuchMethodException e) {
throw new PicoCompositionException("Cannot create proxy for type "
+ type.getName()
+ ", because of incompatible method "
+ method.toString());
}
}