Examples of IRemoteCacheServiceAdmin


Examples of org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheServiceAdmin

                //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;

            }
            catch ( Exception ex )
            {
                log.error( ex );
View Full Code Here

Examples of org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheServiceAdmin

            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 );
                }
View Full Code Here

Examples of org.apache.stratum.jcs.auxiliary.remote.behavior.IRemoteCacheServiceAdmin

                //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 );
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.