Examples of createConnection()


Examples of org.aavso.tools.vstar.input.database.AAVSODatabaseConnector.createConnection()

      // done so.
      Mediator.getUI().getStatusPane().setMessage(
          LocaleProps.get("STATUS_PANE_CONNECTING_TO_DATABASE"));

      AAVSODatabaseConnector vsxConnector = AAVSODatabaseConnector.vsxDBConnector;
      Connection vsxConnection = vsxConnector.createConnection();

      // TODO: this should always be populated by VSX methods below!!
      // (e.g. to get period, epoch, variable/spectral type, discoverer).
      StarInfo starInfo = new StarInfo(starName, auid);
View Full Code Here

Examples of org.activemq.ActiveMQConnectionFactory.createConnection()

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        ActiveMQTopic pubTopic = new ActiveMQTopic("demo.org.servicemix.source");
        ActiveMQTopic subTopic = new ActiveMQTopic("demo.org.servicemix.result");
       
        System.out.println("Connecting to JMS server.");
        Connection connection = factory.createConnection();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer producer = session.createProducer(pubTopic);
        MessageConsumer consumer = session.createConsumer(subTopic);
        connection.start();
       
View Full Code Here

Examples of org.apache.activemq.ActiveMQConnectionFactory.createConnection()

    // Connection connection = null;
    ActiveMQConnection connection = null;
    try {
      // Create the connection.
      ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
      connection = (ActiveMQConnection) connectionFactory.createConnection();
      connection.start();
      // Create the session
      Session session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
      if (topic) {
        destination = session.createTopic(subject);
View Full Code Here

Examples of org.apache.activemq.ActiveMQSslConnectionFactory.createConnection()

        cf.setTrustStorePassword("password");
        cf.setKeyStore("org/apache/activemq/security/client.ks");
        cf.setKeyStorePassword("password");
        ActiveMQConnection connection = null;
        if (username != null || password != null) {
            connection = (ActiveMQConnection)cf.createConnection(username, password);
        } else {
            connection = (ActiveMQConnection)cf.createConnection();
        }
        TestCase.assertNotNull(connection);
        connection.start();
View Full Code Here

Examples of org.apache.activemq.ActiveMQXAConnectionFactory.createConnection()

    public void testCreateVMConnectionWithEmbdeddBroker() throws URISyntaxException, JMSException {
        ActiveMQXAConnectionFactory cf = new ActiveMQXAConnectionFactory("vm://localhost?broker.persistent=false");
        // Make sure the broker is not created until the connection is instantiated.
        assertNull( BrokerRegistry.getInstance().lookup("localhost") );       
        Connection connection = cf.createConnection();
        // This should create the connection.
        assertNotNull(connection);
        // Verify the broker was created.
        assertNotNull( BrokerRegistry.getInstance().lookup("localhost") );
        connection.close();
View Full Code Here

Examples of org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection()

            threads[i] = new Thread(new Runnable() {
                @Override
                public void run() {
                    while (!done.get() && latch.getCount() > 0) {
                        try {
                            final PooledConnection pooledConnection = (PooledConnection) pooled.createConnection();
                            if (pooledConnection.getConnection() == null) {
                                LOG.info("Found broken connection.");
                                latch.countDown();
                            }
                            pooledConnection.close();
View Full Code Here

Examples of org.apache.activemq.pool.PooledConnectionFactory.createConnection()

    @Test
    public void testTempQueueIssue() throws JMSException, InterruptedException {
        final PooledConnectionFactory cf = new PooledConnectionFactory("vm://localhost?broker.persistent=false");

        Connection con1 = cf.createConnection();
        con1.start();
       
        // This order seems to matter to reproduce the issue
        con1.close();
       
View Full Code Here

Examples of org.apache.activemq.pool.XaPooledConnectionFactory.createConnection()

                                                                         + "?broker.persistent=false");
        cf.setRedeliveryPolicy(redeliveryPolicy());
        XaPooledConnectionFactory cfp = new XaPooledConnectionFactory(cf);
        cfp.setTransactionManager(tm);
        cfp.setConnectionFactory(cf);
        Connection connection = cfp.createConnection();
        connection.start();
        return connection;
    }

    private RedeliveryPolicy redeliveryPolicy() {
View Full Code Here

Examples of org.apache.activemq.spring.ActiveMQConnectionFactory.createConnection()

        {
            ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
            cf.setBrokerURL(brokerUrl);
            try
            {
                connection = cf.createConnection();
                connection.start();
                Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                consumer = session.createConsumer(session.createQueue("out"));
            }
            catch (JMSException e)
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionOperator.createConnection()

        setup(); // some general setup

        // one operator can be used for many connections
        ClientConnectionOperator scop = createOperator();
        OperatedClientConnection conn = scop.createConnection();

        HttpRequest req = createRequest(target);
        HttpContext ctx = createContext();

        System.out.println("opening connection to " + target);
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.