Package com.sun.enterprise.admin.event

Examples of com.sun.enterprise.admin.event.MonitoringEvent


       
        // 1. create MonitorCommand
        CommandMapper cm = CommandMapper.getInstance(instanceName);
        MonitorGetCommand command  = cm.mapGetCommand(dottedName)//throws InvalidDottedNameException
        // 2. create correspondent MonitoringEvent
        MonitoringEvent event = new MonitoringEvent(instanceName, dottedName, MonitoringEvent.GET_MONITOR_DATA, command);
        // 3. send/receive event to instance
        AdminEventResult result = AdminEventMulticaster.multicastEvent(event);
        // 4. analyse the result
        if(!result.getResultCode().equals(result.SUCCESS))
        {
            handleMonitoringError(result, instanceName, dottedName);
        }
        // 5. extract result list
        return (AttributeList)result.getAttribute(event.getEffectiveDestination(), MonitorCommand.MONITOR_RESULT);
    }
View Full Code Here


       
        // 1. create MonitorCommand
        CommandMapper cm = CommandMapper.getInstance(instanceName);
        MonitorListCommand command  = cm.mapListCommand(dottedName)//throws InvalidDottedNameException
        // 2. create correspondent MonitoringEvent
        MonitoringEvent event = new MonitoringEvent(instanceName, dottedName, MonitoringEvent.LIST_MONITORABLE, command);
        // 3. send/receive event to instance
        AdminEventResult result = AdminEventMulticaster.multicastEvent(event);
        // 4. analyse the result
        if(!result.getResultCode().equals(result.SUCCESS))
        {
            handleMonitoringError(result, instanceName, dottedName);
        }
        // 5. extract result list
        return (String[])result.getAttribute(event.getEffectiveDestination(), MonitorCommand.MONITOR_RESULT);
    }
View Full Code Here

       
        // 1. create MonitorCommand
        CommandMapper cm = CommandMapper.getInstance(instanceName);
        MonitorSetCommand command  = cm.mapSetCommand(dottedName, value)//throws InvalidDottedNameException
        // 2. create correspondent MonitoringEvent
        MonitoringEvent event = new MonitoringEvent(instanceName, dottedName, MonitoringEvent.SET_MONITOR_DATA, command);
        // 3. send/receive event to instance
        AdminEventResult result = AdminEventMulticaster.multicastEvent(event);
        // 4. analyse the result
        if(!result.getResultCode().equals(result.SUCCESS))
        {
            handleMonitoringError(result, instanceName, dottedName);
        }
        // 5. extract result list
        AttributeList resultList = null;
        AttributeList tmp = (AttributeList)result.getAttribute(event.getEffectiveDestination(), MonitorCommand.MONITOR_RESULT);
        Iterator it = tmp.iterator();
        while (it.hasNext())
        {
            Attribute attribute = (Attribute) it.next();
            resultList = (AttributeList)attribute.getValue();
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.event.MonitoringEvent

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.