Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

VirtualDatabaseSafeShutdownThread.java

00001 /**
00002  * C-JDBC: Clustered JDBC.
00003  * Copyright (C) 2005 Emic Networks.
00004  * Contact: c-jdbc@objectweb.org
00005  * 
00006  * This library is free software; you can redistribute it and/or modify it
00007  * under the terms of the GNU Lesser General Public License as published by the
00008  * Free Software Foundation; either version 2.1 of the License, or any later
00009  * version.
00010  * 
00011  * This library is distributed in the hope that it will be useful, but WITHOUT
00012  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
00014  * for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this library; if not, write to the Free Software Foundation,
00018  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00019  *
00020  * Initial developer(s): Emmanuel Cecchet.
00021  * Contributor(s): ______________________.
00022  */
00023 
00024 package org.objectweb.cjdbc.controller.core.shutdown;
00025 
00026 import org.objectweb.cjdbc.common.exceptions.ShutdownException;
00027 import org.objectweb.cjdbc.common.util.Constants;
00028 import org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase;
00029 
00030 /**
00031  * This thread waits for open transactions to complete before shutting down the
00032  * virtual database.
00033  * 
00034  * @author <a href="mailto:emmanuel.cecchet@emicnetworks.com">Emmanuel Cecchet
00035  *         </a>
00036  * @version 1.0
00037  */
00038 public class VirtualDatabaseSafeShutdownThread
00039     extends VirtualDatabaseShutdownThread
00040 {
00041 
00042   /**
00043    * Creates a new <code>VirtualDatabaseSafeShutdownThread</code> object
00044    * 
00045    * @param vdb the VirtualDatabase to shutdown
00046    */
00047   public VirtualDatabaseSafeShutdownThread(VirtualDatabase vdb)
00048   {
00049     super(vdb, Constants.SHUTDOWN_SAFE);
00050   }
00051 
00052   /**
00053    * @see org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread#shutdown()
00054    */
00055   public void shutdown() throws ShutdownException
00056   {
00057     this.waitForTransactionsAndWritesToComplete();
00058     this.terminateVirtualDatabaseWorkerThreads();
00059     this.disableAllBackends();
00060     this.closeVirtualDatabase();
00061   }
00062 
00063 }

Generated on Mon Apr 11 22:01:35 2005 for C-JDBC by  doxygen 1.3.9.1