//if (debug) {
log.debug( "server found" );
//}
log.debug( "obj = " + obj );
IRemoteCacheServiceAdmin admin = ( IRemoteCacheServiceAdmin ) obj;
try
{
admin.shutdown( "", port );
}
catch ( Exception er )
{
// ignore the error
// the connection will be closed by the server
}
}
catch ( Exception ex )
{
log.error( ex );
}
log.debug( "done" );
System.exit( 0 );
}
// STATS
if ( args.length > 0 && args[0].toLowerCase().indexOf( "-stats" ) != -1 )
{
log.debug( "getting cache stats" );
try
{
int port = Registry.REGISTRY_PORT;
if ( args.length > 1 )
{
port = Integer.parseInt( args[1] );
}
String serviceName = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
String registry = "//:" + port + "/" + serviceName;
log.debug( "looking up server " + registry );
Object obj = Naming.lookup( registry );
log.debug( "server found" );
log.debug( "obj = " + obj );
IRemoteCacheServiceAdmin admin = ( IRemoteCacheServiceAdmin ) obj;
try
{
log.debug( admin.getStats() );
}
catch ( Exception es )
{
log.error( es );
}