Class HandlerException

java.lang.Object
java.lang.Throwable
java.lang.Exception
it.fi.meucci.exceptions.HandlerException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CommandNotRecognizedException, DestNotCorrectException, DisconnectException, NeedNameException

public abstract class HandlerException extends Exception
This class represents one of the fundamental mechanism with which the server work. This is an abstract class, so their abstract methods must be implemented. Abstract methods are already implemented by other classes in this same package, and they all implement the method `getServerAnnouncement()` so that it can be printed and can be easily accessed by the Handler. This way, a HandlerException can be thrown, and only one needs to be handled. For further information, cfr. handle() method in RequestListener
See Also:
  • Constructor Details

    • HandlerException

      public HandlerException()
  • Method Details

    • getServerAnnouncement

      public abstract ServerAnnouncement getServerAnnouncement()
      This is the method that must be implemented by classes in this package. It must return a type of server announcement, that will then be sent as a message to the client.
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Throwable
    • print

      public void print()