Examples of SLAThresholdEvent


Examples of org.rioproject.sla.SLAThresholdEvent

        if(event instanceof ServiceLogEvent) {
            ServiceLogEvent sle = (ServiceLogEvent)event;
            remoteServiceEventNode = new ServiceLogEventNode(sle);
        }
        if(event instanceof SLAThresholdEvent) {
            SLAThresholdEvent sla = (SLAThresholdEvent)event;
            remoteServiceEventNode = new SLAThresholdEventNode(sla);
        }
        return remoteServiceEventNode;
    }
View Full Code Here

Examples of org.rioproject.sla.SLAThresholdEvent

                    table.setRowHeight(tableData.size(), table.getRowHeight() * 20);
                }
            } else {
                String label = "SLAThresholdEvent."+eventNode.getValueAt(0);
                tableData.put("Event", label);
                SLAThresholdEvent slaEvent = (SLAThresholdEvent)event;
                StringBuilder builder = new StringBuilder();
                builder.append("low=").append(slaEvent.getSLA().getCurrentLowThreshold());
                builder.append(" high=").append(slaEvent.getSLA().getCurrentHighThreshold());
                tableData.put("When", Constants.DATE_FORMAT.format(event.getDate()));
                tableData.put("Deployment", slaEvent.getServiceElement().getOperationalStringName());
                tableData.put("Service", slaEvent.getServiceElement().getName());
                tableData.put("Machine", slaEvent.getHostAddress());
                tableData.put("Value", numberFormatter.format(slaEvent.getCalculable().getValue()));
                tableData.put("Threshold Values", builder.toString());
                tableData.put("Policy Handler", slaEvent.getSLAPolicyHandlerDescription());
            }
            this.fireTableDataChanged();
        }
View Full Code Here

Examples of org.rioproject.sla.SLAThresholdEvent

        boolean lowerBreachNotification() {
            return lowerBreachNotification;
        }

        public void notify(RemoteServiceEvent event) {
            SLAThresholdEvent slaEvent = (SLAThresholdEvent)event;
            SLA sla = slaEvent.getSLA();
            Calculable c = slaEvent.getCalculable();
            String type = slaEvent.getThresholdType().name();
            System.out.println(type+" current: "+c.getValue()+", low: " + sla.getLowThreshold() + ", high: " + sla.getHighThreshold());
            if(slaEvent.getThresholdType()== ThresholdType.BREACHED) {
                if(c.getValue()>sla.getHighThreshold())
                    upperBreachNotification = true;
                if(c.getValue()<sla.getLowThreshold())
                    lowerBreachNotification = true;
            }
View Full Code Here

Examples of org.rioproject.sla.SLAThresholdEvent

            };

            SLA sla = new SLA(calculable.getId(), range);
            try {
                ServiceBeanInstance instance = makeServiceBeanInstance();
                SLAThresholdEvent event = new SLAThresholdEvent(proxy,
                                                                context.getServiceElement(),
                                                                instance,
                                                                calculable,
                                                                sla,
                                                                "Cybernode Thread Deadlock " +
View Full Code Here

Examples of org.rioproject.sla.SLAThresholdEvent

        try {
            double[] range = new double[]{thresholdValues.getCurrentLowThreshold(),
                                          thresholdValues.getCurrentHighThreshold()};

            SLA sla = new SLA(calculable.getId(), range);
            SLAThresholdEvent event = new SLAThresholdEvent(instance.getService(),
                                                            serviceElement,
                                                            instance,
                                                            calculable,
                                                            sla,
                                                            serviceElement.getName()+" Resource Policy Handler",
View Full Code Here

Examples of org.rioproject.sla.SLAThresholdEvent

     */
    protected void sendSLAThresholdEvent(final Calculable calculable,
                                         final ThresholdValues tValues,
                                         final ThresholdType type) {
        try {
            SLAThresholdEvent event = new SLAThresholdEvent(eventSource,
                                                            context.getServiceElement(),
                                                            context.getServiceBeanManager().getServiceBeanInstance(),
                                                            calculable,
                                                            mySLA,
                                                            getDescription(),
View Full Code Here

Examples of org.rioproject.sla.SLAThresholdEvent

     */
    class SLAThresholdEventTask implements Runnable {
       public void run() {
            while (true) {
                try {
                    SLAThresholdEvent event = eventQ.take();
                    eventHandler.fire(event);
                } catch(InterruptedException e) {
                    /* */
                    break;
                } catch(Exception e) {
View Full Code Here

Examples of org.rioproject.sla.SLAThresholdEvent

     * @param event The SLAPolicyEvent
     */
    public void policyAction(SLAPolicyEvent event) {
        if(event == null)
            throw new IllegalArgumentException("event is null");
        SLAThresholdEvent slaThresholdEvent = event.getSLAThresholdEvent();
        if(slaThresholdEvent != null)
            buildAndSend(slaThresholdEvent);
    }
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.