Package org.apache.geronimo.monitoring

Examples of org.apache.geronimo.monitoring.MasterRemoteControlLocal


        // ensure that there is a 'monitoring' directory
        ensureMonitorDir();
        // get any saved mbean names from snapshot-config.xml
        ArrayList<String> mbeanNames = SnapshotConfigXMLBuilder.getMBeanNames();
        // get a handle on the mrc
        MasterRemoteControlLocal mrc = getMRC(username, password);
        // in the case where nothing is present, grab a set of default mbeans
        if(mbeanNames.size() <= 0) {
            mbeanNames = getDefaultMBeanList(mrc);
        }
        // turn on all stats in the list
        setStatsOn(mbeanNames, mrc);
        try {
            // take a snapshot
            log.info("======SNAPSHOT======");
            // instantiate map <mbean name, stats for mbean>
            HashMap<String, HashMap<String, Long>> aggregateStats = new HashMap<String, HashMap<String, Long>>();
            // for each mbean name in the list, get its stats
            for(int i = 0; i < mbeanNames.size(); i++) {
                String mbeanName = mbeanNames.get(i);
                HashMap<String, Long> stats = (HashMap<String, Long>)mrc.getStats(mbeanName);
                aggregateStats.put(mbeanName, stats);
            }
           
            // store the data in a DB
            (new SnapshotDBHelper()).addSnapshotToDB(aggregateStats);
View Full Code Here


        props.setProperty(Context.SECURITY_PRINCIPAL, username);
        props.setProperty(Context.SECURITY_CREDENTIALS, password);
        props.setProperty("openejb.authentication.realmName", "geronimo-admin");
        try {
            Context ic = new InitialContext(props);
            MasterRemoteControlLocal mrc = (MasterRemoteControlLocal)ic.lookup("ejb/mgmt/MRCLocal");
            return mrc;
        } catch(Exception e) {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.monitoring.MasterRemoteControlLocal

Copyright © 2018 www.massapicom. 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.