Package org.apache.activemq.web
Class SpringBrokerContextListener
java.lang.Object
org.apache.activemq.web.SpringBrokerContextListener
- All Implemented Interfaces:
jakarta.servlet.ServletContextListener,EventListener
public class SpringBrokerContextListener
extends Object
implements jakarta.servlet.ServletContextListener
Used to configure and instance of ActiveMQ BrokerService using
ActiveMQ/Spring's xml configuration. The configuration file is specified
via the context init parameter brokerURI, typically:
<context-param>
<param-name>brokerURI</param-name>
<param-value>/WEB-INF/activemq.xml</param-value>
</context-param>
As a a default, if a brokerURI is not specified it will look up
for activemq.xml-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringbroker uri context parameter name: brokerURI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextDestroyed(jakarta.servlet.ServletContextEvent event) voidcontextInitialized(jakarta.servlet.ServletContextEvent event) protected org.apache.activemq.broker.BrokerServicecreateBroker(jakarta.servlet.ServletContext context) Factory method to create a new ActiveMQ Brokerprotected org.apache.activemq.broker.BrokerServiceReturn the broker container.protected voidsetBrokerService(org.apache.activemq.broker.BrokerService container) Set the broker container to be used by this listener
-
Field Details
-
INIT_PARAM_BROKER_URI
broker uri context parameter name: brokerURI- See Also:
-
-
Constructor Details
-
SpringBrokerContextListener
public SpringBrokerContextListener()
-
-
Method Details
-
setBrokerService
protected void setBrokerService(org.apache.activemq.broker.BrokerService container) Set the broker container to be used by this listener- Parameters:
container- the container to be used.
-
getBrokerService
protected org.apache.activemq.broker.BrokerService getBrokerService()Return the broker container. -
contextInitialized
public void contextInitialized(jakarta.servlet.ServletContextEvent event) - Specified by:
contextInitializedin interfacejakarta.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(jakarta.servlet.ServletContextEvent event) - Specified by:
contextDestroyedin interfacejakarta.servlet.ServletContextListener
-
createBroker
protected org.apache.activemq.broker.BrokerService createBroker(jakarta.servlet.ServletContext context) Factory method to create a new ActiveMQ Broker
-