org.glassfish.virtualization.spi
Interface VirtualMachineInfo

All Superinterfaces:
StaticVirtualMachineInfo

public interface VirtualMachineInfo
extends StaticVirtualMachineInfo

Returns the virtual machine information

Author:
Jerome Dochez

Method Summary
 long cpuTime()
          Returns the CPU used by this virtual machine
 Machine.State getState()
          Returns the machine's state
 long maxMemory()
          Returns the maximum memory allocated to this virtual machine.
 long memory()
          Returns the current memory used by this virtual machine
 void registerMemoryListener(MemoryListener ml, long delay, TimeUnit unit)
          Registers a memory changes listener
 void unregisterMemoryListener(MemoryListener ml)
          Un-registers a memory changes listener
 
Methods inherited from interface org.glassfish.virtualization.spi.StaticVirtualMachineInfo
nbVirtCpu
 

Method Detail

maxMemory

long maxMemory()
               throws VirtException
Returns the maximum memory allocated to this virtual machine.

Returns:
the virtual machine maximum memory.
Throws:
VirtException

memory

long memory()
            throws VirtException
Returns the current memory used by this virtual machine

Specified by:
memory in interface StaticVirtualMachineInfo
Returns:
the virtual machine current memory usage
Throws:
VirtException

cpuTime

long cpuTime()
             throws VirtException
Returns the CPU used by this virtual machine

Returns:
the CPU time used by this VM.
Throws:
VirtException

getState

Machine.State getState()
                       throws VirtException
Returns the machine's state

Returns:
the machine's state
Throws:
VirtException - if the machine's state cannot be obtained

registerMemoryListener

void registerMemoryListener(MemoryListener ml,
                            long delay,
                            TimeUnit unit)
Registers a memory changes listener

Parameters:
ml - the memory listener instance
delay - notification interval for memory changes polling.
unit - the time unit to express delay

unregisterMemoryListener

void unregisterMemoryListener(MemoryListener ml)
Un-registers a memory changes listener

Parameters:
ml, - the listener to un-register.


Copyright © 2012. All Rights Reserved.