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<org.jgrapes.core.ComponentType>,org.jgrapes.core.Channel,org.jgrapes.core.ComponentType,org.jgrapes.core.Eligible,org.jgrapes.core.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
org.jgrapes.core.Channel.Default -
Field Summary
FieldsFields inherited from class org.jdrupes.vmoperator.runner.qemu.QemuConnector
mapperFields inherited from class org.jgrapes.core.Component
loggerFields inherited from interface org.jgrapes.core.Channel
BROADCAST, SELF -
Constructor Summary
ConstructorsConstructorDescriptionAgentConnector(org.jgrapes.core.Channel componentChannel) Instantiates a new agent connector. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalled when the agent in the VM opens the connection.protected voidCalled when the agent in the VM closes the connection.protected voidconfigureConnection(List<String> command, String chardev) Extracts the channel id and the socket path from the QEMU command line.voidWhen the virtual serial port with the configured channel id has been opened callagentConnected().Methods inherited from class org.jdrupes.vmoperator.runner.qemu.QemuConnector
onClientConnected, onClosed, onConnectError, onFileChanged, onInput, onStart, processInput, qemuChannel, rep, sendCommand, socketConnected, writerMethods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setNameMethods 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, unregisterAsGeneratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.jgrapes.core.Manager
stream
-
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.
-