本文整理汇总了Java中org.apache.activemq.artemis.core.config.impl.ConfigurationImpl类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationImpl类的具体用法?Java ConfigurationImpl怎么用?Java ConfigurationImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurationImpl类属于org.apache.activemq.artemis.core.config.impl包,在下文中一共展示了ConfigurationImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildArtemisBroker
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
public ActiveMQServer buildArtemisBroker() throws IOException {
Configuration configuration = new ConfigurationImpl();
configuration.setPersistenceEnabled(true);
configuration.setSecurityEnabled(false);
Map<String, Object> connectionParams = new HashMap<String, Object>();
connectionParams.put(
org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME, 61400);
configuration.setBindingsDirectory(storeFolder.newFolder().getAbsolutePath());
configuration.setJournalDirectory(storeFolder.newFolder().getAbsolutePath());
configuration.setLargeMessagesDirectory(storeFolder.newFolder().getAbsolutePath());
configuration.setPagingDirectory(storeFolder.newFolder().getAbsolutePath());
configuration.addAcceptorConfiguration(
new TransportConfiguration(NettyAcceptorFactory.class.getName(), connectionParams));
configuration.addConnectorConfiguration("connector",
new TransportConfiguration(NettyConnectorFactory.class.getName(), connectionParams));
return new ActiveMQServerImpl(configuration);
}
示例2: before
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
@Before
public void before() throws Exception {
mockTracer.reset();
org.apache.activemq.artemis.core.config.Configuration configuration = new ConfigurationImpl();
HashSet<TransportConfiguration> transports = new HashSet<>();
transports.add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
configuration.setAcceptorConfigurations(transports);
configuration.setSecurityEnabled(false);
File targetDir = new File(System.getProperty("user.dir") + "/target");
configuration.setBrokerInstance(targetDir);
server = new ActiveMQServerImpl(configuration);
server.start();
ActiveMQJMSConnectionFactory connectionFactory = new ActiveMQJMSConnectionFactory("vm://0");
connection = connectionFactory.createConnection();
connection.start();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
}
示例3: start
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
public void start() throws Exception {
org.apache.activemq.artemis.core.config.Configuration configuration = new ConfigurationImpl();
HashSet<TransportConfiguration> transports = new HashSet<>();
transports.add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
configuration.setAcceptorConfigurations(transports);
configuration.setSecurityEnabled(false);
File targetDir = new File(System.getProperty("user.dir") + "/target");
configuration.setBrokerInstance(targetDir);
ActiveMQServer temp = new ActiveMQServerImpl(configuration);
temp.start();
server = temp;
}
示例4: createConfiguration
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
public Configuration createConfiguration() {
ConfigurationImpl configuration = new ConfigurationImpl();
configuration.setSecurityEnabled(false);
configuration.setPersistenceEnabled(this.properties.isPersistent());
String dataDir = getDataDir();
configuration.setJournalDirectory(dataDir + "/journal");
if (this.properties.isPersistent()) {
configuration.setJournalType(JournalType.NIO);
configuration.setLargeMessagesDirectory(dataDir + "/largemessages");
configuration.setBindingsDirectory(dataDir + "/bindings");
configuration.setPagingDirectory(dataDir + "/paging");
}
TransportConfiguration transportConfiguration = new TransportConfiguration(
InVMAcceptorFactory.class.getName(),
this.properties.generateTransportParameters());
configuration.getAcceptorConfigurations().add(transportConfiguration);
if (this.properties.isDefaultClusterPassword()) {
logger.debug("Using default Artemis cluster password: "
+ this.properties.getClusterPassword());
}
configuration.setClusterPassword(this.properties.getClusterPassword());
return configuration;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:24,代码来源:ArtemisEmbeddedConfigurationFactory.java
示例5: start
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
public void start() throws Exception {
Configuration config = new ConfigurationImpl();
Map<String, Object> params = new LinkedHashMap<>();
params.put("protocols", "AMQP");
params.put("host", host);
params.put("port", port);
TransportConfiguration transport = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params, "amqp");
config.setAcceptorConfigurations(Collections.singleton(transport));
config.setSecurityEnabled(false);
config.setName("broker-" + System.currentTimeMillis() + port);
config.setBindingsDirectory(Files.createTempDir().getAbsolutePath());
config.setJournalDirectory(Files.createTempDir().getAbsolutePath());
config.setPagingDirectory(Files.createTempDir().getAbsolutePath());
config.setLargeMessagesDirectory(Files.createTempDir().getAbsolutePath());
config.setPersistenceEnabled(false);
server.setConfiguration(config);
server.start();
Thread.sleep(2000);
}
示例6: createConfiguration
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
public Configuration createConfiguration() {
ConfigurationImpl configuration = new ConfigurationImpl();
configuration.setSecurityEnabled(false);
configuration.setPersistenceEnabled(this.properties.isPersistent());
String dataDir = getDataDir();
configuration.setJournalDirectory(dataDir + "/journal");
if (this.properties.isPersistent()) {
configuration.setJournalType(JournalType.NIO);
configuration.setLargeMessagesDirectory(dataDir + "/largemessages");
configuration.setBindingsDirectory(dataDir + "/bindings");
configuration.setPagingDirectory(dataDir + "/paging");
}
TransportConfiguration transportConfiguration = new TransportConfiguration(
InVMAcceptorFactory.class.getName(),
this.properties.generateTransportParameters());
configuration.getAcceptorConfigurations().add(transportConfiguration);
if (this.properties.isDefaultClusterPassword()) {
this.logger.debug("Using default Artemis cluster password: "
+ this.properties.getClusterPassword());
}
configuration.setClusterPassword(this.properties.getClusterPassword());
return configuration;
}
示例7: setup
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
@BeforeClass
public static void setup() throws Exception {
Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
activeMQServer.start();
HashMap<String, Object> transportConfig = new HashMap<>();
serverLocator = new ServerLocatorImpl(false, new TransportConfiguration(InVMConnectorFactory.class.getName(), transportConfig));
sessionFactory = serverLocator.createSessionFactory();
consumerSessionFactory = serverLocator.createSessionFactory();
SimpleString addr = SimpleString.toSimpleString("testQueue");
activeMQServer.addAddressInfo(new AddressInfo(addr, RoutingType.MULTICAST));
activeMQServer.createQueue(addr, RoutingType.MULTICAST, addr, null, false, false);
session = sessionFactory.createSession(true, true);
producer = session.createProducer(addr);
session.start();
}
示例8: process
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
public void process(OutputStream out,
String bindingsDir,
String journalDir,
String pagingDir,
String largeMessagesDir) throws Exception {
config = new ConfigurationImpl().setBindingsDirectory(bindingsDir).setJournalDirectory(journalDir).setPagingDirectory(pagingDir).setLargeMessagesDirectory(largeMessagesDir).setJournalType(JournalType.NIO);
final ExecutorService executor = Executors.newFixedThreadPool(5, ActiveMQThreadFactory.defaultThreadFactory());
ExecutorFactory executorFactory = new OrderedExecutorFactory(executor);
storageManager = new JournalStorageManager(config, EmptyCriticalAnalyzer.getInstance(), executorFactory, executorFactory);
XMLOutputFactory factory = XMLOutputFactory.newInstance();
XMLStreamWriter rawXmlWriter = factory.createXMLStreamWriter(out, "UTF-8");
PrettyPrintHandler handler = new PrettyPrintHandler(rawXmlWriter);
xmlWriter = (XMLStreamWriter) Proxy.newProxyInstance(XMLStreamWriter.class.getClassLoader(), new Class[]{XMLStreamWriter.class}, handler);
writeXMLData();
executor.shutdown();
}
示例9: createSecondaryDefaultConfig
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
protected Configuration createSecondaryDefaultConfig(boolean secondary) throws Exception {
HashMap<String, Object> invmMap = new HashMap<>();
HashMap<String, Object> nettyMap = new HashMap<>();
String primaryConnectorName = "invm2";
String secondaryConnectorName = "invm";
int index = 0;
if (secondary) {
invmMap.put(TransportConstants.SERVER_ID_PROP_NAME, "1");
nettyMap.put("port", "5545");
primaryConnectorName = "invm";
secondaryConnectorName = "invm2";
index = 1;
}
ConfigurationImpl configuration = createBasicConfig(index).setJMXManagementEnabled(false).clearAcceptorConfigurations().addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY, invmMap)).addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, nettyMap)).addConnectorConfiguration(secondaryConnectorName, secondaryConnector).addConnectorConfiguration(primaryConnectorName, primaryConnector).addClusterConfiguration(ActiveMQTestBase.basicClusterConnectionConfig(secondaryConnectorName, primaryConnectorName).setReconnectAttempts(0));
recreateDataDirectories(getTestDir(), index, false);
return configuration;
}
示例10: setUp
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName()));
testDir = temporaryFolder.getRoot().getAbsolutePath();
LegacyLDAPSecuritySettingPlugin legacyLDAPSecuritySettingPlugin = new LegacyLDAPSecuritySettingPlugin();
Map<String, String> map = new HashMap<>();
map.put(LegacyLDAPSecuritySettingPlugin.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_URL, "ldap://localhost:1024");
map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_USERNAME, "uid=admin,ou=system");
map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_PASSWORD, "secret");
map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_PROTOCOL, "s");
map.put(LegacyLDAPSecuritySettingPlugin.AUTHENTICATION, "simple");
map.put(LegacyLDAPSecuritySettingPlugin.ENABLE_LISTENER, "true");
legacyLDAPSecuritySettingPlugin.init(map);
ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin");
Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false)).setPersistenceEnabled(false).addSecuritySettingPlugin(legacyLDAPSecuritySettingPlugin);
server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false);
}
示例11: setUp
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
Map<String, Object> params = new HashMap<>();
params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
params.put(TransportConstants.KEYSTORE_PATH_PROP_NAME, SERVER_SIDE_KEYSTORE);
params.put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, PASSWORD);
params.put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, SERVER_SIDE_TRUSTSTORE);
params.put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);
params.put(TransportConstants.TRUSTSTORE_PROVIDER_PROP_NAME, storeType);
params.put(TransportConstants.KEYSTORE_PROVIDER_PROP_NAME, storeType);
params.put(TransportConstants.NEED_CLIENT_AUTH_PROP_NAME, true);
ConfigurationImpl config = createBasicConfig().addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params, "nettySSL"));
server = createServer(false, config);
server.start();
waitForServerToStart(server);
tc = new TransportConfiguration(NETTY_CONNECTOR_FACTORY);
}
示例12: setUp
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
ConfigurationImpl configuration = (ConfigurationImpl) createDefaultInVMConfig().setMessageExpiryScanPeriod(1000);
server = addServer(ActiveMQServers.newActiveMQServer(configuration, false));
// start the server
server.start();
// then we create a client as normal
locator = createInVMNonHALocator().setBlockOnAcknowledge(true);
ClientSessionFactory sessionFactory = createSessionFactory(locator);
clientSession = sessionFactory.createSession(false, true, true);
clientSession.createQueue(qName, RoutingType.MULTICAST, qName, null, false);
expiryAddress = new SimpleString("EA");
expiryQueue = new SimpleString("expiryQ");
AddressSettings addressSettings = new AddressSettings().setExpiryAddress(expiryAddress);
server.getAddressSettingsRepository().addMatch(qName.toString(), addressSettings);
server.getAddressSettingsRepository().addMatch(qName2.toString(), addressSettings);
clientSession.createQueue(expiryAddress, RoutingType.MULTICAST, expiryQueue, null, false);
}
示例13: createConfig
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
protected Configuration createConfig(final String hostAddress, final int serverID, final int port) throws Exception {
ConfigurationImpl configuration = new ConfigurationImpl().setJMXManagementEnabled(false).
setSecurityEnabled(false).setJournalMinFiles(2).setJournalFileSize(1000 * 1024).setJournalType(JournalType.NIO).
setJournalDirectory(getJournalDir(serverID, false)).
setBindingsDirectory(getBindingsDir(serverID, false)).
setPagingDirectory(getPageDir(serverID, false)).
setLargeMessagesDirectory(getLargeMessagesDir(serverID, false)).
setJournalCompactMinFiles(0).
setJournalCompactPercentage(0).
setClusterPassword(CLUSTER_PASSWORD);
configuration.addAddressesSetting("#", new AddressSettings().setAutoCreateJmsQueues(true).setAutoDeleteJmsQueues(true));
configuration.addAcceptorConfiguration("netty", newURIwithPort(hostAddress, port));
configuration.addConnectorConfiguration("netty-connector", newURIwithPort(hostAddress, port));
return configuration;
}
示例14: createConfig
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
protected Configuration createConfig(final String hostAddress, final int serverID) throws Exception {
ConfigurationImpl configuration = new ConfigurationImpl().setJMXManagementEnabled(false).
setSecurityEnabled(false).setJournalMinFiles(2).setJournalFileSize(1000 * 1024).setJournalType(JournalType.NIO).
setJournalDirectory(getJournalDir(serverID, false)).
setBindingsDirectory(getBindingsDir(serverID, false)).
setPagingDirectory(getPageDir(serverID, false)).
setLargeMessagesDirectory(getLargeMessagesDir(serverID, false)).
setJournalCompactMinFiles(0).
setJournalCompactPercentage(0).
setClusterPassword(CLUSTER_PASSWORD);
configuration.addAddressesSetting("#", new AddressSettings().setAutoCreateJmsQueues(true).setAutoDeleteJmsQueues(true));
configuration.addAcceptorConfiguration("netty", newURI(hostAddress, serverID));
configuration.addConnectorConfiguration("netty-connector", newURI(hostAddress, serverID));
return configuration;
}
示例15: startServer
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入依赖的package包/类
public static ActiveMQServer startServer() throws Exception {
if (server == null) {
Configuration config = new ConfigurationImpl().addAcceptorConfiguration("netty", "tcp://localhost:61616").setSecurityEnabled(false).addConnectorConfiguration("netty", "tcp://localhost:61616");
File dataPlace = new File("./target/dataJoram");
FileUtil.deleteDirectory(dataPlace);
config.setJournalDirectory(new File(dataPlace, "./journal").getAbsolutePath()).
setPagingDirectory(new File(dataPlace, "./paging").getAbsolutePath()).
setLargeMessagesDirectory(new File(dataPlace, "./largemessages").getAbsolutePath()).
setBindingsDirectory(new File(dataPlace, "./bindings").getAbsolutePath()).setPersistenceEnabled(true);
// disable server persistence since JORAM tests do not restart server
server = ActiveMQServers.newActiveMQServer(config, useFiles);
serverManager = new JMSServerManagerImpl(server);
serverManager.start();
}
return server;
}