Java 类org.apache.camel.component.jms.JmsConfiguration 实例源码

项目:Camel    文件:JmsProviderTest.java   
@Test
public void testTemporaryDestinationTypes() throws Exception {
    JmsEndpoint endpoint = getMandatoryEndpoint("activemq:test.queue", JmsEndpoint.class);
    JmsConfiguration configuration = endpoint.getConfiguration();
    JmsProviderMetadata providerMetadata = configuration.getProviderMetadata();
    assertNotNull("provider", providerMetadata);

    Class<? extends TemporaryQueue> queueType = endpoint.getTemporaryQueueType();
    Class<? extends TemporaryTopic> topicType = endpoint.getTemporaryTopicType();

    log.info("Found queue type: " + queueType);
    log.info("Found topic type: " + topicType);

    assertNotNull("queueType", queueType);
    assertNotNull("topicType", topicType);

    assertEquals("queueType", ActiveMQTempQueue.class, queueType);
    assertEquals("topicType", ActiveMQTempTopic.class, topicType);
}
项目:daq-eclipse    文件:BrokerComponent.java   
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
    BrokerConfiguration brokerConfiguration = new BrokerConfiguration();
    setProperties(brokerConfiguration, parameters);

    byte destinationType = ActiveMQDestination.QUEUE_TYPE;

    if (remaining.startsWith(JmsConfiguration.QUEUE_PREFIX)) {
        remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.QUEUE_PREFIX.length()), '/');
    } else if (remaining.startsWith(JmsConfiguration.TOPIC_PREFIX)) {
        destinationType = ActiveMQDestination.TOPIC_TYPE;
        remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.TOPIC_PREFIX.length()), '/');
    } else if (remaining.startsWith(JmsConfiguration.TEMP_QUEUE_PREFIX)) {
        destinationType = ActiveMQDestination.TEMP_QUEUE_TYPE;
        remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.TEMP_QUEUE_PREFIX.length()), '/');
    } else if (remaining.startsWith(JmsConfiguration.TEMP_TOPIC_PREFIX)) {
        destinationType = ActiveMQDestination.TEMP_TOPIC_TYPE;
        remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.TEMP_TOPIC_PREFIX.length()), '/');
    }


    ActiveMQDestination destination = ActiveMQDestination.createDestination(remaining, destinationType);
    BrokerEndpoint brokerEndpoint = new BrokerEndpoint(uri, this, destination, brokerConfiguration);
    return brokerEndpoint;
}
项目:signalk-server-java    文件:ActiveMqBrokerFactory.java   
public static ActiveMQComponent newAMQInstance(){
     ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL("vm:localhost");
        // use a pooled connection factory between the module and the queue
        PooledConnectionFactory pooledConnectionFactory = new PooledConnectionFactory(connectionFactory);

        // how many connections should there be in the session pool?
        pooledConnectionFactory.setMaxConnections(100);
        pooledConnectionFactory.setMaximumActiveSessionPerConnection(100);
        pooledConnectionFactory.setCreateConnectionOnStartup(true);
        pooledConnectionFactory.setBlockIfSessionPoolIsFull(false);

        JmsConfiguration jmsConfiguration = new JmsConfiguration(pooledConnectionFactory);
        jmsConfiguration.setDeliveryPersistent(false);
        jmsConfiguration.setTimeToLive(1000*10);
        ActiveMQComponent activeMQComponent = ActiveMQComponent.activeMQComponent("vm:localhost");
        return activeMQComponent;
}
项目:funktion-connectors    文件:K8ActiveMQComponent.java   
@Override
public void setConfiguration(JmsConfiguration configuration) {
    if (configuration instanceof K8ActiveMQConfiguration) {
        ((K8ActiveMQConfiguration) configuration).setActiveMQComponent(this);
    }
    super.setConfiguration(configuration);
}
项目:funktion-connectors    文件:K8ActiveMQComponent.java   
@Override
protected JmsConfiguration createConfiguration() {
    K8ActiveMQConfiguration answer = new K8ActiveMQConfiguration();
    answer.setBrokerURL("tcp://"+answer.getServiceName() + ":" + answer.getPort());
    answer.setActiveMQComponent(this);
    return answer;
}
项目:daq-eclipse    文件:ActiveMQComponent.java   
@Override
public void setConfiguration(JmsConfiguration configuration) {
    if (configuration instanceof ActiveMQConfiguration) {
        ((ActiveMQConfiguration) configuration).setActiveMQComponent(this);
    }
    super.setConfiguration(configuration);
}
项目:Camel    文件:JmsComponentConfiguration.java   
public JmsConfiguration getConfiguration() {
    return configuration;
}
项目:Camel    文件:JmsComponentConfiguration.java   
public void setConfiguration(JmsConfiguration configuration) {
    this.configuration = configuration;
}
项目:Camel    文件:AMQPComponent.java   
public AMQPComponent(JmsConfiguration configuration) {
    super(configuration);
}
项目:Camel    文件:AMQPComponentConfiguration.java   
public JmsConfiguration getConfiguration() {
    return configuration;
}
项目:Camel    文件:AMQPComponentConfiguration.java   
public void setConfiguration(JmsConfiguration configuration) {
    this.configuration = configuration;
}
项目:daq-eclipse    文件:ActiveMQComponent.java   
@Override
protected JmsConfiguration createConfiguration() {
    ActiveMQConfiguration answer = new ActiveMQConfiguration();
    answer.setActiveMQComponent(this);
    return answer;
}
项目:servicemix    文件:ActiveMQComponent.java   
public ActiveMQComponent(CamelContext camelContext, ConnectionFactory connectionFactory) {
    super(camelContext);
    setConfiguration(new JmsConfiguration(connectionFactory));
}