Package org.rioproject.sla

Examples of org.rioproject.sla.SLA


            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


    }

    @Override
    public String getDescription() {
        StringBuilder builder = new StringBuilder();
        SLA sla = getEvent().getSLA();
        builder.append(getEvent().getServiceElement().getName()).append(" on ");
        builder.append(getEvent().getHostAddress()).append(" SLA ");
        builder.append("\"").append(sla.getIdentifier()).append("\"").append(" ");
        builder.append(getStatus().toLowerCase()).append(", ");
        builder.append("value: ");
        double value = getEvent().getCalculable().getValue();
        if(value<1)
            builder.append(formatPercent(value));
View Full Code Here

     */
    public static void setThreadDeadlockDetector(ServiceElement sElem, MBeanServerConnection mbsc) {
        WatchDescriptor threadDeadlockDesc = getWatchDescriptor(sElem, ThreadDeadlockMonitor.ID);

        if(threadDeadlockDesc == null) {
            SLA sla = new SLA(ThreadDeadlockMonitor.ID, 0, 1);
            sla.setSlaPolicyHandler(SLAPolicyHandler.class.getName());
            threadDeadlockDesc = ThreadDeadlockMonitor.getWatchDescriptor();
            threadDeadlockDesc.setMBeanServerConnection(mbsc);
            sla.setWatchDescriptors(threadDeadlockDesc);
            sElem.getServiceLevelAgreements().addServiceSLA(sla);
        } else {
            threadDeadlockDesc.setMBeanServerConnection(mbsc);
        }
    }
View Full Code Here

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

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

        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,
View Full Code Here

        List<Resource> resources = new ArrayList<Resource>();
        InputStream is = null;
        for (ServiceHandle sh : serviceHandles) {
            for (Map.Entry<String, SLA> entry : sh.getSLAMap().entrySet()) {
                String watchID = entry.getKey();
                SLA sla = entry.getValue();
                try {
                    if (asFile) {
                        is = new FileInputStream(rule);
                    } else {
                        is = this.getClass().getClassLoader().getResourceAsStream(rule);
View Full Code Here

TOP

Related Classes of org.rioproject.sla.SLA

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.