primayDefined = true;
failovers.add( rca.getRemoteHost() + ":" + rca.getRemotePort() );
RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca );
ICache ic = rcm.getCache( rca );
if ( ic != null )
{
noWaits.add( ic );
}
else
{
//p( "noWait is null" );
}
}
// GET HANDLE BUT DONT REGISTER A LISTENER FOR FAILOVERS
String failoverList = rca.getFailoverServers();
if ( failoverList != null )
{
StringTokenizer fit = new StringTokenizer( failoverList, "," );
int fCnt = 0;
while ( fit.hasMoreElements() )
{
fCnt++;
String server = ( String ) fit.nextElement();
failovers.add( server );
rca.setRemoteHost( server.substring( 0, server.indexOf( ":" ) ) );
rca.setRemotePort( Integer.parseInt( server.substring( server.indexOf( ":" ) + 1 ) ) );
RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca );
// add a listener if there are none, need to tell rca what number it is at
if ( ( !primayDefined && fCnt == 1 ) || noWaits.size() <= 0 )
{
ICache ic = rcm.getCache( rca );
if ( ic != null )
{
noWaits.add( ic );
}
else
{
//p( "noWait is null" );
}
}
}
// end while
}
// end if failoverList != null
rca.setFailovers( ( String[] ) failovers.toArray( new String[0] ) );
// if CLUSTER
}
else
if ( rca.getRemoteType() == rca.CLUSTER )
{
// REGISTER LISTENERS FOR EACH SYSTEM CLUSTERED CACHEs
StringTokenizer it = new StringTokenizer( rca.getClusterServers(), "," );
while ( it.hasMoreElements() )
{
//String server = (String)it.next();
String server = ( String ) it.nextElement();
//p( "tcp server = " + server );
rca.setRemoteHost( server.substring( 0, server.indexOf( ":" ) ) );
rca.setRemotePort( Integer.parseInt( server.substring( server.indexOf( ":" ) + 1 ) ) );
RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca );
rca.setRemoteType( rca.CLUSTER );
ICache ic = rcm.getCache( rca );
if ( ic != null )
{
noWaits.add( ic );
}
else