Package org.jrd.backend.data
Class VmManager
- java.lang.Object
-
- org.jrd.backend.data.VmManager
-
public class VmManager extends java.lang.Object
This 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) boolean
changed
private 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 void
clearChanged()
VmInfo
createFsVM(java.util.List<java.io.File> cp, java.lang.String name, boolean shouldBeSaved)
VmInfo
createRemoteVM(java.lang.String hostname, int port)
VmInfo
createRemoteVM(java.lang.String hostname, int port, java.lang.String idOverride)
VmInfo
findVmFromPid(java.lang.String param)
VmInfo
findVmFromPidNoException(java.lang.String param)
private int
getNextAvailableFsVmPid()
VmInfo
getVmInfoByID(java.lang.String vmId)
java.util.Set<VmInfo>
getVmInfoSet()
private boolean
hasChanged()
private void
loadSavedFsVms()
void
notifyListeners()
boolean
removeVm(VmInfo target)
private void
setChanged()
void
subscribeToVMChange(java.awt.event.ActionListener listener)
void
updateLocalVMs()
Obtains list of Virtual Machines.
-
-
-
Field Detail
-
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()
-
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)
-
createRemoteVM
public VmInfo createRemoteVM(java.lang.String hostname, int port, java.lang.String idOverride)
-
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()
-
-