Examples of ConnectionFactoryImpl


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

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

    @Override
    public void createConnectionFactory(String name) {
        try {
            LOG.debug("Creating a connection factory using port {}", port);
            final ConnectionFactory factory = new ConnectionFactoryImpl("localhost", port, null, null, null, true);
            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

        session.close();
        openwireConn.close();
    }

    public Connection createAmqpConnection() throws JMSException {
        final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", amqpPort, "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

    // This test is not yet ready for prime time..
    @Test
    public void canDetectTheAMQPProtocol() throws Exception {
        DetectingGateway gateway = createGateway();

        final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", gateway.getBoundPort(), "admin", "password");
        Connection connection = factory.createConnection();
        connection.start();

        assertEquals(1, gateway.getSuccessfulConnectionAttempts());
        assertEquals(1, gateway.getConnectedClients().length);
View Full Code Here

Examples of org.apache.ws.scout.registry.ConnectionFactoryImpl

            log.infof("Binding JAXR ConnectionFactory: %s", config.getConnectionFactoryBinding());
            try {
                String jndiName = config.getConnectionFactoryBinding();
                ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
                BinderService binderService = new BinderService(bindInfo.getBindName());
                ImmediateValue value = new ImmediateValue(new ConnectionFactoryImpl());
                binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(value));
                binderService.getNamingStoreInjector().inject((ServiceBasedNamingStore) injectedJavaContext.getValue());
                ServiceBuilder<?> builder = context.getChildTarget().addService(bindInfo.getBinderServiceName(), binderService);
                builder.install();
            } catch (Exception ex) {
View Full Code Here

Examples of org.mom4j.jms.ConnectionFactoryImpl

        while(it.hasNext()) {
            this.nserver.addContextHandler((JNDIContextHandler)it.next());
        }

        this.nserver.bind("/", "QueueConnectionFactory",
            new ConnectionFactoryImpl(this.hostName,
                                      this.config.getPort(),
                                      this.config.getSyncInterval(),
                                      this.config.getAsyncInterval())
            );
        this.nserver.bind("/", "TopicConnectionFactory",
            new ConnectionFactoryImpl(this.hostName,
                                      this.config.getPort(),
                                      this.config.getSyncInterval(),
                                      this.config.getAsyncInterval())
            );
        this.nserver.bind("/", "ConnectionFactory",
            new ConnectionFactoryImpl(this.hostName,
                                      this.config.getPort(),
                                      this.config.getSyncInterval(),
                                      this.config.getAsyncInterval())
            );
        this.nserver.bind("/", "start-time", new Long(System.currentTimeMillis()));
View Full Code Here

Examples of org.postgresql.core.v3.ConnectionFactoryImpl

    boolean passwordCorrect = false;
    try {
      Logger logger = new Logger();
      Properties info = new Properties();
      info.setProperty("password", password);
      ConnectionFactory connectionFactory = new ConnectionFactoryImpl();
      ProtocolConnection connection = connectionFactory.openConnectionImpl(
          host, port, getDataSource().getUser(), "template1", info, logger);
      connection.close();
      passwordCorrect = true;
    } catch (SQLException e) {
      // expected for wrong password
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.