public void process(RuntimeEndpointReference endpointReference) {
if(!(endpointReference instanceof RuntimeEndpointReference)) {
return;
}
RuntimeEndpointReference epr = (RuntimeEndpointReference) endpointReference;
Contract contract = epr.getReference();
if (!(contract instanceof RuntimeComponentReference)) {
return;
}
RuntimeComponent component = (RuntimeComponent) epr.getComponent();
if (component == null) {
return;
}
Implementation implementation = component.getImplementation();
if (!(implementation instanceof JavaImplementation)) {
return;
}
JavaImplementation javaImpl = (JavaImplementation)implementation;
Endpoint callbackEndpoint = epr.getCallbackEndpoint();
if (callbackEndpoint != null) {
Interface iface = callbackEndpoint.getService().getInterfaceContract().getInterface();
if (!supportsCallbackInterface(iface, javaImpl)) {
// callback to this impl is not possible, so ensure a callback object is set
for (InvocationChain chain : epr.getInvocationChains()) {
chain.addInterceptor(Phase.REFERENCE, new CallbackInterfaceInterceptor());
}
}
}
}