* @return - the EndpointRegistry containing the Endpoint with the supplied URI - null if no
* such EndpointRegistry can be found
*/
private EndpointRegistry getEndpointRegistry(String uri) {
ExtensionPointRegistry registry = null;
EndpointRegistry endpointRegistry = null;
CompositeContext context = CompositeContext.getCurrentCompositeContext();
if( context == null && requestEndpoint != null ) context = requestEndpoint.getCompositeContext();
if( context != null ) {
registry = context.getExtensionPointRegistry();
endpointRegistry = getEndpointRegistry( registry );
if( endpointRegistry != null ) {
this.registry = registry;
return endpointRegistry;
} // end if
} // end if
// Deal with the case where there is no context available
for( NodeFactory factory : NodeFactory.getNodeFactories() ) {
registry = factory.getExtensionPointRegistry();
if( registry != null ) {
// Find the actual Endpoint in the EndpointRegistry
endpointRegistry = getEndpointRegistry( registry );
if( endpointRegistry != null ) {
for( Endpoint endpoint : endpointRegistry.findEndpoint(uri) ) {
// TODO: For the present, simply return the first registry with a matching endpoint
this.registry = registry;
return endpointRegistry;
} // end for
} // end if