Class JRTConnection

  • All Implemented Interfaces:
    Connection

    public class JRTConnection
    extends java.lang.Object
    implements Connection
    A JRT connection to a config server or config proxy.
    Author:
    Gunnar Gauslaa Bergem
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.logging.Logger logger  
    • Constructor Summary

      Constructors 
      Constructor Description
      JRTConnection​(java.lang.String address, com.yahoo.jrt.Supervisor supervisor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAddress()  
      com.yahoo.jrt.Target getTarget()
      This is synchronized to avoid multiple ConfigInstances creating new targets simultaneously, if the existing target is null, invalid or has not yet been initialized.
      void invokeAsync​(com.yahoo.jrt.Request request, double jrtTimeout, com.yahoo.jrt.RequestWaiter requestWaiter)  
      void invokeSync​(com.yahoo.jrt.Request request, double jrtTimeout)  
      void setError​(int errorCode)  
      void setSuccess()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • logger

        public static final java.util.logging.Logger logger
    • Constructor Detail

      • JRTConnection

        public JRTConnection​(java.lang.String address,
                             com.yahoo.jrt.Supervisor supervisor)
    • Method Detail

      • invokeAsync

        public void invokeAsync​(com.yahoo.jrt.Request request,
                                double jrtTimeout,
                                com.yahoo.jrt.RequestWaiter requestWaiter)
        Specified by:
        invokeAsync in interface Connection
      • invokeSync

        public void invokeSync​(com.yahoo.jrt.Request request,
                               double jrtTimeout)
        Specified by:
        invokeSync in interface Connection
      • getAddress

        public java.lang.String getAddress()
        Specified by:
        getAddress in interface Connection
      • getTarget

        public com.yahoo.jrt.Target getTarget()
        This is synchronized to avoid multiple ConfigInstances creating new targets simultaneously, if the existing target is null, invalid or has not yet been initialized.
        Returns:
        The existing target, or a new one if invalid or null.
      • setError

        public void setError​(int errorCode)
        Specified by:
        setError in interface Connection
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object