org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.setPassword()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.setPassword()方法的一些代码示例,展示了ActiveMQConnectionFactory.setPassword()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActiveMQConnectionFactory.setPassword()方法的具体详情如下:
包路径:org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
类名称:ActiveMQConnectionFactory
方法名:setPassword

ActiveMQConnectionFactory.setPassword介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

/**
* For compatibility and users used to this kind of constructor
*/
public ActiveMQConnectionFactory(String url, String user, String password) {
 this(url);
 setUser(user).setPassword(password);
}

代码示例来源:origin: wildfly/wildfly

private void setBrokerURL(String brokerURL) {
 ConnectionFactoryParser cfParser = new ConnectionFactoryParser();
 try {
   URI uri = cfParser.expandURI(brokerURL);
   serverLocator = ServerLocatorImpl.newLocator(uri);
   cfParser.populateObject(uri, this);
 } catch (Exception e) {
   throw new RuntimeException(e.getMessage(), e);
 }
 if (getUser() == null) {
   setUser(DefaultConnectionProperties.DEFAULT_USER);
 }
 if (getPassword() == null) {
   setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* For compatibility and users used to this kind of constructor
*/
public ActiveMQConnectionFactory(String url, String user, String password) {
 this(url);
 setUser(user).setPassword(password);
}

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

/**
* For compatibility and users used to this kind of constructor
*/
public ActiveMQConnectionFactory(String url, String user, String password) {
 this(url);
 setUser(user).setPassword(password);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
* For compatibility and users used to this kind of constructor
*/
public ActiveMQConnectionFactory(String url, String user, String password) {
 this(url);
 setUser(user).setPassword(password);
}

代码示例来源:origin: apache/activemq-artemis

/**
* For compatibility and users used to this kind of constructor
*/
public ActiveMQConnectionFactory(String url, String user, String password) {
 this(url);
 setUser(user).setPassword(password);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

private void setBrokerURL(String brokerURL) {
 ConnectionFactoryParser cfParser = new ConnectionFactoryParser();
 try {
   URI uri = cfParser.expandURI(brokerURL);
   serverLocator = ServerLocatorImpl.newLocator(uri);
   cfParser.populateObject(uri, this);
 } catch (Exception e) {
   throw new RuntimeException(e.getMessage(), e);
 }
 if (getUser() == null) {
   setUser(DefaultConnectionProperties.DEFAULT_USER);
 }
 if (getPassword() == null) {
   setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD);
 }
}

代码示例来源:origin: apache/activemq-artemis

private void setBrokerURL(String brokerURL) {
 ConnectionFactoryParser cfParser = new ConnectionFactoryParser();
 try {
   URI uri = cfParser.expandURI(brokerURL);
   serverLocator = ServerLocatorImpl.newLocator(uri);
   cfParser.populateObject(uri, this);
 } catch (Exception e) {
   throw new RuntimeException(e.getMessage(), e);
 }
 if (getUser() == null) {
   setUser(DefaultConnectionProperties.DEFAULT_USER);
 }
 if (getPassword() == null) {
   setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD);
 }
}

代码示例来源:origin: apache/activemq-artemis

private void setBrokerURL(String brokerURL) {
 ConnectionFactoryParser cfParser = new ConnectionFactoryParser();
 try {
   URI uri = cfParser.expandURI(brokerURL);
   serverLocator = ServerLocatorImpl.newLocator(uri);
   cfParser.populateObject(uri, this);
 } catch (Exception e) {
   throw new RuntimeException(e.getMessage(), e);
 }
 if (getUser() == null) {
   setUser(DefaultConnectionProperties.DEFAULT_USER);
 }
 if (getPassword() == null) {
   setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD);
 }
}

代码示例来源:origin: apache/activemq-artemis

private ActiveMQConnectionFactory getActiveMQConnectionFactory(String user, String password) {
 ActiveMQConnectionFactory activeMQConnection = new ActiveMQConnectionFactory("tcp://localhost:61616");
 activeMQConnection.setUser(user);
 activeMQConnection.setPassword(password);
 return activeMQConnection;
}

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

private void setBrokerURL(String brokerURL) {
 ConnectionFactoryParser cfParser = new ConnectionFactoryParser();
 try {
   URI uri = cfParser.expandURI(brokerURL);
   serverLocator = ServerLocatorImpl.newLocator(uri);
   cfParser.populateObject(uri, this);
 } catch (Exception e) {
   throw new RuntimeException(e.getMessage(), e);
 }
 if (getUser() == null) {
   setUser(DefaultConnectionProperties.DEFAULT_USER);
 }
 if (getPassword() == null) {
   setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD);
 }
}

代码示例来源:origin: apache/activemq-artemis

private ActiveMQConnectionFactory createConnectionFactory() throws Exception {
   Map<String, Object> params = new HashMap<>();
   params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "1");
   final ActiveMQConnectionFactory activeMQConnectionFactory;
   if (configuration.getUrl() != null) {
     activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactory(configuration.getUrl(), null);
   } else {
     if (configuration.getHost() != null) {
      params.put(TransportConstants.HOST_PROP_NAME, configuration.getHost());
      params.put(TransportConstants.PORT_PROP_NAME, configuration.getPort());
     }
     if (configuration.isHa()) {
      activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, new TransportConfiguration(configuration.getConnectorFactory(), params));
     } else {
      activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(configuration.getConnectorFactory(), params));
     }
   }
   if (configuration.hasAuthentication()) {
     activeMQConnectionFactory.setUser(configuration.getUsername());
     activeMQConnectionFactory.setPassword(configuration.getPassword());
   }
   // The CF will probably be GCed since it was injected, so we disable the finalize check
   return activeMQConnectionFactory.disableFinalizeChecks();
  }
}

代码示例来源:origin: org.apache.activemq/artemis-cdi-client

private ActiveMQConnectionFactory createConnectionFactory() throws Exception {
   Map<String, Object> params = new HashMap<>();
   params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "1");
   final ActiveMQConnectionFactory activeMQConnectionFactory;
   if (configuration.getUrl() != null) {
     activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactory(configuration.getUrl(), null);
   } else {
     if (configuration.getHost() != null) {
      params.put(TransportConstants.HOST_PROP_NAME, configuration.getHost());
      params.put(TransportConstants.PORT_PROP_NAME, configuration.getPort());
     }
     if (configuration.isHa()) {
      activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, new TransportConfiguration(configuration.getConnectorFactory(), params));
     } else {
      activeMQConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(configuration.getConnectorFactory(), params));
     }
   }
   if (configuration.hasAuthentication()) {
     activeMQConnectionFactory.setUser(configuration.getUsername());
     activeMQConnectionFactory.setPassword(configuration.getPassword());
   }
   // The CF will probably be GCed since it was injected, so we disable the finalize check
   return activeMQConnectionFactory.disableFinalizeChecks();
  }
}

代码示例来源:origin: apache/activemq-artemis

factory.setClientID(clientID);
factory.setUser(user);
factory.setPassword(password);
factory.setClientFailureCheckPeriod(clientFailureCheckPeriod);
factory.setConnectionTTL(connectionTTL);

相关文章

微信公众号

最新文章

更多

ActiveMQConnectionFactory类方法