Class AgentConnector
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jdrupes.vmoperator.runner.qemu.QemuConnector
org.jdrupes.vmoperator.runner.qemu.AgentConnector
- All Implemented Interfaces:
Iterable<ComponentType>
,Channel
,ComponentType
,Eligible
,Manager
- Direct Known Subclasses:
GuestAgentClient
,VmopAgentClient
A component that handles the communication with an agent
running in the VM.
If the log level for this class is set to fine, the messages exchanged on the socket are logged.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default
-
Field Summary
FieldsFields inherited from class org.jdrupes.vmoperator.runner.qemu.QemuConnector
mapper
-
Constructor Summary
ConstructorsConstructorDescriptionAgentConnector
(Channel componentChannel) Instantiates a new agent connector. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Called when the agent in the VM opens the connection.protected void
Called when the agent in the VM closes the connection.protected void
configureConnection
(List<String> command, String chardev) Extracts the channel id and the socket path from the QEMU command line.void
When the virtual serial port with the configured channel id has been opened callagentConnected()
.Methods inherited from class org.jdrupes.vmoperator.runner.qemu.QemuConnector
configure, onClientConnected, onClosed, onConnectError, onFileChanged, onInput, onStart, processInput, qemuChannel, rep, sendCommand, socketConnected, 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
-
Field Details
-
channelId
-
-
Constructor Details
-
AgentConnector
Instantiates a new agent connector.- Parameters:
componentChannel
- the component channel- Throws:
IOException
- Signals that an I/O exception has occurred.
-
-
Method Details
-
configureConnection
Extracts the channel id and the socket path from the QEMU command line.- Parameters:
command
- the commandchardev
- the chardev
-
onVserportChanged
When the virtual serial port with the configured channel id has been opened callagentConnected()
.- Parameters:
event
- the event
-
agentConnected
Called when the agent in the VM opens the connection.The default implementation does nothing.
-
agentDisconnected
Called when the agent in the VM closes the connection.The default implementation does nothing.
-