Package org.rioproject.entry

Examples of org.rioproject.entry.OperationalStringEntry


        jiniClient = new JiniClient(new LookupDiscoveryManager(groups, locators, null, config));
        ServiceTemplate monitors = new ServiceTemplate(null, new Class[]{ProvisionMonitor.class}, null);
        ServiceTemplate cybernodes = new ServiceTemplate(null, new Class[]{Cybernode.class}, null);
        ServiceTemplate eventCollectors = new ServiceTemplate(null,
                                                              new Class[]{EventCollector.class},
                                                              new Entry[]{new OperationalStringEntry(org.rioproject.config.Constants.CORE_OPSTRING)});

        sdm = new ServiceDiscoveryManager(jiniClient.getDiscoveryManager(), new LeaseRenewalManager(), config);

        ServiceWatcher watcher = new ServiceWatcher();
View Full Code Here


        Assert.assertNotNull(testManager);
        testManager.waitForService(JavaSpace05.class);
        ServiceItem[] items = testManager.getServiceItems(JavaSpace05.class);
        Assert.assertEquals(1, items.length);
        Name name = null;
        OperationalStringEntry operationalStringEntry = null;
        for(Entry entry : items[0].attributeSets) {
            logger.info(String.format("Found %s", entry.getClass().getName()));
            if(entry instanceof OperationalStringEntry) {
                operationalStringEntry = (OperationalStringEntry) entry;
            }
View Full Code Here

    public static boolean matches(Entry[] attrs, String opStringName) {
        boolean matched = false;
        for (Entry attr : attrs) {
            if (attr.getClass().getName().equals(OperationalStringEntry.class.getName())) {
                if (attr instanceof OperationalStringEntry) {
                    OperationalStringEntry oe = (OperationalStringEntry) attr;
                    if (oe.name.equals(opStringName)) {
                        logger.trace("Matched required {} with value of {}", oe.name, opStringName);
                        matched = true;
                        break;
                    } else {
                        logger.trace("Did not match required {} with value of {}", oe.name, opStringName);
                    }
                } else {
                    /*
                     * This addresses the issue where the discovered service
                     * has an OperationalStringEntry but there is a class loading
                     * problem, which results in the classes being loaded by sibling
                     * class loaders, and assignment does not work.
                     */
                    OperationalStringEntry oe = new OperationalStringEntry();
                    try {
                        Field name = attr.getClass().getDeclaredField("name");
                        oe.name = (String) name.get(attr);
                        if (oe.name.equals(opStringName)) {
                            logger.trace("Reflective matching: Matched required {} with value of {}", oe.name, opStringName);
View Full Code Here

                     * This addresses the issue wjere the discovered service
                     * has an OperationalStrine entry but there is a class loading
                     * problem, which results in the classes bing loaded by sibling
                     * class loaders, and assignability doesnt work.
                     */
                    OperationalStringEntry oe = new OperationalStringEntry();
                    try {
                        Field name = attrs[x].getClass().getDeclaredField("name");               
                        oe.name = (String)name.get(attrs[x]);
                    } catch(Exception e) {
                        e.printStackTrace();
View Full Code Here

        UUID uuid = UUID.randomUUID();
        ServiceID sid = new ServiceID(uuid.getMostSignificantBits(),
                                      uuid.getLeastSignificantBits());
        List<Entry> attributes = new ArrayList<Entry>();
        attributes.add(new Name("foo"));
        attributes.add(new OperationalStringEntry("bar"));
        if(versions!=null) {
            for(String version : versions)
                attributes.add(new VersionEntry(version));
        }
        return new ServiceItem(sid, new Object(), attributes.toArray(new Entry[attributes.size()]));
View Full Code Here

         * attributes the Joiner utility maintains
         */
        /* 2. Create and add OperationalStringEntry */
        String opStringName = context.getServiceElement().getOperationalStringName();
        if (opStringName != null)
            attrList.add(new OperationalStringEntry(opStringName));
        /* 3. Create and add ComputeResourceInfo */
        ComputeResourceInfo computeResourceInfo = new ComputeResourceInfo();
        computeResourceInfo.initialize(computeResource.getAddress());
        computeResourceInfo.hostName = computeResource.getHostName();
        attrList.add(computeResourceInfo);
View Full Code Here

TOP

Related Classes of org.rioproject.entry.OperationalStringEntry

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.