KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > backup > appserver > OfflineBackupSynchronizer


1 /*
2  * OnlineBackupSynchronizer.java
3  *
4  * Created on December 19, 2003, 11:25 PM
5  */

6
7 package com.sun.enterprise.config.backup.appserver;
8
9 import com.sun.enterprise.config.backup.BackupAbortException;
10 import com.sun.enterprise.config.backup.pluggable.BackupSynchronizer;
11 /**
12  * AppServer's implementation of locking mechanism for
13  * off line backup restore functionality.
14  *
15  * @author sridatta
16  */

17 public class OfflineBackupSynchronizer implements BackupSynchronizer {
18     
19     /** Creates a new instance of OnlineBackupSynchronizer */
20     public OfflineBackupSynchronizer() {
21     }
22     
23     /**
24      * Check if the server is running or not
25      * throw BackupRuntimeException if it cannot be locked
26      *
27      * Implementation for appserver is pretty simple. Even
28      * though we should lock, implementation just checks if
29      * server is running. If so, throws a runtime excetpion
30      * and aborts the operation.
31      *
32      * There is no guarantee that the server will not start up
33      * after passing through this operation.
34      */

35     public void lock() {
36         if(isServerRunning()) {
37         //fixme i18n
38
throw new BackupAbortException("error_server_running", "error_server_running");
39         }
40     }
41     
42     public void release() {
43     }
44     
45     private boolean isServerRunning() {
46         return false; //nyi fixme
47
}
48 }
49
Popular Tags