public synchronized void unregisterConnectionFactory(String uniqueName, boolean supportsFailover, boolean supportsLoadBalancing)
throws Exception
{
log.trace("ConnectionFactory " + uniqueName + " being unregistered");
ServerConnectionFactoryEndpoint endpoint =
(ServerConnectionFactoryEndpoint)endpoints.remove(uniqueName);
if (endpoint == null)
{
throw new IllegalArgumentException("Cannot find endpoint with name " + uniqueName);
}
JNDIBindings jndiBindings = endpoint.getJNDIBindings();
if (jndiBindings != null)
{
List jndiNames = jndiBindings.getNames();
for(Iterator i = jndiNames.iterator(); i.hasNext(); )
{
String jndiName = (String)i.next();
initialContext.unbind(jndiName);
log.debug(jndiName + " unregistered");
}
}
if (trace) { log.trace("Removing delegate from delegates list with key=" + uniqueName + " at serverPeerID=" + this.serverPeer.getServerPeerID()); }
ConnectionFactoryDelegate delegate = (ConnectionFactoryDelegate)delegates.remove(uniqueName);
if (delegate == null)
{
throw new IllegalArgumentException("Cannot find factory with name " + uniqueName);
}
if (replicator != null)
{
replicator.remove(Replicator.CF_PREFIX + uniqueName);
}
Dispatcher.instance.unregisterTarget(endpoint.getID(), endpoint);
serverPeer.getConnectionManager().unregisterConnectionFactory(endpoint);
}