Search in sources :

Example 1 with MessageServiceManager

use of org.apache.activemq.artemis.rest.MessageServiceManager in project activemq-artemis by apache.

the class PersistentPushQueueConsumerTest method startup.

public static void startup() throws Exception {
    Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
    activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
    activeMQServer.start();
    deployment = EmbeddedContainer.start();
    manager = new MessageServiceManager(null);
    manager.start();
    deployment.getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
    deployment.getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) MessageServiceManager(org.apache.activemq.artemis.rest.MessageServiceManager) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) ConfigurationImpl(org.apache.activemq.artemis.core.config.impl.ConfigurationImpl)

Example 2 with MessageServiceManager

use of org.apache.activemq.artemis.rest.MessageServiceManager in project activemq-artemis by apache.

the class PersistentPushTopicConsumerTest method startup.

public static void startup() throws Exception {
    deployment = EmbeddedContainer.start();
    manager = new MessageServiceManager(null);
    manager.start();
    deployment.getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
    deployment.getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
    deployment.getRegistry().addPerRequestResource(Receiver.class);
}
Also used : MessageServiceManager(org.apache.activemq.artemis.rest.MessageServiceManager)

Example 3 with MessageServiceManager

use of org.apache.activemq.artemis.rest.MessageServiceManager in project activemq-artemis by apache.

the class RestMessagingBootstrapListener method contextInitialized.

@Override
public void contextInitialized(ServletContextEvent contextEvent) {
    ServletContext context = contextEvent.getServletContext();
    Registry registry = (Registry) context.getAttribute(Registry.class.getName());
    if (registry == null) {
        throw new RuntimeException("You must install RESTEasy as a Bootstrap Listener and it must be listed before this class");
    }
    String configfile = context.getInitParameter("rest.messaging.config.file");
    deserializationBlackList = context.getInitParameter(ObjectInputStreamWithClassLoader.BLACKLIST_PROPERTY);
    deserializationWhiteList = context.getInitParameter(ObjectInputStreamWithClassLoader.WHITELIST_PROPERTY);
    manager = new MessageServiceManager(this);
    if (configfile != null) {
        manager.setConfigResourcePath(configfile);
    }
    try {
        manager.start();
        registry.addSingletonResource(manager.getQueueManager().getDestination());
        registry.addSingletonResource(manager.getTopicManager().getDestination());
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : MessageServiceManager(org.apache.activemq.artemis.rest.MessageServiceManager) ServletContext(javax.servlet.ServletContext) Registry(org.jboss.resteasy.spi.Registry)

Aggregations

MessageServiceManager (org.apache.activemq.artemis.rest.MessageServiceManager)3 ServletContext (javax.servlet.ServletContext)1 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)1 Configuration (org.apache.activemq.artemis.core.config.Configuration)1 ConfigurationImpl (org.apache.activemq.artemis.core.config.impl.ConfigurationImpl)1 Registry (org.jboss.resteasy.spi.Registry)1