public String getDynamicEndpoint(String key) throws Exception {
final Lock lock = getLock();
try {
lock.lock();
SynapseConfiguration synConfig = getSynapseConfiguration();
Registry registry = synConfig.getRegistry();
if (registry != null) {
if (registry.getRegistryEntry(key).getType() == null) {
handleFault("No resource is available by the key '" + key + "'", null);
}
} else {
handleFault("Unable to access the registry instance for the ESB", null);
}
OMElement e = null;
if (registry != null) {
e = (OMElement) registry.getResource(new Entry(key), synConfig.getProperties());
}
if (e != null) {
if (log.isDebugEnabled()) {
log.debug("Found dynamic endpoint " + key);
}