//--------------------------------------------------------------------------
public void start()
{
String serviceType = getClass().getName();
ClusterManager clm = getMessageBroker().getClusterManager();
super.start();
/*
* For any destinations which are not using broadcast mode,
* we need to init the remote subscriptions. First we send out
* the requestSubscription messages, then we wait for the sendSubscriptions
* messages to come in.
*/
for (Iterator it = destinations.keySet().iterator(); it.hasNext(); )
{
String destName = (String) it.next();
MessageDestination dest = (MessageDestination) getDestination(destName);
if (!dest.getServerSettings().isBroadcastRoutingMode() && dest.isClustered())
initRemoteSubscriptions(destName);
}
/* Now go through and wait for the response to these messages... */
for (Iterator it = destinations.keySet().iterator(); it.hasNext(); )
{
String destName = (String) it.next();
MessageDestination dest = (MessageDestination) getDestination(destName);
if (!dest.getServerSettings().isBroadcastRoutingMode() && dest.isClustered())
{
List members = clm.getClusterMemberAddresses(serviceType, destName);
for (int i = 0; i < members.size(); i++)
{
Object addr = members.get(i);
if (!clm.getLocalAddress(serviceType, destName).equals(addr))
{
RemoteSubscriptionManager subMgr = dest.getRemoteSubscriptionManager();
subMgr.waitForSubscriptions(addr);
}
}