TorqueBox 3.1.2

org.torquebox.messaging
Class Destinationizer

java.lang.Object
  extended by org.projectodd.polyglot.core.AtRuntimeInstaller<Destinationizer>
      extended by org.torquebox.messaging.Destinationizer
All Implemented Interfaces:
org.jboss.msc.service.Service<Destinationizer>, org.jboss.msc.value.Value<Destinationizer>, org.projectodd.polyglot.core.StartState

public class Destinationizer
extends org.projectodd.polyglot.core.AtRuntimeInstaller<Destinationizer>

A class to manage the destinations at runtime. It allows to create and remove destinations (queues and topics).

Author:
Marek Goldmann

Nested Class Summary
 
Nested classes/interfaces inherited from class org.projectodd.polyglot.core.AtRuntimeInstaller
org.projectodd.polyglot.core.AtRuntimeInstaller.RemovalListener
 
Field Summary
 
Fields inherited from class org.projectodd.polyglot.core.AtRuntimeInstaller
HA_SINGLETON_SERVICE_SUFFIX
 
Fields inherited from interface org.jboss.msc.service.Service
NULL, NULL_VALUE
 
Constructor Summary
Destinationizer(org.jboss.as.server.deployment.DeploymentUnit unit, org.jboss.msc.service.ServiceTarget globalServiceTarget)
           
 
Method Summary
 boolean createQueue(String queueName, boolean durable, String selector, boolean exported)
          Creates a new queue by deploying required services.
 boolean createTopic(String topicName, boolean exported)
          Creates a new topic by deploying required services.
 Map<String,org.jboss.msc.service.ServiceName> getDestinations()
           
 CountDownLatch removeDestination(String name)
          Removes the destination (queue or topic) by undeploying the services.
 void start(org.jboss.msc.service.StartContext context)
          With the service start the queues and topics listed in the metadata are deployed.
 
Methods inherited from class org.projectodd.polyglot.core.AtRuntimeInstaller
build, build, deploy, deploy, getCoordinationMap, getCoordinationMapInjector, getGlobalTarget, getName, getTarget, getUnit, getValue, hasStartedAtLeastOnce, inCluster, installMBeanFor, installMBeanFor, isStarted, mbeanName, mbeanServiceName, removeMBeanFor, removeMBeanFor, removeService, removeService, replaceService, replaceService, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Destinationizer

public Destinationizer(org.jboss.as.server.deployment.DeploymentUnit unit,
                       org.jboss.msc.service.ServiceTarget globalServiceTarget)
Method Detail

start

public void start(org.jboss.msc.service.StartContext context)
           throws org.jboss.msc.service.StartException
With the service start the queues and topics listed in the metadata are deployed.

Specified by:
start in interface org.jboss.msc.service.Service<Destinationizer>
Overrides:
start in class org.projectodd.polyglot.core.AtRuntimeInstaller<Destinationizer>
Parameters:
context -
Throws:
org.jboss.msc.service.StartException
See Also:
QueueMetaData, TopicMetaData

createQueue

public boolean createQueue(String queueName,
                           boolean durable,
                           String selector,
                           boolean exported)
Creates a new queue by deploying required services.

Parameters:
queueName - The queue name
durable - If the queue should be durable
selector - The optional selector used for the queue
exported - If the queue should be available in remote JNDI lookups
Returns:
boolean true if a new queue was created, false if it already exists
See Also:
DestroyableJMSQueueService

createTopic

public boolean createTopic(String topicName,
                           boolean exported)
Creates a new topic by deploying required services.

Parameters:
topicName - The name of the topic
exported - If the topic should be accessible in remote JNDI lookups
Returns:
boolean true if a new topic was created, false if it already exists
See Also:
DestroyableJMSTopicService

removeDestination

public CountDownLatch removeDestination(String name)
Removes the destination (queue or topic) by undeploying the services.

This method is executed asynchronously.

Parameters:
name - Name of the destination (queue or topic)
Returns:
CountDownLatch The latch to check if the service is fully stopped
See Also:
CountDownLatch

getDestinations

public Map<String,org.jboss.msc.service.ServiceName> getDestinations()

TorqueBox 3.1.2

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.