Package org.apache.tuscany.sca.binding.jms.impl

Examples of org.apache.tuscany.sca.binding.jms.impl.JMSBinding


     * @throws Exception Failed
     */
    private void doTestJMSBinding(Operation expectedOperation, List<Operation> operations, String scaOperationName)
        throws Exception {
        // Create the test JMS Binding
        final JMSBinding jmsBinding = new JMSBinding();
        JMSResourceFactory jmsResourceFactory = null;

        // Extra information for the method we are invoking
        final String operationParams = "Hello";
        final Object operationReturnValue = "Operation Success";
View Full Code Here


     * @throws Exception Failed
     */
    private void doTestJMSBinding(Operation expectedOperation, List<Operation> operations, String scaOperationName)
        throws Exception {
        // Create the test JMS Binding
        final JMSBinding jmsBinding = new JMSBinding();
        JMSResourceFactory jmsResourceFactory = null;

        // Extra information for the method we are invoking
        final String operationParams = "Hello";
        final Object operationReturnValue = "Operation Success";
View Full Code Here

        String requestDestinationName = "SomeRequestDestination";
        String responseDestinationName = "SomeResponseDestination";
        String jmsBindingName = "MyJMSBinding";

        // Create a JMS Binding with the required test parameters
        JMSBinding jmsBinding = new JMSBinding();
        jmsBinding.setDestinationCreate(requestCreateMode);
        jmsBinding.setResponseDestinationCreate(responseCreateMode);
        if (preCreateQueue) {
//            jmsBinding.setJmsResourceFactoryName(new JMSResourceFactory(null, null, null));
        } else {
//            jmsBinding.setJmsResourceFactoryName(MockJMSResourceFactoryQueueNotExist.class.getName());
        }
        jmsBinding.setDestinationName(requestDestinationName);
        jmsBinding.setResponseDestinationName(responseDestinationName);
        jmsBinding.setName(jmsBindingName);

        // Create the operation
        Operation operation = new OperationImpl();
        operation.setName("OperationName");
View Full Code Here

        String destinationName = "SomeDestination";
        String jmsBindingName = "MyJMSBinding";
        String serviceName = "MyServiceName";

        // Create a JMS Binding with the required test parameters
        JMSBinding jmsBinding = new JMSBinding();
        jmsBinding.setDestinationCreate(createMode);
//        if (preCreateQueue) {
//            jmsBinding.setJmsResourceFactoryName(MockJMSResourceFactoryQueueExist.class.getName());
//        } else {
//            jmsBinding.setJmsResourceFactoryName(MockJMSResourceFactoryQueueNotExist.class.getName());
//        }
        jmsBinding.setDestinationName(destinationName);
        jmsBinding.setName(jmsBindingName);

        RuntimeComponentService service = new RuntimeComponentServiceImpl();
        service.setName(serviceName);

        // Try and create the JMS Binding Service for the JMS Binding
View Full Code Here

    }
   
    protected String getCallbackDestinationName(RuntimeComponentReference reference) {
        RuntimeComponentService s = (RuntimeComponentService)reference.getCallbackService();
        JMSBinding b = s.getBinding(JMSBinding.class);
        if (b != null) {
            JMSBindingServiceBindingProvider bp = (JMSBindingServiceBindingProvider)s.getBindingProvider(b);
            return bp.getDestinationName();
        }
        return null;
View Full Code Here

     * @throws Exception Failed
     */
    private void doTestJMSBinding(Operation expectedOperation, List<Operation> operations, String scaOperationName)
        throws Exception {
        // Create the test JMS Binding
        final JMSBinding jmsBinding = new JMSBinding();
        JMSResourceFactory jmsResourceFactory = null;

        // Extra information for the method we are invoking
        final String operationParams = "Hello";
        final Object operationReturnValue = "Operation Success";
View Full Code Here

        return replyMsg;
    }

    protected String getCallbackDestinationName(RuntimeComponentReference reference) {
        RuntimeComponentService s = (RuntimeComponentService)reference.getCallbackService();
        JMSBinding b = s.getBinding(JMSBinding.class);
        if (b != null) {
            JMSBindingServiceBindingProvider bp = (JMSBindingServiceBindingProvider)s.getBindingProvider(b);
            return bp.getDestinationName();
        }
        return null;
View Full Code Here

    }   

    public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
                                                                   RuntimeComponentReference reference,
                                                                   DistributedSCABinding binding) {
        JMSBinding jmsBinding = createBinding(binding);

        // FIXME: CREATE_NEVER doesn't work as the dynamically created JNDI destinations
        // aren't replicated around the broker cluster. Maybe it needs an AMQ specific
        // impl of the Tuscany JMSResourceFactory which uses use physical destinations
        // instead of JNDI
View Full Code Here

    }

    public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
                                                               RuntimeComponentService service,
                                                               DistributedSCABinding binding) {
        JMSBinding jmsBinding = createBinding(binding);
        jmsBinding.setDestinationCreate(JMSBindingConstants.CREATE_ALWAYS);
        JMSResourceFactory jmsRF = jmsRFEP.createJMSResourceFactory(jmsBinding);
        return new JMSBindingServiceBindingProvider(component, service, binding.getSCABinding(), jmsBinding, workScheduler, extensionPoints, jmsRF);
    }
View Full Code Here

        JMSResourceFactory jmsRF = jmsRFEP.createJMSResourceFactory(jmsBinding);
        return new JMSBindingServiceBindingProvider(component, service, binding.getSCABinding(), jmsBinding, workScheduler, extensionPoints, jmsRF);
    }

    private JMSBinding createBinding(DistributedSCABinding binding) {
        JMSBinding b = new JMSBinding();
        b.setInitialContextFactoryName("org.apache.activemq.jndi.ActiveMQInitialContextFactory");
        b.setJndiURL("vm://localhost"); // TODO: plug in jndi url from definitions.xml
       
        b.setJMSTimeToLive(9);
       
        b.setRequestMessageProcessorName(JMSBindingConstants.OBJECT_MP_CLASSNAME);
        b.setResponseMessageProcessorName(JMSBindingConstants.OBJECT_MP_CLASSNAME);
        if (binding.getSCABinding().getURI().startsWith("/")) {
            b.setDestinationName(binding.getSCABinding().getURI().substring(1));
        } else {
            b.setDestinationName(binding.getSCABinding().getURI());
        }
        return b;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.jms.impl.JMSBinding

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.