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 39 public class RestoreBackendTask implements Runnable 40 { 41 42 private VirtualDatabaseMBean database; 43 private BackendObject bob; 44 private String dumpName; 45 private CjdbcGui gui; 46 47 55 public RestoreBackendTask(CjdbcGui gui, VirtualDatabaseMBean database, 56 BackendObject bob, String dumpName) 57 { 58 this.database = database; 59 this.dumpName = dumpName; 60 this.bob = bob; 61 this.gui = gui; 62 } 63 64 67 public void run() 68 { 69 gui.actionChangeBackendState(bob, GuiConstants.BACKEND_STATE_RESTORE); 70 71 try 72 { 73 database.restoreDumpOnBackend(bob.getName(), null, null, dumpName, null); 75 } 76 catch (Exception e) 77 { 78 gui.appendDebugText("Failed to enable backend:" + bob.getName(), e); 79 } 80 gui.publicActionLoadBackendsList(database.getVirtualDatabaseName()); 81 } 82 83 } | Popular Tags |