/** * Factory method to create a new connection factory from the given * environment */ protected ActiveMQConnectionFactory createConnectionFactory(Hashtable environment) throws URISyntaxException { ActiveMQConnectionFactory answer = needsXA(environment) ? new ActiveMQXAConnectionFactory() : new ActiveMQConnectionFactory(); Properties properties = new Properties(); properties.putAll(environment); answer.setProperties(properties); return answer; }
public XAQueueConnection createXAQueueConnection(String userName, String password) throws JMSException { return (XAQueueConnection) createActiveMQConnection(userName, password); }
protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception { ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), getConnectionIdGenerator(), stats); configureXAConnection(connection); return connection; }
public ConnectionFactory create(ConnectionFactoryConfiguration configuration) throws Fabric3Exception { ConnectionFactoryType type = configuration.getType(); String clientId = configuration.getClientId(); switch (type) { case XA: ActiveMQXAConnectionFactory xaFactory = new ActiveMQXAConnectionFactory(getUri(configuration)); xaFactory.setProperties(configuration.getFactoryProperties()); xaFactory.setUserName(configuration.getUsername()); xaFactory.setPassword(configuration.getPassword()); if (clientId != null) { // since a client id is specified (possibly for a durable subscription), create a singleton connection so the connection id is unique setClientId(clientId, xaFactory); return new XaSingletonConnectionFactory(xaFactory, monitor); } return xaFactory; default: // default to local pooled ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(getUri(configuration)); factory.setProperties(configuration.getFactoryProperties()); factory.setUserName(configuration.getUsername()); factory.setPassword(configuration.getPassword()); if (clientId != null) { // since a client id is specified (possibly for a durable subscription), create a singleton connection so the connection id is unique setClientId(clientId, factory); return new SingletonConnectionFactory(factory, monitor); } return factory; } }
public ConnectionFactory create(ActiveMQConnectionFactoryConfiguration configuration) throws ConnectionFactoryCreationException { ConnectionFactoryType type = configuration.getType(); switch (type) { case XA: ActiveMQXAConnectionFactory xaFactory = new ActiveMQXAConnectionFactory(getUri(configuration)); xaFactory.setProperties(configuration.getFactoryProperties()); return xaFactory; default: // default to local pooled ActiveMQConnectionFactory wrapped = new ActiveMQConnectionFactory(getUri(configuration)); wrapped.setProperties(configuration.getFactoryProperties()); return new PooledConnectionFactory(wrapped); } }
public static void startBusAndJMS(String brokerURI) { try { transactionManager = new GeronimoTransactionManager(); } catch (XAException e) { throw new IllegalStateException(e.getMessage(), e); } bus = BusFactory.getDefaultBus(); registerTransactionManager(); ActiveMQXAConnectionFactory cf1 = new ActiveMQXAConnectionFactory(brokerURI); cf1.setRedeliveryPolicy(redeliveryPolicy()); JcaPooledConnectionFactory pcf = new JcaPooledConnectionFactory(); pcf.setTransactionManager(transactionManager); pcf.setConnectionFactory(cf1); cf = pcf; cff = new ConnectionFactoryFeature(pcf); }
protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception { ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), stats); return connection; } }
public void setBrokerUrl(String url) { if (brokerUrl == null || !brokerUrl.equals(url)) { brokerUrl = url; setConnectionFactory(new ActiveMQXAConnectionFactory(brokerUrl)); } }
public XAQueueConnection createXAQueueConnection() throws JMSException { return (XAQueueConnection) createActiveMQConnection(); }
protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception { ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), getConnectionIdGenerator(), stats); configureXAConnection(connection); return connection; }
/** * Factory method to create a new connection factory from the given * environment */ protected ActiveMQConnectionFactory createConnectionFactory(Hashtable environment) throws URISyntaxException { ActiveMQConnectionFactory answer = needsXA(environment) ? new ActiveMQXAConnectionFactory() : new ActiveMQConnectionFactory(); Properties properties = new Properties(); properties.putAll(environment); answer.setProperties(properties); return answer; }
public XATopicConnection createXATopicConnection() throws JMSException { return (XATopicConnection) createActiveMQConnection(); }
protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception { ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), getConnectionIdGenerator(), stats); configureXAConnection(connection); return connection; }
/** * Factory method to create a new connection factory from the given * environment */ protected ActiveMQConnectionFactory createConnectionFactory(Hashtable environment) throws URISyntaxException { ActiveMQConnectionFactory answer = needsXA(environment) ? new ActiveMQXAConnectionFactory() : new ActiveMQConnectionFactory(); Properties properties = new Properties(); properties.putAll(environment); answer.setProperties(properties); return answer; }
public XAConnection createXAConnection() throws JMSException { return (XAConnection) createActiveMQConnection(); }
protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception { ActiveMQXAConnection connection = new ActiveMQXAConnection(transport, getClientIdGenerator(), getConnectionIdGenerator(), stats); configureXAConnection(connection); return connection; }
/** * Factory method to create a new connection factory from the given * environment */ protected ActiveMQConnectionFactory createConnectionFactory(Hashtable environment) throws URISyntaxException { ActiveMQConnectionFactory answer = needsXA(environment) ? new ActiveMQXAConnectionFactory() : new ActiveMQConnectionFactory(); Properties properties = new Properties(); properties.putAll(environment); answer.setProperties(properties); return answer; }
public XAConnection createXAConnection(String userName, String password) throws JMSException { return (XAConnection) createActiveMQConnection(userName, password); }
/** * Factory method to create a new connection factory from the given * environment */ protected ActiveMQConnectionFactory createConnectionFactory(Hashtable environment) throws URISyntaxException { ActiveMQConnectionFactory answer = needsXA(environment) ? new ActiveMQXAConnectionFactory() : new ActiveMQConnectionFactory(); Properties properties = new Properties(); properties.putAll(environment); answer.setProperties(properties); return answer; }
public XATopicConnection createXATopicConnection(String userName, String password) throws JMSException { return (XATopicConnection) createActiveMQConnection(userName, password); }