User: mnf999
Date: 02/01/20 07:09:48
Modified: src/main/org/jboss/mq/server QueueManager.java
TopicManager.java
Log:
Be more quiet on existing topics, print a warn
Revision Changes Path
1.9 +10 -2 jbossmq/src/main/org/jboss/mq/server/QueueManager.java
Index: QueueManager.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/server/QueueManager.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- QueueManager.java 2001/12/09 07:31:39 1.8
+++ QueueManager.java 2002/01/20 15:09:47 1.9
@@ -29,7 +29,7 @@
*
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author <a href="[EMAIL PROTECTED]">Hiram Chirino</a>
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public class QueueManager
extends ServiceMBeanSupport
@@ -110,13 +110,21 @@
queue = new SpyQueue(queueName);
destination = new JMSQueue(queue, null, server);
- server.addDestination(queue, destination);
+
+// server.addDestination(queue, destination);
+
+ try {
+ server.addDestination(queue, destination);
+
//server.getPersistenceManager().initQueue(destination);
server.getPersistenceManager().restoreQueue(destination, queue);
if (jndiName == null)
setJNDIName("queue/"+queueName);
else
setJNDIName(jndiName); //in config phase, all we did was store the name,
and not actually bind
+ }
+ catch (JMSException e) {log.warn("Couldn't add queue "+e.getMessage());}
+
}
protected void stopService()
1.9 +78 -69 jbossmq/src/main/org/jboss/mq/server/TopicManager.java
Index: TopicManager.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/server/TopicManager.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TopicManager.java 2001/12/09 07:31:39 1.8
+++ TopicManager.java 2002/01/20 15:09:48 1.9
@@ -1,9 +1,9 @@
/*
- * JBoss, the OpenSource J2EE webOS
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
+* JBoss, the OpenSource J2EE webOS
+*
+* Distributable under LGPL license.
+* See terms of license at gnu.org.
+*/
package org.jboss.mq.server;
import java.util.Collection;
@@ -24,106 +24,115 @@
import org.jboss.logging.Logger;
/**
- * This class is a message queue which is stored (hashed by Destination) on the
- * JMS provider
- *
- * @author Norbert Lataille ([EMAIL PROTECTED])
- * @author <a href="[EMAIL PROTECTED]">Hiram Chirino</a>
- * @version $Revision: 1.8 $
- */
+* This class is a message queue which is stored (hashed by Destination) on the
+* JMS provider
+*
+* @author Norbert Lataille ([EMAIL PROTECTED])
+* @author <a href="[EMAIL PROTECTED]">Hiram Chirino</a>
+* @version $Revision: 1.9 $
+*/
public class TopicManager
- extends ServiceMBeanSupport
- implements TopicManagerMBean, MBeanRegistration
+extends ServiceMBeanSupport
+implements TopicManagerMBean, MBeanRegistration
{
-
+
JMSTopic destination;
SpyTopic topic;
String topicName;
String jndiName;
boolean jndiBound = false;
private ObjectName jbossMQService;
-
+
/**
- * Gets the Name attribute of the TopicManager object
- *
- * @return The Name value
- */
+ * Gets the Name attribute of the TopicManager object
+ *
+ * @return The Name value
+ */
public String getName()
{
return "JBossMQTopic";
}
-
+
/**
- * Insert the method's description here. Creation date: (7/1/2001 11:27:22
- * AM)
- *
- * @return java.lang.String
- */
+ * Insert the method's description here. Creation date: (7/1/2001 11:27:22
+ * AM)
+ *
+ * @return java.lang.String
+ */
public String getTopicName()
{
return topicName;
}
-
+
/**
- * Get the value of JBossMQService.
- * @return value of JBossMQService.
- */
+ * Get the value of JBossMQService.
+ * @return value of JBossMQService.
+ */
public ObjectName getJBossMQService()
{
return jbossMQService;
}
/**
- * Set the value of JBossMQService.
- * @param v Value to assign to JBossMQService.
- */
+ * Set the value of JBossMQService.
+ * @param v Value to assign to JBossMQService.
+ */
public void setJBossMQService(ObjectName jbossMQService)
{
this.jbossMQService = jbossMQService;
}
-
+
/**
- * #Description of the Method
- *
- * @exception Exception Description of Exception
- */
+ * #Description of the Method
+ *
+ * @exception Exception Description of Exception
+ */
public void startService() throws Exception
{
if (topicName == null || topicName.length() == 0)
{
throw new Exception("TopicName was not set");
}
-
+
JMSServer server = (JMSServer)getServer().invoke(jbossMQService,
"getJMSServer", new Object[]{
- }, new String[]{
- });
-
+ }, new String[]{
+ });
+
topic = new SpyTopic(topicName);
destination = new JMSTopic(topic, null, server);
-
- server.addDestination(topic, destination);
- //Is this right?
- StateManager sm = server.getStateManager();
- Collection durableSubs = sm.getDurableSubscriptionIdsForTopic(topic);
- for (Iterator i = durableSubs.iterator(); i.hasNext();)
- {
- destination.createDurableSubscription((DurableSubcriptionID)i.next());
- } // end of for ()
- //server.getPersistenceManager().restoreQueue(destination, topic);
- //server.getPersistenceManager().initQueue(destination);
-
- if (jndiName == null)
- setJNDIName("topic/"+topicName);
- else
- setJNDIName(jndiName); //In config phase, we only stored the name, and
didn't actually bind it
+ // server.addDestination(topic, destination);
+ try {
+
+ server.addDestination(topic, destination) ;
+
+ //Is this right?
+ StateManager sm = server.getStateManager();
+ Collection durableSubs = sm.getDurableSubscriptionIdsForTopic(topic);
+ for (Iterator i = durableSubs.iterator(); i.hasNext();)
+ {
+ destination.createDurableSubscription((DurableSubcriptionID)i.next());
+ } // end of for ()
+
+ //server.getPersistenceManager().restoreQueue(destination, topic);
+ //server.getPersistenceManager().initQueue(destination);
+
+ if (jndiName == null)
+ setJNDIName("topic/"+topicName);
+ else
+ setJNDIName(jndiName); //In config phase, we only stored the name, and
didn't actually bind it
+ }
+ catch (JMSException e) {log.warn("Couldn't add topic "+e.getMessage());}
+
}
-
+
protected void stopService()
{
+ // FIXME marcf: implement the removal of the service
+ // The behavior to be fixed is a "rebuild the server, it hot deploys,
destination exists"
log.error("queue stop not yet implemented");
}
-
+
protected ObjectName getObjectName(MBeanServer server, ObjectName name) throws
javax.management.MalformedObjectNameException
{
topicName = name.getKeyProperty("name");
@@ -131,17 +140,17 @@
{
throw new MalformedObjectNameException("Property 'name' not provided");
}
-
+
// re-setup the logger with a more descriptive name
log = Logger.getLogger(getClass().getName() + "#" + topicName);
-
+
return name;
}
/**
- * Sets the JNDI name for this topic
- * @param name Name to bind this topic to in the JNDI tree
- */
+ * Sets the JNDI name for this topic
+ * @param name Name to bind this topic to in the JNDI tree
+ */
public synchronized void setJNDIName(String name) throws Exception{
if (topic == null){ //nothing to bind yet, startService will recall us
jndiName = name;
@@ -160,11 +169,11 @@
jndiBound = true;
log.info("Bound to JNDI name: " + jndiName);
}
-
+
/**
- * Gets the JNDI name use by this topic
- * @return The JNDI name currently in use
- */
+ * Gets the JNDI name use by this topic
+ * @return The JNDI name currently in use
+ */
public String getJNDIName(){
return jndiName;
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development