Java Code Examples for org.apache.activemq.broker.BrokerService#disableWrapper()

The following examples show how to use org.apache.activemq.broker.BrokerService#disableWrapper() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EmbeddedBrokerTestSupport.java    From activemq-artemis with Apache License 2.0 6 votes vote down vote up
@Override
protected void setUp() throws Exception {
   BrokerService.disableWrapper = disableWrapper;
   File tmpRoot = new File("./target/tmp");
   tmpRoot.mkdirs();
   temporaryFolder = new TemporaryFolder(tmpRoot);
   temporaryFolder.create();

   if (artemisBroker == null) {
      artemisBroker = createArtemisBroker();
   }
   startBroker();

   connectionFactory = createConnectionFactory();

   destination = createDestination();

   template = createJmsTemplate();
   template.setDefaultDestination(destination);
   template.setPubSubDomain(useTopic);
   template.afterPropertiesSet();
}
 
Example 2
Source File: OpenwireArtemisBaseTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
public OpenwireArtemisBaseTest() {
   File tmpRoot = new File("./target/tmp");
   tmpRoot.mkdirs();
   temporaryFolder = new TemporaryFolder(tmpRoot);
   //The wrapper stuff will automatically create a default
   //server on a normal connection factory, which will
   //cause problems with clustering tests, which starts
   //all servers explicitly. Setting this to true
   //can prevent the auto-creation from happening.
   BrokerService.disableWrapper = true;
}
 
Example 3
Source File: TcpTransportFactory.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
@Override
public Transport doConnect(URI location) throws Exception {
   //here check broker, if no broker, we start one
   Map<String, String> params = URISupport.parseParameters(location);
   String brokerId = params.remove("invmBrokerId");
   boolean autoCreate = true;
   String create = params.remove("create");
   if (create != null) {
      autoCreate = "true".equals(create);
   }

   URI location1 = URISupport.createRemainingURI(location, Collections.EMPTY_MAP);

   LOG.info("deciding whether starting an internal broker: " + brokerService + " flag: " + BrokerService.disableWrapper);
   if (autoCreate && brokerService == null && !BrokerService.disableWrapper && BrokerService.checkPort(location1.getPort())) {

      LOG.info("starting internal broker: " + location1);
      ArtemisBrokerHelper.startArtemisBroker(location1);
      brokerService = new InternalServiceInfo(location.toString());

      if (brokerId != null) {
         BrokerRegistry.getInstance().bind(brokerId, ArtemisBrokerHelper.getBroker());
         LOG.info("bound: " + brokerId);
      }
   }
   //remove unused invm parameters
   params.remove("broker.persistent");
   params.remove("broker.useJmx");
   params.remove("marshal");
   params.remove("create");
   params.remove("asyncQueueDepth");
   URI location2 = URISupport.createRemainingURI(location, params);
   return super.doConnect(location2);
}
 
Example 4
Source File: SslTransportBrokerTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
@Override
protected void setUp() throws Exception {
   BrokerService.disableWrapper = true;
   System.setProperty("javax.net.ssl.trustStore", TRUST_KEYSTORE);
   System.setProperty("javax.net.ssl.trustStorePassword", PASSWORD);
   System.setProperty("javax.net.ssl.trustStoreType", KEYSTORE_TYPE);
   System.setProperty("javax.net.ssl.keyStore", SERVER_KEYSTORE);
   System.setProperty("javax.net.ssl.keyStorePassword", PASSWORD);
   System.setProperty("javax.net.ssl.keyStoreType", KEYSTORE_TYPE);
   //System.setProperty("javax.net.debug", "ssl,handshake,data,trustmanager");

   maxWait = 10000;
   super.setUp();
}
 
Example 5
Source File: RemoveDestinationTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
   BrokerService.disableWrapper = true;
   broker = BrokerFactory.createBroker(new URI(BROKER_URL));
   broker.start();
   broker.waitUntilStarted();
}
 
Example 6
Source File: RemoveDestinationTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
@After
public void tearDown() throws Exception {
   BrokerService.disableWrapper = false;
   broker.stop();
   broker.waitUntilStopped();
   broker = null;
}
 
Example 7
Source File: ZeroPrefetchConsumerTest.java    From activemq-artemis with Apache License 2.0 4 votes vote down vote up
@Override
protected void tearDown() throws Exception {
   BrokerService.disableWrapper = false;
   connection.close();
   super.tearDown();
}
 
Example 8
Source File: TimeStampTest.java    From activemq-artemis with Apache License 2.0 4 votes vote down vote up
@Override
public void setUp() throws Exception {
   BrokerService.disableWrapper = true;
}
 
Example 9
Source File: TimeStampTest.java    From activemq-artemis with Apache License 2.0 4 votes vote down vote up
@Override
public void tearDown() {
   ArtemisBrokerHelper.stopArtemisBroker();
   BrokerService.disableWrapper = false;
}