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