Author: jmesnil
Date: 2009-11-06 05:46:19 -0500 (Fri, 06 Nov 2009)
New Revision: 8237
Modified:
trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
Log:
JMS Server configuration
* do not start the file deployment manager if the JMSServer does not use config files
(but a JMSConfiguration object instead)
Modified: trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2009-11-06
10:34:51 UTC (rev 8236)
+++ trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2009-11-06
10:46:19 UTC (rev 8237)
@@ -49,6 +49,14 @@
/**
* A Deployer used to create and add to JNDI queues, topics and connection
* factories. Typically this would only be used in an app server env.
+ *
+ * JMS Connection Factories & Destinations can be configured either
+ * using configuration files or using a JMSConfiguration object.
+ *
+ * If configuration files are used, JMS resources are redeployed if the
+ * files content is changed.
+ * If a JMSConfiguration object is used, the JMS resources can not be
+ * redeployed.
*
* @author <a href="ataylor(a)redhat.com">Andy Taylor</a>
* @author <a href="jmesnil(a)redhat.com">Jeff Mesnil</a>
@@ -124,18 +132,22 @@
{
jmsManagementService.registerJMSServer(this);
- jmsDeployer = new JMSServerDeployer(this, deploymentManager,
server.getConfiguration());
-
+ // start the JMS deployer only if the configuration is using configuration
files
if (configFileName != null)
{
+ jmsDeployer = new JMSServerDeployer(this, deploymentManager,
server.getConfiguration());
+
jmsDeployer.setConfigFileNames(new String[] { configFileName });
- }
- jmsDeployer.start();
+ jmsDeployer.start();
- deploymentManager.start();
+ deploymentManager.start();
+ }
- deploy();
+ if (config != null)
+ {
+ deploy();
+ }
}
catch (Exception e)
{
@@ -157,8 +169,11 @@
context = new InitialContext();
}
- deploymentManager = new
FileDeploymentManager(server.getConfiguration().getFileDeployerScanPeriod());
-
+ if (configFileName != null)
+ {
+ deploymentManager = new
FileDeploymentManager(server.getConfiguration().getFileDeployerScanPeriod());
+ }
+
server.registerActivateCallback(this);
server.start();
@@ -178,7 +193,10 @@
jmsDeployer.stop();
}
- deploymentManager.stop();
+ if (deploymentManager != null)
+ {
+ deploymentManager.stop();
+ }
for (String destination : destinations.keySet())
{
Show replies by date