Class QemuMonitor
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jdrupes.vmoperator.runner.qemu.QemuConnector
org.jdrupes.vmoperator.runner.qemu.QemuMonitor
- All Implemented Interfaces:
Iterable<ComponentType>
,Channel
,ComponentType
,Eligible
,Manager
A component that handles the communication over the Qemu monitor
socket.
If the log level for this class is set to fine, the messages exchanged on the monitor socket are logged.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default
-
Field Summary
Fields inherited from class org.jdrupes.vmoperator.runner.qemu.QemuConnector
mapper
-
Constructor Summary
ConstructorsConstructorDescriptionQemuMonitor
(Channel componentChannel, Path configDir) Instantiates a new QEMU monitor. -
Method Summary
Modifier and TypeMethodDescription(package private) void
As the initial configuration of this component depends on the configuration of theRunner
, it doesn’t have a handler for theConfigurationUpdate
event.void
onClosed
(Closed<?> event, SocketIOChannel channel) On closed.void
onConfigureQemu
(ConfigureQemu event) On configure qemu.void
onExecQmpCommand
(MonitorCommand event) On monitor command.void
onPowerdownEvent
(PowerdownEvent event) On powerdown event.void
Shutdown the VM.protected void
processInput
(String line) Process agent input.protected void
When the socket is connected, send the capabilities command.Methods inherited from class org.jdrupes.vmoperator.runner.qemu.QemuConnector
configure, onClientConnected, onConnectError, onFileChanged, onInput, onStart, qemuChannel, rep, sendCommand, writer
Methods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setName
Methods inherited from class org.jgrapes.core.internal.ComponentVertex
activeEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGenerator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
QemuMonitor
Instantiates a new QEMU monitor.- Parameters:
componentChannel
- the component channelconfigDir
- the config dir- Throws:
IOException
- Signals that an I/O exception has occurred.
-
-
Method Details
-
configure
As the initial configuration of this component depends on the configuration of theRunner
, it doesn’t have a handler for theConfigurationUpdate
event.The values are forwarded from the
Runner
instead.- Parameters:
socketPath
- the socket pathpowerdownTimeout
-
-
socketConnected
When the socket is connected, send the capabilities command.- Overrides:
socketConnected
in classQemuConnector
-
processInput
Description copied from class:QemuConnector
Process agent input.- Specified by:
processInput
in classQemuConnector
- Parameters:
line
- the line- Throws:
IOException
- Signals that an I/O exception has occurred.
-
onClosed
On closed.- Overrides:
onClosed
in classQemuConnector
- Parameters:
event
- the eventchannel
- the channel
-
onExecQmpCommand
On monitor command.- Parameters:
event
- the event- Throws:
IOException
-
onStop
Shutdown the VM.- Parameters:
event
- the event
-
onPowerdownEvent
On powerdown event.- Parameters:
event
- the event
-
onConfigureQemu
On configure qemu.- Parameters:
event
- the event
-