Package org.apache.camel.core.osgi.test

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


    }

    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 if (classNames[0].equals(ComponentResolver.class.getName())) {
            return new ComponentResolver() {
                public Component resolveComponent(String name, CamelContext context) throws Exception {
                    if (name.equals("file_test")) {
                        return new FileComponent();
View Full Code Here


    }

    public Object getService(ServiceReference reference) {
        String[] classNames = (String[]) reference.getProperty(Constants.OBJECTCLASS);       
        if (classNames[0].equals("org.apache.camel.core.osgi.test.MyService")) {
            return new MyService();
        } else if (classNames[0].equals(ComponentResolver.class.getName())) {
            return new ComponentResolver() {
                public Component resolveComponent(String name, CamelContext context) throws Exception {
                    if (name.equals("file_test")) {
                        return new FileComponent();
View Full Code Here

    @Test
    public void camelContextFactoryServiceRegistryTest() throws Exception {
       
        DefaultCamelContext context = new OsgiDefaultCamelContext(getBundleContext());
        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

    }

    public Object getService(@SuppressWarnings("rawtypes") ServiceReference reference) {
        String[] classNames = (String[]) reference.getProperty(Constants.OBJECTCLASS);       
        if (classNames[0].equals("org.apache.camel.core.osgi.test.MyService")) {
            return new MyService();
        } else if (classNames[0].equals(ComponentResolver.class.getName())) {
            return new ComponentResolver() {
                public Component resolveComponent(String name, CamelContext context) throws Exception {
                    if (name.equals("file_test")) {
                        return new FileComponent();
View Full Code Here

    @Test
    public void camelContextFactoryServiceRegistryTest() throws Exception {
        DefaultCamelContext context = new OsgiDefaultCamelContext(getBundleContext());
        context.start();

        MyService myService = context.getRegistry().lookupByNameAndType(MyService.class.getName(), MyService.class);
        assertNotNull("MyService should not be null", myService);
       
        myService = context.getRegistry().lookupByNameAndType("test", MyService.class);
        assertNull("We should not get the MyService Object here", myService);
View Full Code Here

    }

    public Object getService(ServiceReference reference) {
        String[] classNames = (String[]) reference.getProperty(Constants.OBJECTCLASS);       
        if (classNames[0].equals("org.apache.camel.core.osgi.test.MyService")) {
            return new MyService();
        } else if (classNames[0].equals(ComponentResolver.class.getName())) {
            return new ComponentResolver() {
                public Component resolveComponent(String name, CamelContext context) throws Exception {
                    if (name.equals("file_test")) {
                        return new FileComponent();
View Full Code Here

    }

    public Object getService(ServiceReference reference) {
        String[] classNames = (String[]) reference.getProperty(Constants.OBJECTCLASS);       
        if (classNames[0].equals("org.apache.camel.core.osgi.test.MyService")) {
            return new MyService();
        } else if (classNames[0].equals(ComponentResolver.class.getName())) {
            return new ComponentResolver() {
                public Component resolveComponent(String name, CamelContext context) throws Exception {
                    if (name.equals("file_test")) {
                        return new FileComponent();
View Full Code Here

    @Test
    public void camelContextFactoryServiceRegistryTest() throws Exception {
       
        DefaultCamelContext context = new OsgiDefaultCamelContext(getBundleContext());
        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

TOP

Related Classes of org.apache.camel.core.osgi.test.MyService

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.