Examples of Jsr181Endpoint


Examples of org.apache.servicemix.jsr181.Jsr181Endpoint

        return new ArrayList<Consumes>();
    }

    protected List<Provides> getProvides(Endpoint endpoint) {
        // We need to generate the dummy component to register the services
        Jsr181Endpoint jsr181Endpoint = (Jsr181Endpoint) endpoint;
        try {
            Jsr181Component componentDummy = new Jsr181Component();
            componentDummy.setEndpoints(new Jsr181Endpoint[] {jsr181Endpoint });
            componentDummy.getLifeCycle().init(new DummyComponentContext());
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.servicemix.jsr181.Jsr181Endpoint

   
    public void testProxy() throws Exception {
        container.start();

        Jsr181Component component1 = new Jsr181Component();
        Jsr181Endpoint endpoint1 = new Jsr181Endpoint();
        endpoint1.setPojo(new EchoService());
        component1.setEndpoints(new Jsr181Endpoint[] {endpoint1 });
        container.activateComponent(component1, "JSR181Component-1");
       
        Jsr181Component component2 = new Jsr181Component();
        Jsr181Endpoint endpoint2 = new Jsr181Endpoint();
        endpoint2.setPojo(new ProxyPojoService());
        endpoint2.setServiceInterface(ProxyPojo.class.getName());
        component2.setEndpoints(new Jsr181Endpoint[] {endpoint2 });
        container.activateComponent(component2, "JSR181Component-2");
       
        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
View Full Code Here

Examples of org.apache.servicemix.jsr181.Jsr181Endpoint

    public void testWithSpecifiedNamesWithAnnotations() throws Exception {
        QName svcName = new QName("svcUri", "service");
        QName itfName = new QName("itfUri", "interface");
        String epName = "endpoint";
        Jsr181SpringComponent component = new Jsr181SpringComponent();
        Jsr181Endpoint endpoint = new Jsr181Endpoint();
        endpoint.setService(svcName);
        endpoint.setInterfaceName(itfName);
        endpoint.setEndpoint(epName);
        endpoint.setPojo(new EchoService());
        component.setEndpoints(new Jsr181Endpoint[] { endpoint });
        container.activateComponent(component, "JSR181Component");
    }
View Full Code Here

Examples of org.apache.servicemix.jsr181.Jsr181Endpoint

    public void testWithSpecifiedNamesWithoutAnnotations() throws Exception {
        QName svcName = new QName("svcUri", "service");
        QName itfName = new QName("itfUri", "interface");
        String epName = "endpoint";
        Jsr181SpringComponent component = new Jsr181SpringComponent();
        Jsr181Endpoint endpoint = new Jsr181Endpoint();
        endpoint.setService(svcName);
        endpoint.setInterfaceName(itfName);
        endpoint.setEndpoint(epName);
        endpoint.setPojo(new EchoService2());
        component.setEndpoints(new Jsr181Endpoint[] { endpoint });
        container.activateComponent(component, "JSR181Component");
    }
View Full Code Here

Examples of org.apache.servicemix.jsr181.Jsr181Endpoint

   
    public void testProxy() throws Exception {
        container.start();

        Jsr181SpringComponent component1 = new Jsr181SpringComponent();
        Jsr181Endpoint endpoint1 = new Jsr181Endpoint();
        endpoint1.setPojo(new EchoService());
        component1.setEndpoints(new Jsr181Endpoint[] { endpoint1 });
        container.activateComponent(component1, "JSR181Component-1");
       
        Jsr181SpringComponent component2 = new Jsr181SpringComponent();
        Jsr181Endpoint endpoint2 = new Jsr181Endpoint();
        endpoint2.setPojo(new ProxyPojoService());
        endpoint2.setServiceInterface(ProxyPojo.class.getName());
        component2.setEndpoints(new Jsr181Endpoint[] { endpoint2 });
        container.activateComponent(component2, "JSR181Component-2");
       
        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
View Full Code Here

Examples of org.apache.servicemix.jsr181.Jsr181Endpoint

  }

  protected List getProvides(Endpoint endpoint) {

    // We need to generate the dummy component to register the services
    Jsr181Endpoint jsr181Endpoint = (Jsr181Endpoint) endpoint;
    try {
      Jsr181SpringComponent componentDummy = new Jsr181SpringComponent();
      componentDummy
          .setEndpoints(new Jsr181Endpoint[] { jsr181Endpoint });
      componentDummy.getLifeCycle().init(new DummyComponentContext());
View Full Code Here

Examples of org.apache.servicemix.jsr181.Jsr181Endpoint

    return new ArrayList();
  }

  protected List getProvides(Endpoint endpoint) {
    // We need to generate the dummy component to register the services
    Jsr181Endpoint jsr181Endpoint = (Jsr181Endpoint) endpoint;
    try {
      Jsr181Component componentDummy = new Jsr181Component();
      componentDummy.setEndpoints(new Jsr181Endpoint[] { jsr181Endpoint });
      componentDummy.getLifeCycle().init(new DummyComponentContext());
    } catch (Exception e) {
View Full Code Here

Examples of org.apache.servicemix.jsr181.Jsr181Endpoint

   
    public void testProxy() throws Exception {
        container.start();

        Jsr181Component component1 = new Jsr181Component();
        Jsr181Endpoint endpoint1 = new Jsr181Endpoint();
        endpoint1.setPojo(new EchoService());
        component1.setEndpoints(new Jsr181Endpoint[] { endpoint1 });
        container.activateComponent(component1, "JSR181Component-1");
       
        Jsr181Component component2 = new Jsr181Component();
        Jsr181Endpoint endpoint2 = new Jsr181Endpoint();
        endpoint2.setPojo(new ProxyPojoService());
        endpoint2.setServiceInterface(ProxyPojo.class.getName());
        component2.setEndpoints(new Jsr181Endpoint[] { endpoint2 });
        container.activateComponent(component2, "JSR181Component-2");
       
        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        InOut me = client.createInOutExchange();
View Full Code Here

Examples of org.apache.servicemix.jsr181.Jsr181Endpoint

      container.start();
     
        Jsr181Component component = new Jsr181Component();

        // Create an xfire endpoint for our pojo order service
        Jsr181Endpoint orderEndpoint = new Jsr181Endpoint();
        orderEndpoint.setPojo(new OrderServiceImpl());
        orderEndpoint.setServiceInterface(OrderService.class.getCanonicalName());

        component.setEndpoints(new Jsr181Endpoint[] { orderEndpoint });
        container.activateComponent(component, "JSR181Component");

        System.out.println(orderEndpoint.getServiceInterface());
        System.out.println(orderEndpoint.getInterfaceName());
        System.out.println(orderEndpoint.getEndpoint());
       
        // Create interface based proxy
        JbiProxyFactoryBean pf = new JbiProxyFactoryBean();
        pf.setContainer(container);
        pf.setInterfaceName(orderEndpoint.getInterfaceName());
        pf.setEndpoint(orderEndpoint.getEndpoint());
        pf.setType(OrderService.class);
        OrderService orderService = (OrderService) pf.getObject();
       
        // Prepare cart for order request
        Cart cart = new Cart();
        OrderItem orderItem = new OrderItem();
        orderItem.setCount(2);
        orderItem.setItem("Book");
        cart.getItems().add(orderItem);
       
        // Call the service
    OrderConfirmation orderConfirmation = orderService.order(cart);
    orderConfirmation = orderService.order(cart);
    orderConfirmation = orderService.order(cart);
   
    // Check that we get the expected order confirmation
    assertNotNull(orderConfirmation);
    cart = orderConfirmation.getCart();
    assertNotNull(cart);
    assertEquals(1, cart.getItems().size());
    orderItem = cart.getItems().get(0);
    assertEquals(2, orderItem.getCount());
    assertEquals("Book", orderItem.getItem());
   
    // Analyse the WSDL that is generated from the pojo service
    Document description = orderEndpoint.getDescription();
    SourceTransformer transformer = new SourceTransformer();
    System.out.println(transformer.toString(description));
    WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
        reader.setFeature(Constants.FEATURE_VERBOSE, false);
        Definition definition = reader.readWSDL(null, description);
        Map namespaces = definition.getNamespaces();
       
        String serviceNameSpace = orderEndpoint.getInterfaceName().getNamespaceURI();
        String modelNameSpace = "http://model.complex.test";
       
        // The WSDL should import the namespaces for the service and the model
        assertTrue("Namespace "+ serviceNameSpace +" present", namespaces.containsValue(serviceNameSpace));
        assertTrue("Namespace "+ modelNameSpace+" present", namespaces.containsValue(modelNameSpace));
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.