org.apache.activemq.artemis.jms.server.embedded

## Class EmbeddedJMS

- java.lang.Object
- - org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ
  - - org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS

-     public class EmbeddedJMS
      extends org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ

  Simple bootstrap class that parses activemq config files (server and jms and security) and starts an ActiveMQServer instance and populates it with configured JMS endpoints.

  JMS Endpoints are registered with a simple MapBindingRegistry. If you want to use a different registry you must set the registry property of this class or call the setRegistry() method if you want to use JNDI

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Context` | `context`
    `protected JMSConfiguration` | `jmsConfiguration`
    `protected BindingRegistry` | `registry`
    `protected JMSServerManagerImpl` | `serverManager`

    - ### Fields inherited from class org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ

      `activeMQServer, configResourcePath, configuration, mbeanServer, securityManager`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmbeddedJMS()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `JMSServerManager` | `getJMSServerManager()`
    `BindingRegistry` | `getRegistry()`
    `Object` | `lookup(String name)` Lookup in the registry for registered object, i.e.
    `EmbeddedJMS` | `setConfiguration(org.apache.activemq.artemis.core.config.Configuration configuration)` Set this object if you are not using file-based configuration.
    `EmbeddedJMS` | `setContext(Context context)` If you want to use JNDI instead of an internal map, set this property
    `EmbeddedJMS` | `setJmsConfiguration(JMSConfiguration jmsConfiguration)` By default, this class uses file-based configuration.
    `EmbeddedJMS` | `setRegistry(BindingRegistry registry)` Only set this property if you are using a custom BindingRegistry
    `EmbeddedJMS` | `start()`
    `EmbeddedJMS` | `stop()`

    - ### Methods inherited from class org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ

      `getActiveMQServer, initStart, setConfigResourcePath, setMbeanServer, setSecurityManager, waitClusterForming`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### serverManager

          protected JMSServerManagerImpl serverManager

    - #### registry

          protected BindingRegistry registry

    - #### jmsConfiguration

          protected JMSConfiguration jmsConfiguration

    - #### context

          protected Context context

  - ### Constructor Detail

    - #### EmbeddedJMS

          public EmbeddedJMS()

  - ### Method Detail

    - #### getRegistry

          public BindingRegistry getRegistry()

    - #### getJMSServerManager

          public JMSServerManager getJMSServerManager()

    - #### setRegistry

          public EmbeddedJMS setRegistry(BindingRegistry registry)

      Only set this property if you are using a custom BindingRegistry
      Parameters:
        `registry` -

    - #### setJmsConfiguration

          public EmbeddedJMS setJmsConfiguration(JMSConfiguration jmsConfiguration)

      By default, this class uses file-based configuration. Set this property to override it.
      Parameters:
        `jmsConfiguration` -

    - #### setContext

          public EmbeddedJMS setContext(Context context)

      If you want to use JNDI instead of an internal map, set this property
      Parameters:
        `context` -

    - #### setConfiguration

          public EmbeddedJMS setConfiguration(org.apache.activemq.artemis.core.config.Configuration configuration)

      Description copied from class: `org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ`
      Set this object if you are not using file-based configuration. The default implementation will load configuration from a file.
      Overrides:
        `setConfiguration` in class `org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ`

    - #### lookup

          public Object lookup(String name)

      Lookup in the registry for registered object, i.e. a ConnectionFactory.

      This is a convenience method.

      Parameters:
        `name` -

    - #### start

          public EmbeddedJMS start()
                            throws Exception

      Overrides:
        `start` in class `org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ`
      Throws:
        `Exception`

    - #### stop

          public EmbeddedJMS stop()
                           throws Exception

      Overrides:
        `stop` in class `org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ`
      Throws:
        `Exception`

Copyright © 2017 The Apache Software Foundation. All rights reserved.