Interface MaleSocket

    • Method Detail

      • setEnabled

        void setEnabled​(boolean enable)
        Set whenether this male socket is enabled or disabled.

        This method must call registerListeners() / unregisterListeners().

        Parameters:
        enable - true if this male socket should be enabled, false otherwise
      • setEnabledFlag

        void setEnabledFlag​(boolean enable)
        Set whenether this male socket is enabled or disabled, without activating the male socket. This is used when loading the xml file and when copying an item.

        This method must call registerListeners() / unregisterListeners().

        Parameters:
        enable - true if this male socket should be enabled, false otherwise
      • isEnabled

        boolean isEnabled()
        Determines whether this male socket is enabled.
        Specified by:
        isEnabled in interface Base
        Returns:
        true if the male socket is enabled, false otherwise
      • getListen

        boolean getListen()
        Get whenether the node should listen to changes or not.
        Returns:
        true if listen, false if not listen
      • setListen

        void setListen​(boolean listen)
        Set whenether the node should listen to changes or not.
        Parameters:
        listen - true if listen, false if not listen
      • isLocked

        boolean isLocked()
        Is the node locked?
        Returns:
        true if locked, false otherwise
      • setLocked

        void setLocked​(boolean locked)
        Set if the node is locked or not.
        Parameters:
        locked - true if locked, false otherwise
      • isSystem

        boolean isSystem()
        Is the node a system node?
        Returns:
        true if system, false otherwise
      • setSystem

        void setSystem​(boolean system)
        Set if the node is system or not.
        Parameters:
        system - true if system, false otherwise
      • getCatchAbortExecution

        boolean getCatchAbortExecution()
        Is the node catching AbortExecution or not?
        Returns:
        true if catching, false otherwise
      • setCatchAbortExecution

        void setCatchAbortExecution​(boolean catchAbortExecution)
        Set if the node should catch AbortExecution or not.
        Parameters:
        catchAbortExecution - true if catch, false otherwise
      • handleError

        void handleError​(Base item,
                         java.lang.String message,
                         JmriException e,
                         org.slf4j.Logger log)
                  throws JmriException
        Handle an error that has happened during execution or evaluation of this item.
        Parameters:
        item - the item that had the error
        message - the error message
        e - the exception that has happened
        log - the logger
        Throws:
        JmriException - if the male socket is configured to throw an exception
      • handleError

        void handleError​(Base item,
                         java.lang.String message,
                         java.util.List<java.lang.String> messageList,
                         JmriException e,
                         org.slf4j.Logger log)
                  throws JmriException
        Handle an error that has happened during execution or evaluation of this item.
        Parameters:
        item - the item that had the error
        message - the error message
        messageList - a list of error messages
        e - the exception that has happened
        log - the logger
        Throws:
        JmriException - if the male socket is configured to throw an exception
      • handleError

        void handleError​(Base item,
                         java.lang.String message,
                         java.lang.RuntimeException e,
                         org.slf4j.Logger log)
                  throws JmriException
        Handle an error that has happened during execution or evaluation of this item.
        Parameters:
        item - the item that had the error
        message - the error message
        e - the exception that has happened
        log - the logger
        Throws:
        JmriException - if the male socket is configured to throw an exception
      • getObject

        @Nonnull
        Base getObject()
        Get the object that this male socket holds. This method is used when the object is going to be configured.
        Returns:
        the object this male socket holds
      • getManager

        BaseManager<? extends NamedBeangetManager()
        Get the manager that stores this socket. This method is used when the object is going to be configured.
        Returns:
        the manager
      • setup

        default void setup()
        Setup this object and its children. This method is used to lookup system names for child sockets, turnouts, sensors, and so on.
        Specified by:
        setup in interface Base
      • find

        default MaleSocket find​(java.lang.Class<?> clazz)
        Find a male socket of a particular type. Male sockets can be stacked and this method travels thru the stacked male sockets to find the desired male socket.
        Parameters:
        clazz - the type of the male socket we are looking for
        Returns:
        the found male socket or null if not found