Package org.rioproject.sla

Examples of org.rioproject.sla.ServiceLevelAgreements


                    tableItem = new ServiceAttributeTableItem();
                    tableItem.attributeDescription = new JLabel(value);
                    addMore = false;
                    break;
                case 5: /* System Requirements */
                    ServiceLevelAgreements sl = sElem.getServiceLevelAgreements();
                    SystemRequirements s = sl.getSystemRequirements();
                    tableItem = new ServiceAttributeTableItem();
                    if(s==null) {
                        value = NOT_DECLARED;
                        addMore = false;
                    } else {
View Full Code Here


        impl.addJAR("service.jar");
        impl.setCodebase("http://10.1.1.3:9000");
        String fdh = "org.rioproject.impl.fdh.LeaseFaultDetectionHandler";
        ServiceElement s1 = new ServiceElement(ServiceElement.ProvisionType.DYNAMIC,
                                               sbc,
                                               new ServiceLevelAgreements(),
                                               new ClassBundle[]{export1},
                                               new ClassBundle(fdh),
                                               impl);

        ClassBundle export2 = new ClassBundle("org.rioproject.service.Service");
        export2.addJAR("rio-api.jar");
        export2.addJAR("service-dl.jar");
        export2.setCodebase("http://10.1.1.3:9000");
        ServiceElement s2 = new ServiceElement(ServiceElement.ProvisionType.DYNAMIC,
                                               sbc,
                                               new ServiceLevelAgreements(),
                                               new ClassBundle[]{export2},
                                               new ClassBundle(fdh),
                                               impl);
        Assert.assertTrue("s1 equal s2 ? ", s1.equals(s2));
        Assert.assertTrue("s2 equal s1 ? ", s2.equals(s1));
View Full Code Here

            ((ServiceClassLoader)cl).addMetaData(p);
        }

        /* Add a boot-cookie, indicating that the JSB was booted by this utility */
        sbConfig.addInitParameter("org.rioproject.boot", BOOT_COOKIE);
        ServiceLevelAgreements sla = new ServiceLevelAgreements();
        /* Get the export codebase from the ClassLoader which loaded us. The
         * export codebase will be returned by the getURLs() method since
         * getURLs() is overridden to return configured export codebase
         */
        URL[] urls = ((URLClassLoader)loader).getURLs();
        if(urls.length==0)
            throw new RuntimeException("Unknown Export Codebase");

        ClassBundle exportBundle;
        String exportCodebase = urls[0].toExternalForm();
        if(!exportCodebase.startsWith("artifact:")) {
            if(exportCodebase.contains(".jar")) {
                int index = exportCodebase.lastIndexOf('/');
                if(index != -1)
                    exportCodebase = exportCodebase.substring(0, index+1);
            } else {
                throw new RuntimeException("Cannot determine export codebase from "+exportCodebase);
            }
            exportBundle = new ClassBundle("");
            exportBundle.setCodebase(exportCodebase);
            for (URL url : urls) {
                String jar = url.getFile();
                int index = jar.lastIndexOf('/');
                if (index != -1)
                    jar = jar.substring(1);
                exportBundle.addJAR(jar);
            }
        } else {
            exportBundle = new ClassBundle("");
            exportBundle.setArtifact(exportCodebase);
        }

        /* Default system threshold is the number of available processors.
         * Since the system threshold is the summation of all depletion oriented
         * resources, total utilization is =
         * (num_available_processors * cpu_utilization *  mem_utilization * diskspace_utilization) */
        double defaultSystemThreshold = Runtime.getRuntime().availableProcessors();
        double systemThreshold = (Double)config.getEntry(QOS_COMPONENT,
                                                         "systemThreshold",
                                                         double.class,
                                                         defaultSystemThreshold);
        sla.getSystemRequirements().addSystemThreshold(SystemRequirements.SYSTEM,
                                                       new ThresholdValues(0.0, systemThreshold));

        ServiceElement sElem = new ServiceElement(ServiceElement.ProvisionType.EXTERNAL,
                                                  sbConfig,
                                                  sla,
View Full Code Here

        if(sElem == null)
            throw new IllegalArgumentException("ServiceElement cannot be null");
        if(name == null)
            throw new IllegalArgumentException("name cannot be null");
        WatchDescriptor wDesc = null;
        ServiceLevelAgreements slas = sElem.getServiceLevelAgreements();
        for(SLA sla : slas.getServiceSLAs()) {
            WatchDescriptor[] wDescs = sla.getWatchDescriptors();
            for(WatchDescriptor wd : wDescs) {
                if(wd.getName().equals(name)) {
                    wDesc = wd;
                    break;
View Full Code Here

     * returned. A new array is allocated each time.
     *
     */
    public static PlatformCapability[] getMatchedPlatformCapabilities(ServiceElement sElem,
                                                                      PlatformCapability[] pCaps) {
        ServiceLevelAgreements slas = sElem.getServiceLevelAgreements();
        SystemComponent[] requirements = slas.getSystemRequirements().getSystemComponents();
        List<PlatformCapability> list = new ArrayList<PlatformCapability>();
        if(requirements.length >= 0) {
            /*
             * Iterate through all resource PlatformCapability objects to
             * determine which ones support our declared requirements
View Full Code Here

        if(matchOpSys) {
            operatingSystems = new String[]{"Mac OS X", "Windows", "Linux"};
        } else {
            operatingSystems = new String[]{"ES/390", "Ubuntu"};
        }
        ServiceLevelAgreements slas = new ServiceLevelAgreements();
        SystemRequirements systemRequirements = new SystemRequirements();
        for (String architecture : architectures) {
            SystemComponent systemComponent = new SystemComponent(ProcessorArchitecture.ID,
                                                                  ProcessorArchitecture.class.getName());
            systemComponent.put(ProcessorArchitecture.ARCHITECTURE, architecture);
            systemRequirements.addSystemComponent(systemComponent);
        }
        for (String opSys : operatingSystems) {
            SystemComponent operatingSystem = new SystemComponent(OperatingSystem.ID, OperatingSystem.class.getName());
            operatingSystem.put(OperatingSystem.NAME, opSys);
            systemRequirements.addSystemComponent(operatingSystem);
        }
        slas.setServiceRequirements(systemRequirements);
        return slas;
    }
View Full Code Here

        slas.setServiceRequirements(systemRequirements);
        return slas;
    }

    ServiceLevelAgreements createClusterServiceLevelAgreements(boolean exclude, String... addresses) throws UnknownHostException {
        ServiceLevelAgreements slas = new ServiceLevelAgreements();
        SystemRequirements systemRequirements = new SystemRequirements();
        slas.setServiceRequirements(systemRequirements);
        for(String address : addresses) {
            SystemComponent cluster = new SystemComponent(TCPConnectivity.ID);
            cluster.put(TCPConnectivity.HOST_ADDRESS, address);
            cluster.setExclude(exclude);
            systemRequirements.addSystemComponent(cluster);
View Full Code Here

        /* ------------------------------------------*
       *  SLA Update Processing
       * ------------------------------------------*/

        /* Get the new SLAs */
        ServiceLevelAgreements slas = postElem.getServiceLevelAgreements();
        /* Modify service SLAs */
        serviceBeanSLAManager.updateSLAs(slas.getServiceSLAs());

        /* --- End SLA Update Processing ---*/

        /* --- Update Logging --- */
        if (ServiceElementUtil.hasDifferentLoggerConfig(preElem, postElem)) {
View Full Code Here

     * @return The ServiceLevelAgreements object defines system and service level
     * objectives that are to be monitored, metered and acted on by policy handlers
     */
    public ServiceLevelAgreements getServiceLevelAgreements() {
        if(slAgreements==null)
            slAgreements=new ServiceLevelAgreements();
        return slAgreements;
    }
View Full Code Here

     * then the provided ResourceCapability supports the Qualitative
     * Requirements specified by the ServiceBean
     */
    Collection<SystemComponent> meetsQualitativeRequirements(final ProvisionRequest request) {
        ServiceElement sElem = request.getServiceElement();
        ServiceLevelAgreements sla = sElem.getServiceLevelAgreements();
        SystemComponent[] serviceRequirements = sla.getSystemRequirements().getSystemComponents();
        List<SystemComponent> unsupportedRequirements = new ArrayList<SystemComponent>();
        /*
         * If there are no PlatformCapability requirements we can return
         * successfully
         */
 
View Full Code Here

TOP

Related Classes of org.rioproject.sla.ServiceLevelAgreements

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.