Package org.jrd.agent

Class ConnectionDelegator

  • All Implemented Interfaces:
    Runnable

    public class ConnectionDelegator
    extends Thread
    • Method Detail

      • initialize

        public static boolean initialize​(String hostname,
                                         Integer port,
                                         InstrumentationProvider provider)
        This method is used to create an ConnectionDelegator object and start listener thread
        Parameters:
        hostname - host name to open communication with
        port - on which open socket
        provider - this is where instrumentation and transformer objects are stored
        Returns:
        boolean true if ran correctly, else false
      • run

        public void run()
        Waits for new connection. When client connects starts new worker thread and delegates connection to it
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread
      • gracefulShutdown

        public static void gracefulShutdown()
        Closes server socket Already connected clients can finish their work but no new clients can connect.