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

public abstract class AgentConnector extends QemuConnector
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

    Fields
    Modifier and Type
    Field
    Description
    protected String
     

    Fields inherited from class org.jdrupes.vmoperator.runner.qemu.QemuConnector

    mapper

    Fields inherited from class org.jgrapes.core.Component

    logger

    Fields inherited from interface org.jgrapes.core.Channel

    BROADCAST, SELF
  • Constructor Summary

    Constructors
    Constructor
    Description
    AgentConnector(org.jgrapes.core.Channel componentChannel)
    Instantiates a new agent connector.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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 call agentConnected().

    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

    Methods inherited from interface org.jgrapes.core.Manager

    stream
  • Field Details

  • Constructor Details

    • AgentConnector

      public AgentConnector(org.jgrapes.core.Channel componentChannel) throws IOException
      Instantiates a new agent connector.
      Parameters:
      componentChannel - the component channel
      Throws:
      IOException - Signals that an I/O exception has occurred.
  • Method Details

    • configureConnection

      protected void configureConnection(List<String> command, String chardev)
      Extracts the channel id and the socket path from the QEMU command line.
      Parameters:
      command - the command
      chardev - the chardev
    • onVserportChanged

      @Handler public void onVserportChanged(VserportChangeEvent event)
      When the virtual serial port with the configured channel id has been opened call agentConnected().
      Parameters:
      event - the event
    • agentConnected

      protected void agentConnected()
      Called when the agent in the VM opens the connection.

      The default implementation does nothing.

    • agentDisconnected

      protected void agentDisconnected()
      Called when the agent in the VM closes the connection.

      The default implementation does nothing.