sc.invoke(deston, "start", new Object[0], new String[0]);
}
public void undeployDestination(boolean isQueue, String name) throws Exception
{
ObjectName pattern =
new ObjectName("*:service=" + (isQueue ? "Queue" : "Topic") + ",name=" + name);
Set s = sc.query(pattern);
int size = s.size();
if (size == 0)
{
log.debug("No such " + (isQueue ? "queue" : "topic") + " to undeploy: " + name);
return;
}
if (size > 1)
{
throw new Exception("Too many destination with the same name: " + name);
}
ObjectName destinationObjectName = (ObjectName)s.iterator().next();
sc.invoke(destinationObjectName, "stop", new Object[0], new String[0]);
sc.invoke(destinationObjectName, "destroy", new Object[0], new String[0]);
sc.unregisterService(destinationObjectName);
}