Interface ServerImplementation


  • public interface ServerImplementation
    This interface may be implemented by server classes which implement the programs of a library. Second, this interface can be used to implement custom methods for initialization and shutdown of the server. These methods can deal with connections to other components like databases.
    Since:
    7.1.1.50
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void closeConversation​(boolean commit)
      Method called by the RPC Server when a conversation RPC ends.
      The parameter indicates that the RPC client has closed the conversation with the option commit.
      void finish()
      Called on termination of a worker thread.
      void init()
      Called on start by the Java RPC server.
      void shutdown()
      Called on shutdown by the Java RPC server.
    • Method Detail

      • closeConversation

        void closeConversation​(boolean commit)
        Method called by the RPC Server when a conversation RPC ends.
        The parameter indicates that the RPC client has closed the conversation with the option commit. Otherwise the commit option has not been specified by the RPC client or the conversation has been terminated abnormally.
        Implement this method in your server class.
        Parameters:
        commit - true if closeConversationCommit has been called by RPC client, false otherwise
        Since:
        EntireX 7.1.1.50
      • init

        void init()
           throws java.lang.Exception
        Called on start by the Java RPC server. Create a class implementing this interface. The server reads the name of the class from the configuration, instantiates the class and calls this method on start-up. If this method throws an exception, the stack trace is written to the log file or to System.out. In this case the server does not start.
        The invocation of this method is not synchronized.
        Throws:
        java.lang.Exception - if the method fails.
      • shutdown

        void shutdown()
               throws java.lang.Exception
        Called on shutdown by the Java RPC server. Create a class implementing this interface. The server uses the same instance as for the init() and calls this method on shutdown. If this method throws an exception, the stack trace is written to the log file or to System.out. In this case the shutdown proceeds.
        The invocation of this method is not synchronized. If the init starts any threads, shutdown must stop these threads. Otherwise, the Java RPC server will not terminate.
        Throws:
        java.lang.Exception - if the method fails.
      • finish

        void finish()
             throws java.lang.Exception
        Called on termination of a worker thread. If a server class implements this interface, this method is called when a worker thread of the Java RPC server terminates. If this method throws an exception, the stack trace is written to the log file or to System.out. This method is called once for each worker thread and each server class of this worker thread.
        Throws:
        java.lang.Exception - if the method fails.