1 24 25 package org.objectweb.cjdbc.console.gui.threads.task; 26 27 import org.objectweb.cjdbc.common.jmx.mbeans.VirtualDatabaseMBean; 28 import org.objectweb.cjdbc.console.gui.CjdbcGui; 29 import org.objectweb.cjdbc.console.gui.constants.GuiConstants; 30 import org.objectweb.cjdbc.console.gui.objects.BackendObject; 31 32 38 public class BackupBackendTask implements Runnable 39 { 40 41 private VirtualDatabaseMBean database; 42 private BackendObject bob; 43 private String dumpName; 44 private CjdbcGui gui; 45 46 54 public BackupBackendTask(CjdbcGui gui, VirtualDatabaseMBean database, 55 BackendObject bob, String dumpName) 56 { 57 this.database = database; 58 this.dumpName = dumpName; 59 this.bob = bob; 60 this.gui = gui; 61 } 62 63 66 public void run() 67 { 68 String backendName = bob.getName(); 69 gui.actionChangeBackendState(bob, GuiConstants.BACKEND_STATE_BACKUP); 70 71 gui.appendDebugText("Backing up backend:" + backendName); 72 73 try 74 { 75 database.backupBackend(backendName, null, null, dumpName, null, null, 77 null); 78 gui.appendDebugText("Backup of backend:" + backendName + " completed"); 79 } 80 catch (Exception e) 81 { 82 gui.appendDebugText("Backup of backend:" + backendName + " failed", e); 83 } 84 92 gui.paintBackendPane(); 93 } 94 95 } | Popular Tags |