Class HardwareService

All Implemented Interfaces:
CtxEventListener, ContextHandleAware, HandleAware, Ready, ReadyAndReadyListener, ReadyListener

public final class HardwareService extends AbstractService
Service that manages all external hardware.
Since:
1.0
Version:
2023-03-06
  • Field Details

  • Method Details

    • onBeanReady

      public boolean onBeanReady()
      Description copied from interface: ReadyAndReadyListener
      Override in subclasses to be notified when all dependencies are ready. Return true to indicate that this bean is also ready. If the bean needs to call setReady() later due to some async processing, return false to prevent setReady() from being called automatically.

      It is recommended to override this method rather than onDependenciesReady() as a majority of the time it requires calling super.onDependneciesReady() or explicitly calling setReady() which defaults to a failure mode.

      Returns:
      true if this object is now ready
    • getResolvers

      public List<HardwareLinkResolver> getResolvers()
      Return the list of resolvers so that new resolvers can be added in the desired order. Resolvers are used to match HardwareLink objects to Board objects. Out of the box these are matched using BoardIdentity but the list of resolvers can be modified to include alternate ways of matching boards to links.
    • resolveBoards

      public void resolveBoards()
      Trigger the board resolve process. This process is triggered internally so there is rarely a need to call this externally unless the resolvers list has been modified.
    • register

      public void register(HardwareLink link)
      Register a hardware link. The link will be matched with a board so that the board can access the hardware.
    • unregister

      public void unregister(HardwareLink link)
      Unregister a hardware link. Called when hardware disconnects so the board can be updated to indicate that it is offline.
    • getIdentityMappingResolver

      public IdentityMappingResolver getIdentityMappingResolver()
      Return the resolver that can map a particuler board identifier, such as a serial number, to a particular logical board. This can be used to access the board mappings managed by this resolver.