org.glassfish.virtualization.libvirt
Class LibVirtLocalMachine

java.lang.Object
  extended by org.glassfish.virtualization.runtime.AbstractMachine
      extended by org.glassfish.virtualization.libvirt.LibVirtLocalMachine
All Implemented Interfaces:
org.glassfish.hk2.PostConstruct, Machine

public class LibVirtLocalMachine
extends AbstractMachine
implements org.jvnet.hk2.component.PostConstruct

Abstraction for this machine, assumptions are being made that this java process runs with with the same user's credentials that libvirt is expecting to manage the virtualization environment of this machine.

Author:
Jerome Dochez

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.glassfish.virtualization.spi.Machine
Machine.State
 
Field Summary
 
Fields inherited from class org.glassfish.virtualization.runtime.AbstractMachine
config, installedTemplates, serverPool
 
Constructor Summary
protected LibVirtLocalMachine(LibVirtServerPool group, MachineConfig config)
           
 
Method Summary
 org.glassfish.virtualization.libvirt.LibVirtStoragePool addStoragePool(String name, long capacity)
           
 VirtualMachine byName(String name)
           
protected  Connect connection()
           
 PhasedFuture<AllocationPhase,VirtualMachine> create(TemplateInstance template, VirtualCluster cluster, EventSource<AllocationPhase> source)
           
 String description()
           
static LibVirtLocalMachine from(org.glassfish.hk2.inject.Injector injector, LibVirtServerPool group, MachineConfig config)
           
 Map<String,? extends StoragePool> getStoragePools()
           
 Collection<? extends VirtualMachine> getVMs()
           
 void postConstruct()
           
 void sleep()
           
 
Methods inherited from class org.glassfish.virtualization.runtime.AbstractMachine
absolutize, createCustomizationFile, execute, getConfig, getIpAddress, getName, getServerPool, getState, getUser, getUserHome, getVMTemplateFor, install, isUp, prepare, prepareCustDirectory, prepareCustomization, setState, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LibVirtLocalMachine

protected LibVirtLocalMachine(LibVirtServerPool group,
                              MachineConfig config)
Method Detail

from

public static LibVirtLocalMachine from(org.glassfish.hk2.inject.Injector injector,
                                       LibVirtServerPool group,
                                       MachineConfig config)

postConstruct

public void postConstruct()
Specified by:
postConstruct in interface org.glassfish.hk2.PostConstruct
Overrides:
postConstruct in class AbstractMachine

addStoragePool

public org.glassfish.virtualization.libvirt.LibVirtStoragePool addStoragePool(String name,
                                                                              long capacity)
                                                                       throws VirtException
Specified by:
addStoragePool in interface Machine
Throws:
VirtException

description

public String description()

getVMs

public Collection<? extends VirtualMachine> getVMs()
                                            throws VirtException
Specified by:
getVMs in interface Machine
Throws:
VirtException

getStoragePools

public Map<String,? extends StoragePool> getStoragePools()
                                                  throws VirtException
Specified by:
getStoragePools in interface Machine
Throws:
VirtException

byName

public VirtualMachine byName(String name)
                      throws VirtException
Specified by:
byName in interface Machine
Throws:
VirtException

sleep

public void sleep()
           throws IOException,
                  InterruptedException
Specified by:
sleep in interface Machine
Overrides:
sleep in class AbstractMachine
Throws:
IOException
InterruptedException

connection

protected Connect connection()
                      throws VirtException
Throws:
VirtException

create

public PhasedFuture<AllocationPhase,VirtualMachine> create(TemplateInstance template,
                                                           VirtualCluster cluster,
                                                           EventSource<AllocationPhase> source)
                                                    throws VirtException,
                                                           IOException
Specified by:
create in interface Machine
Throws:
VirtException
IOException


Copyright © 2012. All Rights Reserved.