Examples of MyService


Examples of org.apache.camel.osgi.test.MyService

    public void camelContextFactoryServiceRegistryTest() throws Exception {
        CamelContextFactory factory = new CamelContextFactory();
        factory.setBundleContext(getBundleContext());
        DefaultCamelContext context = factory.createContext();
        context.start();
        MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
        assertNotNull("MyService should not be null", myService);
       
        Object service = context.getRegistry().lookup(MyService.class.getName());
        assertNotNull("MyService should not be null", service);
       
View Full Code Here

Examples of org.apache.camel.osgi.test.MyService

        factoryBean.setBundleContext(getBundleContext());
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/osgi/camelContext.xml");
        factoryBean.setApplicationContext(applicationContext);
        DefaultCamelContext context = factoryBean.getContext();
        context.start();
        MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
        assertNotNull("MyService should not be null", myService);
       
        Object service = context.getRegistry().lookup(MyService.class.getName());
        assertNotNull("MyService should not be null", service);
       
View Full Code Here

Examples of org.apache.camel.osgi.test.MyService

    public void camelContextFactoryServiceRegistryTest() throws Exception {
        CamelContextFactory factory = new CamelContextFactory();
        factory.setBundleContext(getBundleContext());
        DefaultCamelContext context = factory.createContext();
        context.start();
        MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
        assertNotNull("MyService should not be null", myService);
       
        Object service = context.getRegistry().lookup(MyService.class.getName());
        assertNotNull("MyService should not be null", myService);
       
View Full Code Here

Examples of org.apache.camel.osgi.test.MyService

        factoryBean.setBundleContext(getBundleContext());
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/osgi/camelContext.xml");
        factoryBean.setApplicationContext(applicationContext);
        DefaultCamelContext context = factoryBean.getContext();
        context.start();
        MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
        assertNotNull("MyService should not be null", myService);
       
        Object service = context.getRegistry().lookup(MyService.class.getName());
        assertNotNull("MyService should not be null", myService);
       
View Full Code Here

Examples of org.apache.camel.osgi.test.MyService

   
    public Object getService(ServiceReference reference) {       
        String[] classNames = (String[]) reference.getProperty(Constants.OBJECTCLASS);
        System.out.println("The class name is " + classNames[0]);
        if (classNames[0].equals("org.apache.camel.osgi.test.MyService")) {
            return new MyService();
        } else {
            return null;
        }   
    }
View Full Code Here

Examples of org.apache.camel.osgi.test.MyService

    @Test
    public void osigServiceRegistryTest() {
        CamelContextFactory factory = new CamelContextFactory();
        factory.setBundleContext(getBundleContext());
        DefaultCamelContext context = factory.createContext();
        MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
        assertNotNull("MyService should not be null", myService);
    }
View Full Code Here

Examples of org.apache.camel.osgi.test.MyService

    public void camelContextFactoryServiceRegistryTest() throws Exception {
        CamelContextFactory factory = new CamelContextFactory();
        factory.setBundleContext(getBundleContext());
        DefaultCamelContext context = factory.createContext();
        context.start();
        MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
        assertNotNull("MyService should not be null", myService);
       
        Object service = context.getRegistry().lookup(MyService.class.getName());
        assertNotNull("MyService should not be null", myService);
       
View Full Code Here

Examples of org.apache.camel.osgi.test.MyService

        factoryBean.setBundleContext(getBundleContext());
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/osgi/camelContext.xml");
        factoryBean.setApplicationContext(applicationContext);
        DefaultCamelContext context = factoryBean.createContext();
        context.start();
        MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
        assertNotNull("MyService should not be null", myService);
       
        Object service = context.getRegistry().lookup(MyService.class.getName());
        assertNotNull("MyService should not be null", myService);
       
View Full Code Here

Examples of org.apache.camel.osgi.test.MyService

public class CamelMockBundleContext extends MockBundleContext {
   
    public Object getService(ServiceReference reference) {       
        String[] classNames = (String[]) reference.getProperty(Constants.OBJECTCLASS);       
        if (classNames[0].equals("org.apache.camel.osgi.test.MyService")) {
            return new MyService();
        } else {
            return null;
        }   
    }
View Full Code Here

Examples of org.apache.camel.osgi.test.MyService

    
    public void testOsigServiceRegistry() {
        CamelContextFactory factory = new CamelContextFactory();
        factory.setBundleContext(getBundleContext());
        DefaultCamelContext context = factory.createContext();
        MyService myService = context.getRegistry().lookup(MyService.class.getName(), MyService.class);
        assertNotNull("MyService should not be null", myService);
    }
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.