Examples of Registry


Examples of org.apache.hivemind.Registry

     */
    public void testIntegration() throws Exception
    {
        Logger logger = Logger.getLogger("package1.logger1");

        Registry registry = buildFrameworkRegistry("testLogManagementMBean.xml");

        registry.getService(LogManagement.class);

        MBeanServer mbeanServer = (MBeanServer) registry.getService(MBeanServer.class);
        ObjectNameBuilder objectNameBuilder = (ObjectNameBuilder) registry
                .getService(ObjectNameBuilder.class);
        ObjectName objectName = objectNameBuilder.createObjectName(logger.getName(), "logger");

        ObjectInstance instance = mbeanServer.getObjectInstance(objectName);
        assertNotNull(instance);

        registry.shutdown();
    }
View Full Code Here

Examples of org.apache.hivemind.Registry

        verifyControls();
    }

    public void testWrongType() throws Exception
    {
        Registry r = buildFrameworkRegistry("WrongType.xml");

        interceptLogging();

        List l = r.getConfiguration("hivemind.test.rules.WrongType");

        // Convert the proxy into a real list; this will trigger the
        // expected errors.

        l.size();
View Full Code Here

Examples of org.apache.jetspeed.om.registry.Registry

            while (e.hasMoreElements())
            {
                String registryName = (String) e.nextElement();
                logAndPrint("Exporting Registry: " + registryName);
                Registry importRegistry = importerService.get(registryName);
                Registry exportRegistry = exporterService.get(registryName);

                Enumeration enum1 = exportRegistry.getEntries();
                while (enum1.hasMoreElements())
                {
                    RegistryEntry exportEntry = (RegistryEntry) enum1.nextElement();

                    if (registryName.equals(org.apache.jetspeed.services.Registry.SECURITY) ||
View Full Code Here

Examples of org.apache.karaf.shell.api.console.Registry

import static org.apache.karaf.shell.support.ansi.SimpleAnsi.INTENSITY_NORMAL;

public class HelpCommand implements Command {

    public HelpCommand(SessionFactory factory) {
        Registry registry = factory.getRegistry();
        registry.register(this);
        registry.register(new SimpleHelpProvider());
        registry.register(new CommandListHelpProvider());
        registry.register(new SingleCommandHelpProvider());
    }
View Full Code Here

Examples of org.apache.servicemix.jbi.framework.Registry

        writer.println("label = \"Apache ServiceMix flow\";");
        writer.println("node [style = \"rounded,filled\", fillcolor = yellow, fontname=\"Helvetica-Oblique\"];");
        writer.println();

        List brokerLinks = new ArrayList();
        Registry registry = getContainer().getRegistry();
        Collection components = registry.getComponents();
        for (Iterator iter = components.iterator(); iter.hasNext();) {
            ComponentMBeanImpl component = (ComponentMBeanImpl) iter.next();
            ServiceEndpoint[] ses = registry.getEndpointsForComponent(component.getComponentNameSpace());

            String name = component.getName();
            String id = encode(name);

            writer.println("subgraph cluster_" + id + " {");
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.registry.api.model.Registry

    }

    protected Registry populateRegistry(OWLOntology registry) throws RegistryContentException {

        log.debug("Populating registry content from ontology {}", registry);
        Registry reg = riFactory.createRegistry(registry);
        Set<OWLOntology> closure = registry.getOWLOntologyManager().getImportsClosure(registry);

        // Just scan all individuals. Recurse in case the registry imports more registries.
        for (OWLIndividual ind : registry.getIndividualsInSignature(true)) {
            // We do not allow anonymous registry items.
            if (ind.isAnonymous()) continue;
            RegistryItem item = null;
            // IRI id = ind.asOWLNamedIndividual().getIRI();
            Type t = RegistryUtils.getType(ind, closure);
            if (t == null) {
                log.warn("Undetermined type for registry ontology individual {}", ind);
                continue;
            }
            switch (t) {
                case LIBRARY:
                    log.debug("Found library for individual {}", ind);
                    // Create the library and attach to parent and children
                    item = populateLibrary(ind.asOWLNamedIndividual(), closure);
                    reg.addChild(item);
                    item.addRegistryContentListener(this);
                    break;
                case ONTOLOGY:
                    log.debug("Found ontology for individual {}", ind);
                    // Create the ontology and attach to parent
                    item = populateOntology(ind.asOWLNamedIndividual(), closure);
                    item.addRegistryContentListener(this);
                    // We don't know where to attach it within this method.
                    break;
                default:
                    break;
            }
        }
        try {
            reg.addRegistryContentListener(this);
            log.info("Registry {} added.", reg.getIRI());
            population.put(reg.getIRI(), reg);
        } catch (Exception e) {
            log.error("Invalid identifier for library item " + reg, e);
            return null;
        }
        return reg;
View Full Code Here

Examples of org.apache.synapse.registry.Registry

    public static Registry defineRegistry(SynapseConfiguration config, OMElement elem,
                                          Properties properties) {
        if (config.getRegistry() != null) {
            handleException("Only one remote registry can be defined within a configuration");
        }
        Registry registry = RegistryFactory.createRegistry(elem, properties);
        config.setRegistry(registry);
        return registry;
    }
View Full Code Here

Examples of org.apache.synapse.registry.Registry

        root.serialize(out);
        out.close();
    }

    public void testRegistry() throws Exception {
        Registry reg = new SimpleURLRegistry();
        Properties props = new Properties();
        props.put("root", "file:./");
        props.put("cachableDuration", "1500");
        reg.init(props);
        Entry prop = new Entry();
        prop.setType(Entry.REMOTE_ENTRY);
        prop.setKey(FILE);

        // initial load of file from registry
        assertEquals(TEXT_1, reg.getResource(prop, new Properties()).toString());

        // sleep 1 sec
        Thread.sleep(1000);
        assertEquals(TEXT_1, reg.getResource(prop, new Properties()).toString());

        // sleep another 1 sec, has expired in cache, but content hasnt changed
        Thread.sleep(1000);
        assertEquals(TEXT_1, reg.getResource(prop, new Properties()).toString());

        // the renewed cache should be valid for another 1.5 secs
        // change the file now and change next cache duration
        writeToFile(TEXT_2);
        props.put("cachableDuration", "100");
        reg.init(props);
        // still cached content should be available and valid
        assertEquals(TEXT_1, reg.getResource(prop, new Properties()).toString());

        // now sleep ~1 sec, still cache should be valid
        Thread.sleep(800);
        assertEquals(TEXT_1, reg.getResource(prop, new Properties()).toString());

        // sleep another 1 sec.. cache should expire and new content should be loaded
        Thread.sleep(1000);
        assertEquals(TEXT_2, reg.getResource(prop, new Properties()).toString());

        // change content back to original
        writeToFile(TEXT_1);

        // sleep for .5 sec, now the new content should be loaded as new expiry time
        // is .1 sec
        Thread.sleep(500);
        assertEquals(TEXT_1, reg.getResource(prop, new Properties()).toString());
    }
View Full Code Here

Examples of org.apache.synapse.registry.Registry

        Thread.sleep(500);
        assertEquals(TEXT_1, reg.getResource(prop, new Properties()).toString());
    }
   
    public void testLargeFile() throws Exception {
        Registry reg = new SimpleURLRegistry();
        Properties props = new Properties();
        props.put("root", "file:./");
        props.put("cachableDuration", "1500");
        reg.init(props);
       
        OMNode node = reg.lookup(FILE2);
        node.serialize(new NullOutputStream());
    }
View Full Code Here

Examples of org.apache.synapse.registry.Registry

                "<syn:parameter name=\"root\">file:./../../repository/</syn:parameter>" +
                "<syn:parameter name=\"cachableDuration\">15000</syn:parameter>" +
                "</syn:registry>";

        OMElement registryElement = createOMElement(regitryConfiguration);
        Registry registry = RegistryFactory.createRegistry(registryElement, new Properties());
        OMElement serializedElement = RegistrySerializer.serializeRegistry(null, registry);
        try {
            assertTrue(compare(registryElement, serializedElement));
        } catch (Exception e) {
            fail("Exception in test.");
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.