* Create the async callback endpoint for a reference that is going to invoke an asyncInvocation service
* @param epr - the RuntimeEndpointReference for which the callback is created
* @return - a RuntimeEndpoint representing the callback endpoint
*/
private RuntimeEndpoint createAsyncCallbackEndpoint(RuntimeEndpointReference epr) {
CompositeContext compositeContext = epr.getCompositeContext();
RuntimeAssemblyFactory assemblyFactory = getAssemblyFactory(compositeContext);
RuntimeEndpoint endpoint = (RuntimeEndpoint)assemblyFactory.createEndpoint();
endpoint.bind(compositeContext);
// Create a pseudo-component and pseudo-service
// - need to end with a chain with an invoker into the AsyncCallbackHandler class
RuntimeComponent fakeComponent = null;
try {
fakeComponent = (RuntimeComponent)epr.getComponent().clone();
applyImplementation(fakeComponent);
} catch (CloneNotSupportedException e2) {
// will not happen
} // end try
endpoint.setComponent(fakeComponent);
// Create pseudo-service
ComponentService service = assemblyFactory.createComponentService();
ExtensionPointRegistry registry = compositeContext.getExtensionPointRegistry();
FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
JavaInterfaceFactory javaInterfaceFactory =
(JavaInterfaceFactory)modelFactories.getFactory(JavaInterfaceFactory.class);
JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
try {