Package org.jrd.backend.data
Class VmManager
- java.lang.Object
-
- org.jrd.backend.data.VmManager
-
public class VmManager extends java.lang.ObjectThis class is used for creating/removing/updating information about available Java Virtual Machines.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.awt.event.ActionListener>actionListeners(package private) booleanchangedstatic java.lang.StringPORT_ID_SPLITprivate java.util.Set<VmInfo>vmInfoSet
-
Constructor Summary
Constructors Constructor Description VmManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidclearChanged()VmInfocreateFsVM(java.util.List<java.io.File> cp, java.lang.String name, boolean shouldBeSaved)VmInfocreateRemoteVM(java.lang.String hostname, int port, boolean shouldBeSaved, BytemanCompanion bytemanCompanion)VmInfocreateRemoteVM(java.lang.String hostname, int port, java.lang.String idOverride, boolean shouldBeSaved, BytemanCompanion bytemanCompanion)VmInfofindVmFromPid(java.lang.String param)VmInfofindVmFromPidNoException(java.lang.String param)private intgetNextAvailableFsVmPid()VmInfogetVmInfoByID(java.lang.String vmId)java.util.Set<VmInfo>getVmInfoSet()private booleanhasChanged()private voidloadSavedFsVms()private voidloadSavedRemoteVms()voidnotifyListeners()booleanremoveVm(VmInfo target)private voidsetChanged()voidsubscribeToVMChange(java.awt.event.ActionListener listener)voidupdateLocalVMs()Obtains list of Virtual Machines.
-
-
-
Field Detail
-
PORT_ID_SPLIT
public static final java.lang.String PORT_ID_SPLIT
- See Also:
- Constant Field Values
-
vmInfoSet
private java.util.Set<VmInfo> vmInfoSet
-
actionListeners
private java.util.Set<java.awt.event.ActionListener> actionListeners
-
changed
boolean changed
-
-
Method Detail
-
loadSavedFsVms
private void loadSavedFsVms()
-
loadSavedRemoteVms
private void loadSavedRemoteVms()
-
updateLocalVMs
public void updateLocalVMs()
Obtains list of Virtual Machines. This list is then compared to vmInfoSet. Old Vms are removed and new are added.
-
createRemoteVM
public VmInfo createRemoteVM(java.lang.String hostname, int port, boolean shouldBeSaved, BytemanCompanion bytemanCompanion)
-
createRemoteVM
public VmInfo createRemoteVM(java.lang.String hostname, int port, java.lang.String idOverride, boolean shouldBeSaved, BytemanCompanion bytemanCompanion)
-
createFsVM
public VmInfo createFsVM(java.util.List<java.io.File> cp, java.lang.String name, boolean shouldBeSaved)
-
getNextAvailableFsVmPid
private int getNextAvailableFsVmPid()
-
removeVm
public boolean removeVm(VmInfo target)
-
findVmFromPid
public VmInfo findVmFromPid(java.lang.String param)
-
findVmFromPidNoException
public VmInfo findVmFromPidNoException(java.lang.String param)
-
getVmInfoByID
public VmInfo getVmInfoByID(java.lang.String vmId)
-
getVmInfoSet
public java.util.Set<VmInfo> getVmInfoSet()
-
subscribeToVMChange
public void subscribeToVMChange(java.awt.event.ActionListener listener)
-
notifyListeners
public void notifyListeners()
-
hasChanged
private boolean hasChanged()
-
setChanged
private void setChanged()
-
clearChanged
private void clearChanged()
-
-