Class SingletonResolver<T>

    • Constructor Detail

      • SingletonResolver

        public SingletonResolver​(@NotNull
                                 T singleton)
    • Method Detail

      • resolve

        @NotNull
        public T resolve​(Packet request)
        Description copied from class: InstanceResolver
        Decides which instance of 'T' serves the given request message.

        This method is called concurrently by multiple threads. It is also on a criticail path that affects the performance. A good implementation should try to avoid any synchronization, and should minimize the amount of work as much as possible.

        Specified by:
        resolve in class InstanceResolver<T>
        Parameters:
        request - Always non-null. Represents the request message to be served. The caller may not consume the Message.