RuntimeComponentReference reference = (RuntimeComponentReference)endpointReference.getReference();
reference.setComponent((RuntimeComponent)endpointReference.getComponent());
Interface i = reference.getInterfaceContract().getInterface();
if (i instanceof JavaInterface) {
JavaInterface javaInterface = (JavaInterface)i;
if (javaInterface.isUnresolved()) {
// Allow privileged access to get ClassLoader. Requires RuntimePermission in
// security policy.
ClassLoader classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
});
javaInterface.setJavaClass(classLoader.loadClass(javaInterface.getName()));
JavaInterfaceFactory javaInterfaceFactory = getJavaInterfaceFactory(compositeContext);
try {
javaInterfaceFactory.createJavaInterface(javaInterface, javaInterface.getJavaClass());
} catch (InvalidInterfaceException e) {
throw new ServiceRuntimeException(e);
}
//FIXME: If the interface needs XSDs to be loaded (e.g., for static SDO),
// this needs to be done here. We usually search for XSDs in the current
// contribution at resolve time. Is it possible to locate the current
// contribution at runtime?
}
this.businessInterface = (Class<B>)javaInterface.getJavaClass();
}
Binding binding = endpointReference.getBinding();
if (binding != null) {
BindingBuilder bindingBuilder = builders.getBindingBuilder(binding.getType());