git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@663689 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-06-05 18:08:47 +00:00
parent f7fa2bc58d
commit e40e2ac67a
2 changed files with 24 additions and 13 deletions

View File

@ -47,7 +47,10 @@ public class ActiveMQComponent extends JmsComponent {
*/
public static ActiveMQComponent activeMQComponent(String brokerURL) {
ActiveMQComponent answer = new ActiveMQComponent();
answer.getConfiguration().setBrokerURL(brokerURL);
if (answer.getConfiguration() instanceof ActiveMQConfiguration) {
((ActiveMQConfiguration) answer.getConfiguration())
.setBrokerURL(brokerURL);
}
return answer;
}
@ -62,21 +65,23 @@ public class ActiveMQComponent extends JmsComponent {
super(configuration);
}
@Override
public ActiveMQConfiguration getConfiguration() {
return (ActiveMQConfiguration) super.getConfiguration();
}
public void setBrokerURL(String brokerURL) {
getConfiguration().setBrokerURL(brokerURL);
if (getConfiguration() instanceof ActiveMQConfiguration) {
((ActiveMQConfiguration)getConfiguration()).setBrokerURL(brokerURL);
}
}
public void setUserName(String userName) {
getConfiguration().setUserName(userName);
if (getConfiguration() instanceof ActiveMQConfiguration) {
((ActiveMQConfiguration)getConfiguration()).setUserName(userName);
}
}
public void setPassword(String password) {
getConfiguration().setPassword(password);
if (getConfiguration() instanceof ActiveMQConfiguration) {
((ActiveMQConfiguration)getConfiguration()).setPassword(password);
}
}
public boolean isExposeAllQueues() {
@ -94,11 +99,15 @@ public class ActiveMQComponent extends JmsComponent {
}
public void setUsePooledConnection(boolean usePooledConnection) {
getConfiguration().setUsePooledConnection(usePooledConnection);
if (getConfiguration() instanceof ActiveMQConfiguration) {
((ActiveMQConfiguration)getConfiguration()).setUsePooledConnection(usePooledConnection);
}
}
public void setUseSingleConnection(boolean useSingleConnection) {
getConfiguration().setUseSingleConnection(useSingleConnection);
if (getConfiguration() instanceof ActiveMQConfiguration) {
((ActiveMQConfiguration)getConfiguration()).setUseSingleConnection(useSingleConnection);
}
}
@Override

View File

@ -118,8 +118,10 @@ public class CamelEndpointLoader implements InitializingBean, DisposableBean, Ca
}
public ConnectionFactory getConnectionFactory() {
if (connectionFactory == null) {
connectionFactory = getComponent().getConfiguration().createConnectionFactory();
if (connectionFactory == null
&& getComponent().getConfiguration() instanceof ActiveMQConfiguration) {
connectionFactory = ((ActiveMQConfiguration) getComponent()
.getConfiguration()).createConnectionFactory();
}
return connectionFactory;
}