Package net.timewalker.ffmq4.local
Class FFMQEngine
- java.lang.Object
-
- net.timewalker.ffmq4.local.FFMQEngine
-
- All Implemented Interfaces:
FFMQEngineMBean
public final class FFMQEngine extends Object implements FFMQEngineMBean
Implementation of the core FFMQ engine.
Typically created by an FFMQServer instance, but can also be created manually to be embedded directly in the using application JVM.
-
-
Constructor Summary
Constructors Constructor Description FFMQEngine(String name, Settings engineSettings)ConstructorFFMQEngine(String name, Settings engineSettings, FFMQEngineListener listener)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckDeployed()Check that the engine is runningLocalQueuecreateQueue(QueueDefinition queueDef)Deploy a new queue on this engineLocalQueuecreateTemporaryQueue(String queueName)Deploy a new temporary queue on this engineLocalTopiccreateTemporaryTopic(String topicName)Deploy a new temporary topic on this engineLocalTopiccreateTopic(TopicDefinition topicDef)Create a new topicvoiddeleteQueue(String queueName)Undeploy a queuevoiddeleteQueue(String queueName, boolean force)Undeploy a queuevoiddeleteTopic(String topicName)Undeploy a topicvoiddeploy()AsyncTaskManagergetDeliveryAsyncTaskManager()Get the engine async. delivery task managerstatic FFMQEnginegetDeployedInstance(String name)Get a deployed engine instance by nameDestinationDefinitionProvidergetDestinationDefinitionProvider()DestinationTemplateProvidergetDestinationTemplateProvider()Get the destination template provider associated to this engineAsyncTaskManagergetDiskIOAsyncTaskManager()Get the engine async. disk I/O task managerLocalQueuegetLocalQueue(String queueName)Get a local queue by nameLocalTopicgetLocalTopic(String topicName)Get a local topic by nameStringgetName()Get the engine nameAsyncTaskManagergetNotificationAsyncTaskManager()Get the engine async. notification task managerFFMQEngineSetupgetSetup()Get the engine setupTemplateMappingProvidergetTemplateMappingProvider()Get the template mapping provider associated to this enginebooleanisDeployed()Test if the engine is deployedbooleanisSecurityEnabled()Test if security checks are enabled on that enginebooleanlocalQueueExists(String queueName)Test if a local queue exists by namebooleanlocalTopicExists(String topicName)Test if a local topic exists by namejavax.jms.ConnectionopenConnection(String userName, String password, String clientID)Open a new connectionjavax.jms.QueueConnectionopenQueueConnection(String userName, String password, String clientID)Open a new queue connectionjavax.jms.TopicConnectionopenTopicConnection(String userName, String password, String clientID)Open a new topic connectionvoidresetAllStatistics()Reset all engine statistics (queues and topics stats)voidsubscribe(String clientID, String subscriptionName)voidundeploy()voidunsubscribe(String clientID, String subscriptionName)Unsubscribe a durable subscriber from all related topics
-
-
-
Constructor Detail
-
FFMQEngine
public FFMQEngine(String name, Settings engineSettings) throws FFMQException
Constructor- Throws:
FFMQException- on configuration error
-
FFMQEngine
public FFMQEngine(String name, Settings engineSettings, FFMQEngineListener listener) throws FFMQException
Constructor- Throws:
FFMQException- on configuration error
-
-
Method Detail
-
getDeployedInstance
public static FFMQEngine getDeployedInstance(String name) throws javax.jms.JMSException
Get a deployed engine instance by name- Throws:
javax.jms.JMSException
-
getName
public String getName()
Description copied from interface:FFMQEngineMBeanGet the engine name- Specified by:
getNamein interfaceFFMQEngineMBean- Returns:
- the name
-
checkDeployed
protected void checkDeployed() throws javax.jms.JMSExceptionCheck that the engine is running- Throws:
javax.jms.JMSException
-
isDeployed
public boolean isDeployed()
Description copied from interface:FFMQEngineMBeanTest if the engine is deployed- Specified by:
isDeployedin interfaceFFMQEngineMBean
-
isSecurityEnabled
public boolean isSecurityEnabled()
Description copied from interface:FFMQEngineMBeanTest if security checks are enabled on that engine- Specified by:
isSecurityEnabledin interfaceFFMQEngineMBean
-
deploy
public void deploy() throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
getDestinationTemplateProvider
public DestinationTemplateProvider getDestinationTemplateProvider()
Get the destination template provider associated to this engine- Returns:
- the destination template provider associated to this engine
-
getTemplateMappingProvider
public TemplateMappingProvider getTemplateMappingProvider()
Get the template mapping provider associated to this engine- Returns:
- the template mapping provider associated to this engine
-
getSetup
public FFMQEngineSetup getSetup()
Get the engine setup
-
undeploy
public void undeploy()
-
openConnection
public javax.jms.Connection openConnection(String userName, String password, String clientID) throws javax.jms.JMSException
Open a new connection- Throws:
javax.jms.JMSException
-
openQueueConnection
public javax.jms.QueueConnection openQueueConnection(String userName, String password, String clientID) throws javax.jms.JMSException
Open a new queue connection- Throws:
javax.jms.JMSException
-
openTopicConnection
public javax.jms.TopicConnection openTopicConnection(String userName, String password, String clientID) throws javax.jms.JMSException
Open a new topic connection- Throws:
javax.jms.JMSException
-
createTemporaryQueue
public LocalQueue createTemporaryQueue(String queueName) throws javax.jms.JMSException
Deploy a new temporary queue on this engine- Throws:
javax.jms.JMSException
-
createQueue
public LocalQueue createQueue(QueueDefinition queueDef) throws javax.jms.JMSException
Deploy a new queue on this engine- Throws:
javax.jms.JMSException
-
createTemporaryTopic
public LocalTopic createTemporaryTopic(String topicName) throws javax.jms.JMSException
Deploy a new temporary topic on this engine- Throws:
javax.jms.JMSException
-
createTopic
public LocalTopic createTopic(TopicDefinition topicDef) throws javax.jms.JMSException
Create a new topic- Throws:
javax.jms.JMSException
-
deleteQueue
public void deleteQueue(String queueName) throws javax.jms.JMSException
Undeploy a queue- Throws:
javax.jms.JMSException
-
deleteQueue
public void deleteQueue(String queueName, boolean force) throws javax.jms.JMSException
Undeploy a queue- Throws:
javax.jms.JMSException
-
deleteTopic
public void deleteTopic(String topicName) throws javax.jms.JMSException
Undeploy a topic- Throws:
javax.jms.JMSException
-
getLocalQueue
public LocalQueue getLocalQueue(String queueName) throws javax.jms.JMSException
Get a local queue by name- Throws:
javax.jms.JMSException
-
localQueueExists
public boolean localQueueExists(String queueName) throws javax.jms.JMSException
Test if a local queue exists by name- Throws:
javax.jms.JMSException
-
getLocalTopic
public LocalTopic getLocalTopic(String topicName) throws javax.jms.JMSException
Get a local topic by name- Throws:
javax.jms.JMSException
-
localTopicExists
public boolean localTopicExists(String topicName) throws javax.jms.JMSException
Test if a local topic exists by name- Throws:
javax.jms.JMSException
-
subscribe
public void subscribe(String clientID, String subscriptionName) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
unsubscribe
public void unsubscribe(String clientID, String subscriptionName) throws javax.jms.JMSException
Unsubscribe a durable subscriber from all related topics- Throws:
javax.jms.JMSException
-
getNotificationAsyncTaskManager
public AsyncTaskManager getNotificationAsyncTaskManager() throws javax.jms.JMSException
Get the engine async. notification task manager- Returns:
- the engine async. notification task manager
- Throws:
javax.jms.JMSException
-
getDeliveryAsyncTaskManager
public AsyncTaskManager getDeliveryAsyncTaskManager() throws javax.jms.JMSException
Get the engine async. delivery task manager- Returns:
- the engine async. delivery task manager
- Throws:
javax.jms.JMSException
-
getDiskIOAsyncTaskManager
public AsyncTaskManager getDiskIOAsyncTaskManager() throws javax.jms.JMSException
Get the engine async. disk I/O task manager- Returns:
- the engine async. disk I/O task manager
- Throws:
javax.jms.JMSException
-
getDestinationDefinitionProvider
public DestinationDefinitionProvider getDestinationDefinitionProvider()
- Returns:
- the destinationDefinitionProvider
-
resetAllStatistics
public void resetAllStatistics()
Description copied from interface:FFMQEngineMBeanReset all engine statistics (queues and topics stats)- Specified by:
resetAllStatisticsin interfaceFFMQEngineMBean
-
-