Package jmri.managers

Class DefaultRailComManager

All Implemented Interfaces:
PropertyChangeListener, VetoableChangeListener, EventListener, PropertyChangeFirer, PropertyChangeProvider, SilenceablePropertyChangeProvider, VetoableChangeFirer, VetoableChangeProvider, Disposable, IdTagManager, Manager<IdTag>, ProvidingManager<IdTag>, RailComManager

Concrete implementation for the Internal RailComManager interface.
Since:
2.99.4
  • Constructor Details

  • Method Details

    • setInstances

      final void setInstances()
    • createNewIdTag

      protected RailCom createNewIdTag(@Nonnull String systemName, String userName)
      Overrides:
      createNewIdTag in class DefaultIdTagManager
    • newIdTag

      Provide by userName, then SystemName, else create new. Provide ID Tag by UserName then SystemName, creates new IdTag if not found. Return an instance with the specified system and user names. Note that two calls with the same arguments will get the same instance; there is only one IdTag object representing a given physical IdTag and therefore only one with a specific system or user name.

      This will always return a valid object reference; a new object will be created if necessary. In that case:

      • If a null reference is given for user name, no user name will be associated with the IdTag object created; a valid system name must be provided
      • If both are provided, the system name defines the hardware access of the desired IdTag, and the user address is associated with it. The system name must be valid.
      Note that it is possible to make an inconsistent request if both addresses are provided, but the given values are associated with different objects. This is a problem, and we don't have a good solution except to issue warnings. This will mostly happen if you're creating RfidTags when you should be looking them up.
      Specified by:
      newIdTag in interface IdTagManager
      Overrides:
      newIdTag in class DefaultIdTagManager
      Parameters:
      systemName - the system name
      userName - the user name
      Returns:
      requested IdTag object (never null)
      Throws:
      IllegalArgumentException - if cannot create the IdTag due to e.g. an illegal name or name that can't be parsed.
    • writeIdTagDetails

      public void writeIdTagDetails() throws IOException
      Overrides:
      writeIdTagDetails in class DefaultIdTagManager
      Throws:
      IOException
    • readIdTagDetails

      public void readIdTagDetails()
      Overrides:
      readIdTagDetails in class DefaultIdTagManager