Object obj = Naming.lookup( registry );
if ( log.isDebugEnabled() )
{
log.debug( "server found" );
}
IRemoteCacheServiceAdmin admin = (IRemoteCacheServiceAdmin) obj;
try
{
admin.shutdown();
}
catch ( Exception ex )
{
log.error( "Problem calling shutdown.", ex );
}
log.debug( "done." );
System.exit( 0 );
}
// STATS
if ( args.length > 0 && args[0].toLowerCase().indexOf( "-stats" ) != -1 )
{
log.debug( "getting cache stats" );
try
{
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
{
System.out.println( admin.getStats().toString() );
log.debug( admin.getStats() );
}
catch ( Exception es )
{
log.error( es );
}