private void saveDynamicEndpointTemplate(String key, OMElement endpointTempalteEl) throws AxisFault {
final Lock lock = getLock();
try {
lock.lock();
SynapseConfiguration synConfig = getSynapseConfiguration();
Registry registry = synConfig.getRegistry();
if (registry != null) {
if (registry.getRegistryEntry(key).getType() == null) {
handleException("Unable to save the template. No resource is available " +
"by the key '" + key + "'");
}
registry.updateResource(key, endpointTempalteEl);
} else {
handleException("Unable to access the registry instance for the ESB");
}
} finally {
lock.unlock();