Package org.apache.hivemind

Examples of org.apache.hivemind.Registry


    public void testIntTranslator() throws Exception
    {
        interceptLogging();

        Registry r = buildFrameworkRegistry("IntTranslator.xml");

        List l = r.getConfiguration("hivemind.test.config.IntTranslator");

        // Convert the proxy into a real list.

        l.size();
View Full Code Here


*/
public class TestRegistryShutdownListenerServices extends HiveMindTestCase
{
    private void executeShutdownListenerTest(String type) throws Exception
    {
        Registry registry = buildFrameworkRegistry("ShutdownListenerServices.xml");
        Simple simple = (Simple) registry.getService("hivemind.lib.test."
                + type + "Simple", Simple.class);
        final Counter counter = new Counter();
        simple.setCounter(counter);
        registry.shutdown();
        assertEquals(1, counter.getValue());
    }
View Full Code Here

        executeShutdownListenerTest("primitiveAuto");       
    }
   
    public void testSingletonBeanRegistryShutdownListener() throws Exception
    {
        Registry registry = buildFrameworkRegistry("ShutdownListenerServices.xml");
        RegistryShutdownBean bean = ( RegistryShutdownBean )registry.getService( "hivemind.lib.test.registryShutdownBeanSingleton", RegistryShutdownBean.class );
        bean.someMethod();
    }
View Full Code Here

        bean.someMethod();
    }

    public void testThreadedBeanRegistryShutdownListener() throws Exception
    {
        Registry registry = buildFrameworkRegistry("ShutdownListenerServices.xml");
        RegistryShutdownBean bean = ( RegistryShutdownBean )registry.getService( "hivemind.lib.test.registryShutdownBeanThreaded", RegistryShutdownBean.class );
        bean.someMethod();
    }
View Full Code Here

        RegistryShutdownBean bean = ( RegistryShutdownBean )registry.getService( "hivemind.lib.test.registryShutdownBeanThreaded", RegistryShutdownBean.class );
        bean.someMethod();
    }
    public void testPooledBeanRegistryShutdownListener() throws Exception
    {
        Registry registry = buildFrameworkRegistry("ShutdownListenerServices.xml");
        RegistryShutdownBean bean = ( RegistryShutdownBean )registry.getService( "hivemind.lib.test.registryShutdownBeanPooled", RegistryShutdownBean.class );
        bean.someMethod();
    }
View Full Code Here

        RegistryShutdownBean bean = ( RegistryShutdownBean )registry.getService( "hivemind.lib.test.registryShutdownBeanPooled", RegistryShutdownBean.class );
        bean.someMethod();
    }
    public void testPrimitiveBeanRegistryShutdownListener() throws Exception
    {
        Registry registry = buildFrameworkRegistry("ShutdownListenerServices.xml");
        RegistryShutdownBean bean = ( RegistryShutdownBean )registry.getService( "hivemind.lib.test.registryShutdownBeanPrimitive", RegistryShutdownBean.class );
        bean.someMethod();
    }
View Full Code Here

public class PanoramaMain
{

    public static void main(String[] args)
    {
        Registry registry = RegistryBuilder.constructDefaultRegistry();

        registry.shutdown();
    }
View Full Code Here

public class LoggingMain
{

    public static void main(String[] args)
    {
        Registry registry = RegistryBuilder.constructDefaultRegistry();

        TargetService service = (TargetService) registry.getService(TargetService.class);

        System.out.println("\n*** Void method (no return value):\n");

        service.voidMethod("Hello");

View Full Code Here

    public static void main(String[] args)
    {
        double arg0 = Double.parseDouble(args[0]);
        double arg1 = Double.parseDouble(args[1]);

        Registry registry = RegistryBuilder.constructDefaultRegistry();

        // Since we know there's exactly *one* service-point implementing
        // Calculator,
        // we can get it this way, and never have to know its service id.

        Calculator calculator = (Calculator) registry.getService(Calculator.class);

        System.out.println("Inputs:   " + arg0 + " and " + arg1);
        System.out.println("Add:      " + calculator.add(arg0, arg1));
        System.out.println("Subtract: " + calculator.subtract(arg0, arg1));
        System.out.println("Multiply: " + calculator.multiply(arg0, arg1));
        System.out.println("Divide:   " + calculator.divide(arg0, arg1));

        registry.shutdown();
    }
View Full Code Here

        }
    }

    public void testModuleDescriptor() throws Exception
    {
        Registry r = buildFrameworkRegistry("DefaultImplementationBuilder.xml");

        DefaultImplementationBuilder dib =
            (DefaultImplementationBuilder) r.getService(
                "hivemind.lib.DefaultImplementationBuilder",
                DefaultImplementationBuilder.class);

        setupModule();
View Full Code Here

TOP

Related Classes of org.apache.hivemind.Registry

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.