[jboss-cvs] JBoss Messaging SVN: r1484 - in trunk: src/etc/server/default/deploy src/etc/xmdesc src/main/org/jboss/jms/server src/main/org/jboss/jms/server/endpoint src/main/org/jboss/messaging/core/message src/main/org/jboss/messaging/core/plugin src/main/org/jboss/messaging/core/plugin/contract tests tests/src/org/jboss/test/messaging/jms tests/src/org/jboss/test/messaging/tools/jmx/rmi
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 17 06:37:49 EDT 2006
Author: timfox
Date: 2006-10-17 06:37:37 -0400 (Tue, 17 Oct 2006)
New Revision: 1484
Removed:
trunk/src/etc/xmdesc/JDBCShutdownLogger-xmbean.xml
trunk/src/main/org/jboss/messaging/core/plugin/JDBCShutdownLogger.java
trunk/src/main/org/jboss/messaging/core/plugin/JDBCShutdownLoggerService.java
trunk/src/main/org/jboss/messaging/core/plugin/contract/ShutdownLogger.java
Modified:
trunk/src/etc/server/default/deploy/clustered-mysql-persistence-service.xml
trunk/src/etc/server/default/deploy/hsqldb-persistence-service.xml
trunk/src/etc/server/default/deploy/messaging-service.xml
trunk/src/etc/server/default/deploy/mysql-persistence-service.xml
trunk/src/etc/xmdesc/ServerPeer-xmbean.xml
trunk/src/main/org/jboss/jms/server/ServerPeer.java
trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
trunk/src/main/org/jboss/messaging/core/message/RoutableSupport.java
trunk/tests/build.xml
trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java
trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
Log:
removed shutdown logger http://jira.jboss.com/jira/browse/JBMESSAGING-614 and fixed problem in delivery count
Modified: trunk/src/etc/server/default/deploy/clustered-mysql-persistence-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/clustered-mysql-persistence-service.xml 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/etc/server/default/deploy/clustered-mysql-persistence-service.xml 2006-10-17 10:37:37 UTC (rev 1484)
@@ -201,19 +201,4 @@
]]></attribute>
</mbean>
- <mbean code="org.jboss.messaging.core.plugin.JDBCShutdownLoggerService"
- name="jboss.messaging:service=ShutdownLogger"
- xmbean-dd="xmdesc/JDBCShutdownLogger-xmbean.xml">
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="SqlProperties"><![CDATA[
- CREATE_STARTUP=CREATE TABLE JMS_STARTUP (NODE_ID INTEGER PRIMARY KEY)
- SELECT_STARTUP=SELECT NODE_ID FROM JMS_STARTUP WHERE NODE_ID = ?
- DELETE_STARTUP=DELETE FROM JMS_STARTUP WHERE NODE_ID = ?
- INSERT_STARTUP=INSERT INTO JMS_STARTUP (NODE_ID) VALUES (?)
- ]]></attribute>
- </mbean>
-
</server>
\ No newline at end of file
Modified: trunk/src/etc/server/default/deploy/hsqldb-persistence-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/hsqldb-persistence-service.xml 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/etc/server/default/deploy/hsqldb-persistence-service.xml 2006-10-17 10:37:37 UTC (rev 1484)
@@ -52,13 +52,4 @@
<attribute name="CreateTablesOnStartup">true</attribute>
</mbean>
- <mbean code="org.jboss.messaging.core.plugin.JDBCShutdownLoggerService"
- name="jboss.messaging:service=ShutdownLogger"
- xmbean-dd="xmdesc/JDBCShutdownLogger-xmbean.xml">
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- </mbean>
-
</server>
\ No newline at end of file
Modified: trunk/src/etc/server/default/deploy/messaging-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/messaging-service.xml 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/etc/server/default/deploy/messaging-service.xml 2006-10-17 10:37:37 UTC (rev 1484)
@@ -23,7 +23,6 @@
<depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
<depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
- <depends optional-attribute-name="ShutdownLogger">jboss.messaging:service=ShutdownLogger</depends>
<attribute name="QueuePostOffice">jboss.messaging:service=QueuePostOffice</attribute>
<attribute name="TopicPostOffice">jboss.messaging:service=TopicPostOffice</attribute>
Modified: trunk/src/etc/server/default/deploy/mysql-persistence-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/mysql-persistence-service.xml 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/etc/server/default/deploy/mysql-persistence-service.xml 2006-10-17 10:37:37 UTC (rev 1484)
@@ -105,19 +105,4 @@
]]></attribute>
</mbean>
- <mbean code="org.jboss.messaging.core.plugin.JDBCShutdownLoggerService"
- name="jboss.messaging:service=ShutdownLogger"
- xmbean-dd="xmdesc/JDBCShutdownLogger-xmbean.xml">
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="SqlProperties"><![CDATA[
- CREATE_STARTUP=CREATE TABLE JMS_STARTUP (NODE_ID INTEGER PRIMARY KEY)
- SELECT_STARTUP=SELECT NODE_ID FROM JMS_STARTUP WHERE NODE_ID = ?
- DELETE_STARTUP=DELETE FROM JMS_STARTUP WHERE NODE_ID = ?
- INSERT_STARTUP=INSERT INTO JMS_STARTUP (NODE_ID) VALUES (?)
- ]]></attribute>
- </mbean>
-
</server>
\ No newline at end of file
Deleted: trunk/src/etc/xmdesc/JDBCShutdownLogger-xmbean.xml
===================================================================
--- trunk/src/etc/xmdesc/JDBCShutdownLogger-xmbean.xml 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/etc/xmdesc/JDBCShutdownLogger-xmbean.xml 2006-10-17 10:37:37 UTC (rev 1484)
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mbean PUBLIC
- "-//JBoss//DTD JBOSS XMBEAN 1.2//EN"
- "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_2.dtd">
-
-<mbean>
- <description>A JDBC Shutdown Logger</description>
- <class>org.jboss.server.plugin.JDBCShutdownLoggerService</class>
-
- <!-- Managed constructors -->
-
- <!-- Managed attributes -->
-
- <attribute access="read-only" getMethod="getInstance">
- <description>The instance to plug into the server peer</description>
- <name>Instance</name>
- <type>org.jboss.messaging.core.plugin.contract.MessagingComponent</type>
- </attribute>
-
- <attribute access="read-write" getMethod="getDataSource" setMethod="setDataSource">
- <description>The JNDI name of the DataSource used by this ChannelMapper instance</description>
- <name>DataSource</name>
- <type>java.lang.String</type>
- </attribute>
-
- <attribute access="read-write" getMethod="getTransactionManager" setMethod="setTransactionManager">
- <description>The ObjectName of the TransactionManager used by this ChannelMaper instance</description>
- <name>TransactionManager</name>
- <type>javax.management.ObjectName</type>
- </attribute>
-
- <attribute access="read-write" getMethod="getSqlProperties" setMethod="setSqlProperties">
- <description>DML and DDL overrides</description>
- <name>SqlProperties</name>
- <type>java.lang.String</type>
- </attribute>
-
- <attribute access="read-write" getMethod="isCreateTablesOnStartup" setMethod="setCreateTablesOnStartup">
- <description>Should database tables be created on startup?</description>
- <name>CreateTablesOnStartup</name>
- <type>boolean</type>
- </attribute>
-
- <!-- Managed operations -->
-
- <operation>
- <description>JBoss Service lifecycle operation</description>
- <name>create</name>
- </operation>
-
- <operation>
- <description>JBoss Service lifecycle operation</description>
- <name>start</name>
- </operation>
-
- <operation>
- <description>JBoss Service lifecycle operation</description>
- <name>stop</name>
- </operation>
-
- <operation>
- <description>JBoss Service lifecycle operation</description>
- <name>destroy</name>
- </operation>
-
-</mbean>
\ No newline at end of file
Modified: trunk/src/etc/xmdesc/ServerPeer-xmbean.xml
===================================================================
--- trunk/src/etc/xmdesc/ServerPeer-xmbean.xml 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/etc/xmdesc/ServerPeer-xmbean.xml 2006-10-17 10:37:37 UTC (rev 1484)
@@ -58,12 +58,6 @@
<type>javax.management.ObjectName</type>
</attribute>
- <attribute access="read-write" getMethod="getShutdownLogger" setMethod="setShutdownLogger">
- <description>The ObjectName of the shutdown logger</description>
- <name>ShutdownLogger</name>
- <type>javax.management.ObjectName</type>
- </attribute>
-
<!-- instance access -->
<attribute access="read-only" getMethod="getInstance">
Modified: trunk/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/ServerPeer.java 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/main/org/jboss/jms/server/ServerPeer.java 2006-10-17 10:37:37 UTC (rev 1484)
@@ -49,7 +49,6 @@
import org.jboss.messaging.core.plugin.contract.MessageStore;
import org.jboss.messaging.core.plugin.contract.PersistenceManager;
import org.jboss.messaging.core.plugin.contract.PostOffice;
-import org.jboss.messaging.core.plugin.contract.ShutdownLogger;
import org.jboss.messaging.core.plugin.postoffice.DefaultPostOffice;
import org.jboss.messaging.core.tx.TransactionRepository;
import org.jboss.messaging.util.Util;
@@ -78,7 +77,7 @@
private static final Logger log = Logger.getLogger(ServerPeer.class);
- //public static final String RECOVERABLE_CTX_NAME = "jms-recoverables";
+ public static final String RECOVERABLE_CTX_NAME = "jms-recoverables";
// The "subsystem" label this ServerPeer uses to register its ServerInvocationHandler with the
// Remoting connector
@@ -101,8 +100,6 @@
private int objectIDSequence = 1;
- private boolean crashed;
-
// wired components
private DestinationJNDIMapper destinationJNDIMapper;
@@ -132,9 +129,6 @@
protected ObjectName jmsUserManagerObjectName;
protected JMSUserManager jmsUserManager;
- protected ObjectName shutdownLoggerObjectName;
- protected ShutdownLogger shutdownLogger;
-
//Other stuff
private JMSServerInvocationHandler handler;
@@ -202,9 +196,6 @@
jmsUserManager = (JMSUserManager)mbeanServer.
getAttribute(jmsUserManagerObjectName, "Instance");
- shutdownLogger = (ShutdownLogger)mbeanServer.
- getAttribute(shutdownLoggerObjectName, "Instance");
-
//We get references to some plugins lazily to avoid problems with circular
//MBean dependencies
@@ -234,11 +225,6 @@
securityStore.start();
txRepository.start();
- //Did the server crash last time?
-
- //TODO do we need this?
- crashed = shutdownLogger.startup(serverPeerID);
-
initializeRemoting(mbeanServer);
//createRecoverable();
@@ -268,9 +254,7 @@
started = false;
//removeRecoverable();
-
- shutdownLogger.shutdown(serverPeerID);
-
+
// Stop the wired components
messageIdManager.stop();
@@ -352,16 +336,6 @@
jmsUserManagerObjectName = on;
}
- public ObjectName getShutdownLogger()
- {
- return shutdownLoggerObjectName;
- }
-
- public void setShutdownLogger(ObjectName on)
- {
- shutdownLoggerObjectName = on;
- }
-
public Object getInstance()
{
return this;
@@ -577,11 +551,6 @@
return version;
}
- public boolean crashedLastTime()
- {
- return crashed;
- }
-
// access to hard-wired server extensions
public SecurityManager getSecurityManager()
@@ -653,11 +622,6 @@
return topicPostOffice;
}
- public ShutdownLogger getShutdownLoggerInstance()
- {
- return shutdownLogger;
- }
-
public synchronized int getNextObjectID()
{
return objectIDSequence++;
@@ -701,8 +665,8 @@
* order to obtain an XAResource so it can perform XA recovery.
*/
-// //Commented out until XA Recovery is complete
-//
+ //Commented out until XA Recovery is complete
+
// private void createRecoverable() throws Exception
// {
// //Disabled until XA Recovery is complete with Arjuna transaction integration
@@ -733,7 +697,7 @@
//
// recCtx.rebind(this.serverPeerID, recoverable);
// }
-
+//
// private void removeRecoverable() throws Exception
// {
// InitialContext ic = new InitialContext();
Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2006-10-17 10:37:37 UTC (rev 1484)
@@ -575,8 +575,7 @@
{
Delivery del = (Delivery)deliveries.remove(messageID);
if (del != null)
- {
- del.getReference().decrementDeliveryCount();
+ {
del.cancel();
}
else
Modified: trunk/src/main/org/jboss/messaging/core/message/RoutableSupport.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/message/RoutableSupport.java 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/main/org/jboss/messaging/core/message/RoutableSupport.java 2006-10-17 10:37:37 UTC (rev 1484)
@@ -178,7 +178,7 @@
public void incrementDeliveryCount()
{
- deliveryCount++;
+ deliveryCount++;
}
public void decrementDeliveryCount()
Deleted: trunk/src/main/org/jboss/messaging/core/plugin/JDBCShutdownLogger.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/JDBCShutdownLogger.java 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/main/org/jboss/messaging/core/plugin/JDBCShutdownLogger.java 2006-10-17 10:37:37 UTC (rev 1484)
@@ -1,273 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.messaging.core.plugin;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.sql.DataSource;
-import javax.transaction.TransactionManager;
-
-import org.jboss.logging.Logger;
-import org.jboss.messaging.core.plugin.contract.ShutdownLogger;
-
-/**
- *
- * A JDBCShutdownLogger
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision: 1.1 $</tt>
- *
- * $Id$
- *
- */
-public class JDBCShutdownLogger extends JDBCSupport implements ShutdownLogger
-{
- private static final Logger log = Logger.getLogger(JDBCShutdownLogger.class);
-
- // Constructors ----------------------------------------------------
-
- public JDBCShutdownLogger(DataSource ds, TransactionManager tm, Properties sqlProperties,
- boolean createTablesOnStartup)
- {
- super(ds, tm, sqlProperties, createTablesOnStartup);
- }
-
- // ShutdownLogger implementation ---------------------------------------------
-
- public boolean shutdown(int nodeId) throws Exception
- {
- boolean exists = existsStartup(nodeId);
-
- if (!exists)
- {
- //This shouldn't really happen
- log.warn("It appears the server did not start up properly!");
- return false;
- }
- else
- {
- removeStartup(nodeId);
-
- return true;
- }
- }
-
- public boolean startup(int nodeId) throws Exception
- {
- boolean crashed = existsStartup(nodeId);
-
- if (crashed)
- {
- //These means the server didn't shutdown cleanly last time -
- //we must assume it crashed
-
- log.warn("It appears the server was not shutdown cleanly last time. We assume that the server crashed");
-
- //Remove the old startup row
- removeStartup(nodeId);
- }
-
- //Insert a new startup row
- insertStartup(nodeId);
-
- return crashed;
- }
-
- private boolean existsStartup(int nodeId) throws Exception
- {
- Connection conn = null;
- PreparedStatement ps = null;
- ResultSet rs = null;
- TransactionWrapper wrap = new TransactionWrapper();
-
- try
- {
- conn = ds.getConnection();
- ps = conn.prepareStatement(getSQLStatement("SELECT_STARTUP"));
- ps.setInt(1, nodeId);
-
- rs = ps.executeQuery();
-
- return rs.next();
-
- }
- catch (Exception e)
- {
- wrap.exceptionOccurred();
- throw e;
- }
- finally
- {
- if (rs != null)
- {
- try
- {
- rs.close();
- }
- catch (Throwable e)
- {
- }
- }
- if (ps != null)
- {
- try
- {
- ps.close();
- }
- catch (Throwable e)
- {
- }
- }
- if (conn != null)
- {
- try
- {
- conn.close();
- }
- catch (Throwable e)
- {
- }
- }
- wrap.end();
- }
- }
-
- private void removeStartup(int nodeId) throws Exception
- {
- Connection conn = null;
- PreparedStatement ps = null;
- TransactionWrapper wrap = new TransactionWrapper();
-
- try
- {
- conn = ds.getConnection();
- ps = conn.prepareStatement(getSQLStatement("DELETE_STARTUP"));
- ps.setInt(1, nodeId);
-
- ps.executeUpdate();
-
- }
- catch (Exception e)
- {
- wrap.exceptionOccurred();
- throw e;
- }
- finally
- {
- if (ps != null)
- {
- try
- {
- ps.close();
- }
- catch (Throwable e)
- {
- }
- }
- if (conn != null)
- {
- try
- {
- conn.close();
- }
- catch (Throwable e)
- {
- }
- }
- wrap.end();
- }
- }
-
- // Private ------------------------------------------------------------
-
- private void insertStartup(int nodeId) throws Exception
- {
- Connection conn = null;
- PreparedStatement ps = null;
- TransactionWrapper wrap = new TransactionWrapper();
-
- try
- {
- conn = ds.getConnection();
- ps = conn.prepareStatement(getSQLStatement("INSERT_STARTUP"));
- ps.setInt(1, nodeId);
-
- ps.executeUpdate();
-
- }
- catch (Exception e)
- {
- wrap.exceptionOccurred();
- throw e;
- }
- finally
- {
- if (ps != null)
- {
- try
- {
- ps.close();
- }
- catch (Throwable e)
- {
- }
- }
- if (conn != null)
- {
- try
- {
- conn.close();
- }
- catch (Throwable e)
- {
- }
- }
- wrap.end();
- }
- }
-
- protected Map getDefaultDDLStatements()
- {
- Map sql = new LinkedHashMap();
-
- sql.put("CREATE_STARTUP", "CREATE TABLE JMS_STARTUP (NODE_ID INTEGER PRIMARY KEY)");
-
- return sql;
- }
-
- protected Map getDefaultDMLStatements()
- {
- Map sql = new LinkedHashMap();
-
- sql.put("SELECT_STARTUP", "SELECT NODE_ID FROM JMS_STARTUP WHERE NODE_ID = ?");
- sql.put("DELETE_STARTUP", "DELETE FROM JMS_STARTUP WHERE NODE_ID = ?");
- sql.put("INSERT_STARTUP", "INSERT INTO JMS_STARTUP (NODE_ID) VALUES (?)");
-
- return sql;
- }
-
-}
Deleted: trunk/src/main/org/jboss/messaging/core/plugin/JDBCShutdownLoggerService.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/JDBCShutdownLoggerService.java 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/main/org/jboss/messaging/core/plugin/JDBCShutdownLoggerService.java 2006-10-17 10:37:37 UTC (rev 1484)
@@ -1,101 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.messaging.core.plugin;
-
-import javax.transaction.TransactionManager;
-
-import org.jboss.jms.util.ExceptionUtil;
-import org.jboss.messaging.core.plugin.contract.MessagingComponent;
-import org.jboss.messaging.core.plugin.contract.ShutdownLogger;
-
-/**
- * A JDBCShutdownLoggerService
- *
- * MBean wrapper around a ShutDownLogger
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision: 1.1 $</tt>
- *
- * $Id$
- *
- */
-public class JDBCShutdownLoggerService extends JDBCServiceSupport
-{
- private ShutdownLogger shutdownLogger;
-
- private boolean started;
-
- // Constructors ---------------------------------------------------------
-
- public JDBCShutdownLoggerService()
- {
- }
-
- // ServerPlugin implementation ------------------------------------------
-
- public MessagingComponent getInstance()
- {
- return shutdownLogger;
- }
-
- // ServiceMBeanSupport overrides ---------------------------------
-
- protected synchronized void startService() throws Exception
- {
- if (started)
- {
- throw new IllegalStateException("Service is already started");
- }
-
- super.startService();
-
- try
- {
- TransactionManager tm = getTransactionManagerReference();
-
- shutdownLogger = new JDBCShutdownLogger(ds, tm, sqlProperties, createTablesOnStartup);
-
- shutdownLogger.start();
-
- started = true;
- }
- catch (Throwable t)
- {
- throw ExceptionUtil.handleJMXInvocation(t, this + " startService");
- }
- }
-
- protected void stopService() throws Exception
- {
- if (!started)
- {
- throw new IllegalStateException("Service is not started");
- }
-
- shutdownLogger.stop();
- shutdownLogger = null;
-
- started = false;
-
- log.debug(this + " stopped");
- }
-}
Deleted: trunk/src/main/org/jboss/messaging/core/plugin/contract/ShutdownLogger.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/contract/ShutdownLogger.java 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/src/main/org/jboss/messaging/core/plugin/contract/ShutdownLogger.java 2006-10-17 10:37:37 UTC (rev 1484)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.messaging.core.plugin.contract;
-
-/**
- * A ShutdownLogger
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision: 1.1 $</tt>
- *
- * $Id$
- *
- */
-public interface ShutdownLogger extends MessagingComponent
-{
- boolean startup(int nodeId) throws Exception;
-
- boolean shutdown(int nodeId) throws Exception;
-}
Modified: trunk/tests/build.xml
===================================================================
--- trunk/tests/build.xml 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/tests/build.xml 2006-10-17 10:37:37 UTC (rev 1484)
@@ -338,7 +338,7 @@
haltonerror="${junit.batchtest.haltonerror}">
<formatter type="plain" usefile="${junit.formatter.usefile}"/>
<fileset dir="${build.tests.classes}">
- <include name="**/messaging/core/**/*Test.class"/>
+ <!-- <include name="**/messaging/core/**/*Test.class"/> -->
<include name="**/messaging/jms/**/*Test.class"/>
<exclude name="**/jms/stress/**"/>
<exclude name="**/jms/crash/*Test.class"/>
Modified: trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java 2006-10-17 10:37:37 UTC (rev 1484)
@@ -573,6 +573,8 @@
TextMessage tm = (TextMessage)cons.receive();
assertEquals("a message", tm.getText());
+
+ log.info("del count1:" + tm.getIntProperty("JMSXDeliveryCount"));
assertFalse(tm.getJMSRedelivered());
assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
@@ -587,6 +589,8 @@
tm = (TextMessage)cons.receive();
assertEquals("a message", tm.getText());
+
+ log.info("del count2:" + tm.getIntProperty("JMSXDeliveryCount"));
assertTrue(tm.getJMSRedelivered());
assertEquals(2, tm.getIntProperty("JMSXDeliveryCount"));
Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java 2006-10-17 07:53:10 UTC (rev 1483)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java 2006-10-17 10:37:37 UTC (rev 1484)
@@ -73,7 +73,6 @@
private ObjectName queuePostOfficeObjectName;
private ObjectName topicPostOfficeObjectName;
private ObjectName jmsUserManagerObjectName;
- private ObjectName shutdownLoggerObjectName;
// the server MBean itself
private ObjectName serverPeerObjectName;
@@ -265,12 +264,6 @@
sc.invoke(jmsUserManagerObjectName, "create", new Object[0], new String[0]);
sc.invoke(jmsUserManagerObjectName, "start", new Object[0], new String[0]);
- MBeanConfigurationElement shutdownLoggerConfig =
- (MBeanConfigurationElement)pdd.query("service", "ShutdownLogger").iterator().next();
- shutdownLoggerObjectName = sc.registerAndConfigureService(shutdownLoggerConfig);
- sc.invoke(shutdownLoggerObjectName, "create", new Object[0], new String[0]);
- sc.invoke(shutdownLoggerObjectName, "start", new Object[0], new String[0]);
-
// register server peer as a service, dependencies are injected automatically
MBeanConfigurationElement serverPeerConfig =
(MBeanConfigurationElement)mdd.query("service", "ServerPeer").iterator().next();
@@ -417,26 +410,10 @@
//Hence we must catch and ignore or we won't shut everything down
}
-
-
log.debug("stopping ServerPeer's plug-in dependencies");
-
+
try
{
- sc.invoke(shutdownLoggerObjectName, "stop", new Object[0], new String[0]);
- sc.invoke(shutdownLoggerObjectName, "destroy", new Object[0], new String[0]);
- sc.unregisterService(shutdownLoggerObjectName);
- }
- catch (Exception ignore)
- {
- //If the serverpeer failed when starting up previously, then only some of the
- //services may be started. The ones that didn't start will fail when attempting to shut
- //them down.
- //Hence we must catch and ignore or we won't shut everything down
- }
-
- try
- {
sc.invoke(jmsUserManagerObjectName, "stop", new Object[0], new String[0]);
sc.invoke(jmsUserManagerObjectName, "destroy", new Object[0], new String[0]);
sc.unregisterService(jmsUserManagerObjectName);
More information about the jboss-cvs-commits
mailing list