Class EmbeddedActiveMQ

java.lang.Object
org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ
Direct Known Subclasses:
EmbeddedJMS

public class EmbeddedActiveMQ extends Object
Helper class to simplify bootstrap of ActiveMQ Artemis server. Bootstraps from classpath-based config files.
  • Field Details

  • Constructor Details

    • EmbeddedActiveMQ

      public EmbeddedActiveMQ()
  • Method Details

    • setConfigResourcePath

      public EmbeddedActiveMQ setConfigResourcePath(String filename)
      Classpath resource for activemq server config. Defaults to 'broker.xml'.
    • setPropertiesResourcePath

      public EmbeddedActiveMQ setPropertiesResourcePath(String filename)
      Classpath resource for broker properties file. Defaults to 'broker.properties'.
    • setSecurityManager

      public EmbeddedActiveMQ setSecurityManager(ActiveMQSecurityManager securityManager)
      Set the activemq security manager. This defaults to org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl
    • waitClusterForming

      public boolean waitClusterForming(long timeWait, TimeUnit unit, int iterations, int servers) throws Exception
      It will iterate the cluster connections until you have at least the number of expected servers
      Parameters:
      timeWait - Time to wait on each iteration
      unit - unit of time to wait
      iterations - number of iterations
      servers - number of minimal servers
      Throws:
      Exception
    • setMbeanServer

      public EmbeddedActiveMQ setMbeanServer(MBeanServer mbeanServer)
      Use this mbean server to register management beans. If not set, no mbeans will be registered.
    • setConfiguration

      public EmbeddedActiveMQ setConfiguration(Configuration configuration)
      Set this object if you are not using file-based configuration. The default implementation will load configuration from a file.
    • getConfiguration

      public Configuration getConfiguration()
    • getActiveMQServer

      public ActiveMQServer getActiveMQServer()
    • start

      public EmbeddedActiveMQ start() throws Exception
      Throws:
      Exception
    • createActiveMQServer

      public void createActiveMQServer() throws Exception
      Throws:
      Exception
    • stop

      public EmbeddedActiveMQ stop() throws Exception
      Throws:
      Exception