Package org.apache.servicemix.jsr181

Examples of org.apache.servicemix.jsr181.Jsr181SpringComponent$LifeCycle


        Fill fi = new Fill(inputs.eClearSale.map(u -> Unit.UNIT),
                           inputs.eFuelPulses, inputs.calibration,
                           inputs.price1, inputs.price2, inputs.price3,
                           eStart);
        NotifyPointOfSale np = new NotifyPointOfSale(
                new LifeCycle(inputs.eNozzle1,
                              inputs.eNozzle2,
                              inputs.eNozzle3),
                inputs.eClearSale,
                fi);
        eStart.loop(np.eStart);
View Full Code Here


import sodium.*;
import java.util.Optional;

public class AccumulatePulsesPump implements Pump {
    public Outputs create(Inputs inputs) {
        LifeCycle lc = new LifeCycle(inputs.eNozzle1,
                                     inputs.eNozzle2,
                                     inputs.eNozzle3);
        Behavior<Double> litersDelivered =
                accumulate(lc.eStart.map(u -> Unit.UNIT),
                           inputs.eFuelPulses,
View Full Code Here

                          inputs.eClearSale.map(u -> Unit.UNIT),
                          inputs.eFuelPulses, inputs.calibration,
                          inputs.price1, inputs.price2, inputs.price3,
                          eStart);
        NotifyPointOfSale np = new NotifyPointOfSale(
                new LifeCycle(inputs.eNozzle1,
                              inputs.eNozzle2,
                              inputs.eNozzle3),
                inputs.eClearSale,
                fi);
        eStart.loop(np.eStart);
View Full Code Here

import sodium.*;
import java.util.Optional;

public class ShowDollarsPump implements Pump {
    public Outputs create(Inputs inputs) {
        LifeCycle lc = new LifeCycle(inputs.eNozzle1,
                                     inputs.eNozzle2,
                                     inputs.eNozzle3);
        Fill fi = new Fill(lc.eStart.map(u -> Unit.UNIT),
                           inputs.eFuelPulses, inputs.calibration,
                           inputs.price1, inputs.price2, inputs.price3,
View Full Code Here

    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) {
            throw new RuntimeException("Unable to register JSR-181 service, " + e.getMessage(), e);
        }
        return super.getProvides(endpoint);
    }
View Full Code Here

    }
   
    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();
        me.setInterfaceName(new QName("http://xfire.jsr181.servicemix.apache.org", "ProxyPojoPortType"));
View Full Code Here

  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) {
      throw new RuntimeException("Unable to register JSR-181 service, " + e.getMessage(), e);
    }
    return super.getProvides(endpoint);
  }
View Full Code Here

    }
   
    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();
        me.setInterfaceName(new QName("http://xfire.jsr181.servicemix.apache.org", "ProxyPojoPortType"));
View Full Code Here

    public void testOrder() throws Exception {
      BasicConfigurator.configure(new ConsoleAppender());
    Logger.getRootLogger().setLevel(Level.DEBUG);
      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());
View Full Code Here

            container.shutDown();
        }
    }
   
    public void testCommonsAnnotations() throws Exception {
        Jsr181Component component = new Jsr181Component();
        container.activateComponent(component, "JSR181Component");

        // Start container
        container.start();
       
        // Deploy SU
        component.getServiceUnitManager().deploy("su", getServiceUnitPath("good1"));
        component.getServiceUnitManager().init("su", getServiceUnitPath("good1"));
        component.getServiceUnitManager().start("su");
       
        assertNotNull(EchoService.instance);
        assertNotNull(EchoService.instance.getContext());
       
        // Call it
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jsr181.Jsr181SpringComponent$LifeCycle

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.