Package org.switchyard.metadata

Examples of org.switchyard.metadata.InOnlyService


                new DefaultServiceDomainSecurity());
        init();
    }
   
    public ServiceReference createInOnlyService(QName serviceName) {
        ServiceInterface inOnly = new InOnlyService();
        registerService(serviceName, inOnly, new MockHandler());
        ServiceReference reference = registerServiceReference(serviceName, inOnly);
        return reference;
    }
View Full Code Here


        return reference;
    }
   

    public ServiceReference createInOnlyService(QName serviceName, ExchangeHandler handler) {
        ServiceInterface inOnly = new InOnlyService();
        registerService(serviceName, inOnly, handler);
        ServiceReference reference = registerServiceReference(serviceName, inOnly);
        return reference;
    }
View Full Code Here

   
    @Test
    public void testDispatchInOnly() throws Exception {
        QName name = new QName("testDispatchInOnly");
        ExchangeSink sink = new ExchangeSink();
        Service service = new MockService(name, new InOnlyService(), sink);
        ServiceReference reference = new ServiceReferenceImpl(name, new InOnlyService(), null, null);
        ExchangeDispatcher dispatch = _provider.createDispatcher(reference);

        Exchange exchange = new CamelExchange(dispatch, new DefaultExchange(_camelContext), sink);
        exchange.consumer(reference, reference.getInterface().getOperation(ServiceInterface.DEFAULT_OPERATION));
        exchange.provider(service, service.getInterface().getOperation(ServiceInterface.DEFAULT_OPERATION));
View Full Code Here

   
    @Test
    public void throttle() throws Exception {
        QName name = new QName("testDispatchInOnly");
        final ExchangeSink sink = new ExchangeSink(1000);
        final Service service = new MockService(name, new InOnlyService(), sink);
        final ServiceReference reference = new ServiceReferenceImpl(name, new InOnlyService(), null, null);
        final ExchangeDispatcher dispatch = _provider.createDispatcher(reference);
       
        // Set throttling to 1 per second
        Throttling throttle = new Throttling().setMaxRequests(1);
        ServiceMetadataBuilder.update(reference.getServiceMetadata()).throttling(throttle);
View Full Code Here

        domain.setProperty(CamelContextConfigurator.SHUTDOWN_TIMEOUT, "5");
        initDomain(domain);
       
        QName name = new QName("testThrottleTimePeriod");
        final ExchangeSink sink = new ExchangeSink();
        final Service service = new MockService(name, new InOnlyService(), sink);
        final ServiceReference reference = new ServiceReferenceImpl(name, new InOnlyService(), null, null);
        // Set throttling to 1 per minute (60000 ms)
        Throttling throttle = new Throttling().setMaxRequests(1).setTimePeriod(60 * 1000);
        ServiceMetadataBuilder.update(reference.getServiceMetadata()).throttling(throttle);
       
        final ExchangeDispatcher dispatch = _provider.createDispatcher(reference);
View Full Code Here

     * @param serviceName The Service name.
     * @return The {@link MockHandler} service fault handler.
     */
    public MockHandler registerInOnlyService(String serviceName) {
        MockHandler handler = new MockHandler();
        getServiceDomain().registerService(createQName(serviceName), new InOnlyService(), handler);
        return handler;
    }
View Full Code Here

     *
     * @param serviceName The Service name.
     * @param serviceHandler The service handler.
     */
    public void registerInOnlyService(String serviceName, ExchangeHandler serviceHandler) {
        getServiceDomain().registerService(createQName(serviceName), new InOnlyService(), serviceHandler);
    }
View Full Code Here

                }
            } else if (EsbInterfaceModel.ESB.equals(intfModel.getType())) {
                EsbInterfaceModel esbIntf = (EsbInterfaceModel)intfModel;
                validateEsbInterface(esbIntf);
                if (esbIntf.getOutputType() == null) {
                    serviceInterface = new InOnlyService(new InOnlyOperation(
                            ServiceInterface.DEFAULT_OPERATION, esbIntf.getInputType()));
                } else {
                    serviceInterface = new InOutService(new InOutOperation(
                            ServiceInterface.DEFAULT_OPERATION,
                            esbIntf.getInputType(), esbIntf.getOutputType(), esbIntf.getFaultType()));
View Full Code Here

       
        // we want to invoke a mock so we can check for messages received
        final ServiceReference reference = domain.getServiceReference(svcName);
        domain.getServices(svcName).get(0).unregister();
        final MockHandler service = new MockHandler();
        domain.registerService(svcName, new InOnlyService(), service);
       
               
        final int NUM_SENDS = 5;
        for (int i = 0; i < NUM_SENDS; i++) {
            new Thread(new Runnable() {
View Full Code Here

TOP

Related Classes of org.switchyard.metadata.InOnlyService

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.