Examples of ConnectionFactoryImpl


Examples of com.caucho.jms.connection.ConnectionFactoryImpl

  private MessageFactory _messageFactory = new MessageFactory();

  public Jms()
  {
    try {
      _connectionFactory = new ConnectionFactoryImpl();
      _conn = _connectionFactory.createConnection();
      _conn.start();
    } catch (JMSException e) {
      throw new JmsRuntimeException(e);
    }
View Full Code Here

Examples of com.caucho.jms.connection.ConnectionFactoryImpl

  private MessageFactory _messageFactory = new MessageFactory();

  public Jms()
  {
    try {
      _connectionFactory = new ConnectionFactoryImpl();
      _conn = _connectionFactory.createConnection();
      _conn.start();
    } catch (JMSException e) {
      throw new JmsRuntimeException(e);
    }
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl

        }
    }

    public void createConnectionFactory(String name) {
        try {
            final ConnectionFactory factory = new ConnectionFactoryImpl("localhost", port, null, null);
            context.bind(name, factory);
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl

        }
    }

    public void createConnectionFactory(String name) {
        try {
            final ConnectionFactory factory = new ConnectionFactoryImpl("localhost", port, null, null);
            context.bind(name, factory);
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl

        mqtt.setHost("localhost", mqttConnector.getConnectUri().getPort());
        return mqtt;
    }

    public Connection createAmqpConnection() throws Exception {
        final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", amqpConnector.getConnectUri().getPort(), "admin", "password");
        final Connection connection = factory.createConnection();
        connection.setExceptionListener(new ExceptionListener() {
            @Override
            public void onException(JMSException exception) {
                exception.printStackTrace();
            }
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl

    private Connection createConnection(String clientId, boolean syncPublish) throws JMSException {

        int brokerPort = getBrokerPort();
        LOG.debug("Creating connection on port {}", brokerPort);
        final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", brokerPort, "admin", "password");

        factory.setSyncPublish(syncPublish);
        factory.setTopicPrefix("topic://");
        factory.setQueuePrefix("queue://");

        final Connection connection = factory.createConnection();
        if (clientId != null && !clientId.isEmpty()) {
            connection.setClientID(clientId);
        }
        connection.setExceptionListener(new ExceptionListener() {
            @Override
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl

    }

    @Test(timeout = 10000)
    public void testNoUserOrPassword() throws Exception {
        try {
            ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "", "");
            Connection connection = factory.createConnection();
            connection.setExceptionListener(new ExceptionListener() {
                @Override
                public void onException(JMSException exception) {
                    LOG.error("Unexpected exception ", exception);
                    exception.printStackTrace();
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl

    }

    @Test(timeout = 10000)
    public void testUnknownUser() throws Exception {
        try {
            ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin", "password");
            Connection connection = factory.createConnection("nosuchuser", "blah");
            connection.start();
            Thread.sleep(500);
            connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            fail("Expected JMSException");
        } catch (JMSException e)  {
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl

    }

    @Test(timeout = 10000)
    public void testKnownUserWrongPassword() throws Exception {
        try {
            ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin", "password");
            Connection connection = factory.createConnection("user", "wrongPassword");
            connection.start();
            Thread.sleep(500);
            connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            fail("Expected JMSException");
        } catch (JMSException e) {
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl

        }
    }

    @Test(timeout = 30000)
    public void testSendReceive() throws Exception {
        ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin", "password");
        Connection connection = factory.createConnection("user", "userPassword");
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueImpl queue = new QueueImpl("queue://txqueue");
        MessageProducer p = session.createProducer(queue);
        TextMessage message = null;
        message = session.createTextMessage();
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.