public <T> T createProxy(final Class<T> interfaze, Invocable invocable) throws ProxyCreationException {
if (invocable instanceof RuntimeEndpoint) {
Enhancer enhancer = new Enhancer();
enhancer.setSuperclass(interfaze);
enhancer.setCallback(new CglibMethodInterceptor<T>(interfaze, invocable));
Object proxy = enhancer.create();
return interfaze.cast(proxy);
}
ServiceReference<T> serviceReference = new ServiceReferenceImpl(interfaze, invocable, null);
return createProxy(serviceReference);
}