Examples of createConnection()


Examples of org.apache.http.impl.conn.DefaultClientConnectionOperator.createConnection()

        HttpRequest req = new BasicHttpRequest("OPTIONS", "*", HttpVersion.HTTP_1_1);
        req.addHeader("Host", target.getHostName());
       
        HttpContext ctx = new BasicHttpContext();

        OperatedClientConnection conn = scop.createConnection();
        try {
            System.out.println("opening connection to " + target);
            scop.openConnection(conn, target, null, ctx, params);
            System.out.println("sending request");
            conn.sendRequestHeader(req);
View Full Code Here

Examples of org.apache.oozie.jms.ConnectionContext.createConnection()

                    "java.naming.factory.initial#org.apache.activemq.jndi.ActiveMQInitialContextFactory;java.naming.provider.url#" +
                    "vm://localhost?broker.persistent=false;connectionFactoryNames#dynamicFactories/hcat.prod.hcatserver",
                    connInfo.getJNDIPropertiesString());

            ConnectionContext ctx1 = new DefaultConnectionContext();
            ctx1.createConnection(connInfo.getJNDIProperties());
            BrokerService broker = new BrokerService();
            // Without this stop testConnectionRetry fails with
            // javax.management.InstanceAlreadyExistsException: org.apache.activemq:BrokerName=localhost,Type=Broker
            broker.stop();
        }
View Full Code Here

Examples of org.apache.oozie.jms.DefaultConnectionContext.createConnection()

                    "java.naming.factory.initial#org.apache.activemq.jndi.ActiveMQInitialContextFactory;java.naming.provider.url#" +
                    "vm://localhost?broker.persistent=false;connectionFactoryNames#dynamicFactories/hcat.prod.hcatserver",
                    connInfo.getJNDIPropertiesString());

            ConnectionContext ctx1 = new DefaultConnectionContext();
            ctx1.createConnection(connInfo.getJNDIProperties());
            BrokerService broker = new BrokerService();
            // Without this stop testConnectionRetry fails with
            // javax.management.InstanceAlreadyExistsException: org.apache.activemq:BrokerName=localhost,Type=Broker
            broker.stop();
        }
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl.createConnection()

        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.client.AMQConnectionFactory.createConnection()

        String newUrl = String.format(newUrlFormat, origBrokerDetails.getHost(), origBrokerDetails.getPort(),
                                                    retries, connectdelay, cycleCount);

        ConnectionFactory connectionFactory = new AMQConnectionFactory(newUrl);
        AMQConnection connection = (AMQConnection) connectionFactory.createConnection("admin", "admin");
        connection.setConnectionListener(this);
        return connection;
    }

    /**
 
View Full Code Here

Examples of org.apache.qpid.proton.engine.EngineFactory.createConnection()

    @Test
    public void test()
    {
        EngineFactory engineFactory = new ProtonFactoryLoader<EngineFactory>(EngineFactory.class).loadFactory();

        Connection connection1 = engineFactory.createConnection();
        Connection connection2 = engineFactory.createConnection();;
        Transport transport1 = engineFactory.createTransport();
        transport1.bind(connection1);

        Transport transport2 = engineFactory.createTransport();
View Full Code Here

Examples of org.apache.qpid.proton.engine.impl.EngineFactoryImpl.createConnection()

        });
        h.codecHandler(new Handler<AmqpEvent>() {

            EngineFactory engineFactory = new EngineFactoryImpl();
            Transport protonTransport = engineFactory.createTransport();
            Connection protonConnection = engineFactory.createConnection();
            Sasl sasl;


            @Override
            public void handle(AmqpEvent event) {
View Full Code Here

Examples of org.apache.qpid.ra.QpidRAConnectionFactoryImpl.createConnection()

        QpidResourceAdapter ra = new QpidResourceAdapter();
        QpidRAManagedConnectionFactory mcf = new QpidRAManagedConnectionFactory();
        mcf.setConnectionURL(URL);
        mcf.setResourceAdapter(ra);
        ConnectionFactory cf = new QpidRAConnectionFactoryImpl(mcf, null);
        Connection c = cf.createConnection();
        Session s = c.createSession(true, Session.SESSION_TRANSACTED);
        c.close();

        try
        {
View Full Code Here

Examples of org.castor.jdo.engine.AbstractConnectionFactory.createConnection()

            factory = new JNDIConnectionFactory(jdoConf, 0, null);
        }
       
        factory.initializeFactory();
       
        _connection = factory.createConnection();
       
        // if connection is not wrapped by a proxy yet, create one now
        if (!useProxies) {
            ClassLoader loader = _connection.getClass().getClassLoader();
            Class < ? > [] interfaces = new Class < ? > [] {Connection.class};
View Full Code Here

Examples of org.castor.jdo.engine.ConnectionFactory.createConnection()

        try {
            factory = DatabaseRegistry.getConnectionFactory(name);
        } catch (MappingException ex) {
            throw new SQLException(Messages.format("jdo.dbNoMapping", name));
        }
        return factory.createConnection();
    }
}
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.