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

Examples of org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory


        p.send(session.createTextMessage(payload));
        rf.closeConnection();
    }

    protected static void sendObjectMessage(String destName, Object payload) throws JMSException, NamingException {
        JMSResourceFactory rf = new JMSResourceFactoryImpl(null, null, null, "tcp://localhost:61623");
        Session session = rf.getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer p = session.createProducer(rf.lookupDestination(destName));
        rf.getConnection().start();
        session.run();
        p.send(session.createObjectMessage((Serializable)payload));
        rf.closeConnection();
    }
View Full Code Here


            broker.stop();
        }
    }

    protected static void sendTextMessage(String destName, String payload) throws JMSException, NamingException {
        JMSResourceFactory rf = new JMSResourceFactoryImpl(null, null, null, "tcp://localhost:61623");
        Session session = rf.getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer p = session.createProducer(rf.lookupDestination(destName));
        rf.getConnection().start();
        session.run();
        p.send(session.createTextMessage(payload));
        rf.closeConnection();
    }
View Full Code Here

        p.send(session.createTextMessage(payload));
        rf.closeConnection();
    }

    protected static void sendObjectMessage(String destName, Object payload) throws JMSException, NamingException {
        JMSResourceFactory rf = new JMSResourceFactoryImpl(null, null, null, "tcp://localhost:61623");
        Session session = rf.getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer p = session.createProducer(rf.lookupDestination(destName));
        rf.getConnection().start();
        session.run();
        p.send(session.createObjectMessage((Serializable)payload));
        rf.closeConnection();
    }
View Full Code Here

    }

    /**
      */
    public WireFormatProvider createServiceWireFormatProvider(RuntimeEndpoint endpoint) {
        JMSResourceFactory jmsResourceFactory = jmsRFEP.createJMSResourceFactory((JMSBinding) endpoint.getBinding());
        return new WireFormatJMSTextServiceProvider(registry, endpoint, jmsResourceFactory);
    }
View Full Code Here

    }

    /**
      */
    public WireFormatProvider createServiceWireFormatProvider(RuntimeEndpoint endpoint) {
        JMSResourceFactory jmsResourceFactory = jmsRFEP.createJMSResourceFactory((JMSBinding) endpoint.getBinding());
        return new WireFormatJMSObjectServiceProvider(registry, endpoint, jmsResourceFactory);
    }
View Full Code Here

    String responseAddress = respInvoker.getResponseTargetAddress();
    String relatedMsg = respInvoker.getRelatesToMsgID();
   
        // Get the JMS context
        JMSBindingContext context = msg.getBindingContext();
        JMSResourceFactory jmsResourceFactory = context.getJmsResourceFactory();
        Destination dest;
    try {
      dest = jmsResourceFactory.lookupDestination(responseAddress);
      if( dest == null ) {
        dest = jmsResourceFactory.createDestination(responseAddress);
      } // end if
    } catch (NamingException e) {
      throw new JMSBindingException(e);
    }
        context.setReplyToDestination(dest);
View Full Code Here

     */
    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

    }

    /**
      */
    public WireFormatProvider createServiceWireFormatProvider(RuntimeEndpoint endpoint) {
        JMSResourceFactory jmsRF = jmsRFEP.createJMSResourceFactory((JMSBinding)endpoint.getBinding());
        return new WireFormatJMSBytesServiceProvider(registry, endpoint, jmsRF);
    }
View Full Code Here

    }

    /**
      */
    public WireFormatProvider createServiceWireFormatProvider(RuntimeEndpoint endpoint) {
        JMSResourceFactory jmsRF = jmsRFEP.createJMSResourceFactory((JMSBinding)endpoint.getBinding());
        return new WireFormatJMSBytesXMLServiceProvider(registry, endpoint, jmsRF);
    }
View Full Code Here

                    ((JMSBindingContext)msg.getBindingContext()).closeJmsResponseSession();
                } catch (Throwable e) {
                }
                // Use the resource factory in the binding context to close the response connection,
                // to ensure we use same resource factory used to close response session.
                JMSResourceFactory rf = ((JMSBindingContext)msg.getBindingContext()).getJmsResourceFactory();
                if (rf.isConnectionClosedAfterUse())
                    rf.closeResponseConnection();
            } catch (JMSException e) {
            }
        }
    }   
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory

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.