Class NeovimHandlerProxy

  • All Implemented Interfaces:
    com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback, com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback

    public final class NeovimHandlerProxy
    extends java.lang.Object
    implements com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback, com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback
    Class acting as both a container of RPCListener.RequestCallback and RPCListener.NotificationCallback and as a listener

    It passes all notifications/requests to contained listeners through a ExecutorService By default ImmediateExecutorService is used Default instance with ImmediateExecutorService is used by default in NeovimHandlerManager

    This allows handlers to not block used streamer when notifications/requests arrive and when many handlers are used

    Example:

         
         NeovimHandlerProxy neovimHandlerProxy = new NeovimHandlerProxy(customExecutorService);
         NeovimHandlerManager neovimHandlerManager = new NeovimHandlerManager(neovimHandlerProxy);
    
         neovimHandlerManager.registerNeovimHandler(uiEventHandler);
         neovimHandlerManager.attachToStream(neovimStream); // All notifications/requests are passed down using customExecutorService now
         
     
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addNotificationCallback​(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback notificationCallback)  
      void addRequestCallback​(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback requestCallback)  
      void notificationReceived​(com.ensarsarajcic.neovim.java.corerpc.message.NotificationMessage notificationMessage)  
      void removeNotificationCallback​(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback notificationCallback)  
      void removeRequestCallback​(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback requestCallback)  
      void requestReceived​(com.ensarsarajcic.neovim.java.corerpc.message.RequestMessage requestMessage)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NeovimHandlerProxy

        public NeovimHandlerProxy()
      • NeovimHandlerProxy

        public NeovimHandlerProxy​(java.util.concurrent.ExecutorService executorService)
    • Method Detail

      • addNotificationCallback

        public void addNotificationCallback​(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback notificationCallback)
      • addRequestCallback

        public void addRequestCallback​(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback requestCallback)
      • removeNotificationCallback

        public void removeNotificationCallback​(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback notificationCallback)
      • removeRequestCallback

        public void removeRequestCallback​(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback requestCallback)
      • notificationReceived

        public void notificationReceived​(com.ensarsarajcic.neovim.java.corerpc.message.NotificationMessage notificationMessage)
        Specified by:
        notificationReceived in interface com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback
      • requestReceived

        public void requestReceived​(com.ensarsarajcic.neovim.java.corerpc.message.RequestMessage requestMessage)
        Specified by:
        requestReceived in interface com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback