/**
* Resolves the given URI to an endpoint
*/
public Endpoint getEndpoint(String uri) {
Endpoint answer;
synchronized (endpoints) {
answer = endpoints.get(uri);
if (answer == null) {
try {
// Use the URI prefix to find the component.
String splitURI[] = ObjectHelper.splitOnCharacter(uri, ":", 2);
if (splitURI[1] != null) {
String scheme = splitURI[0];
Component component = getComponent(scheme);
// Ask the component to resolve the endpoint.
if (component != null) {
// Have the component create the endpoint if it can.
answer = component.createEndpoint(uri);
}
}
if (answer == null) {
answer = createEndpoint(uri);
}
// If it's a singleton then auto register it.
if (answer != null && answer.isSingleton()) {
startServices(answer);
endpoints.put(uri, answer);
lifecycleStrategy.onEndpointAdd(answer);
}
} catch (Exception e) {