- java.lang.Object
-
- com.ensarsarajcic.neovim.java.handler.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.NotificationCallbackClass acting as both a container ofRpcListener.RequestCallbackandRpcListener.NotificationCallbackand as a listenerIt passes all notifications/requests to contained listeners through a
ExecutorServiceBy defaultImmediateExecutorServiceis used Default instance withImmediateExecutorServiceis used by default inNeovimHandlerManagerThis 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
-
-
Constructor Summary
Constructors Constructor Description NeovimHandlerProxy()NeovimHandlerProxy(java.util.concurrent.ExecutorService executorService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNotificationCallback(com.ensarsarajcic.neovim.java.corerpc.client.RpcListener.NotificationCallback notificationCallback)voidaddRequestCallback(com.ensarsarajcic.neovim.java.corerpc.client.RpcListener.RequestCallback requestCallback)voidnotificationReceived(com.ensarsarajcic.neovim.java.corerpc.message.NotificationMessage notificationMessage)voidremoveNotificationCallback(com.ensarsarajcic.neovim.java.corerpc.client.RpcListener.NotificationCallback notificationCallback)voidremoveRequestCallback(com.ensarsarajcic.neovim.java.corerpc.client.RpcListener.RequestCallback requestCallback)voidrequestReceived(com.ensarsarajcic.neovim.java.corerpc.message.RequestMessage requestMessage)
-
-
-
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:
notificationReceivedin interfacecom.ensarsarajcic.neovim.java.corerpc.client.RpcListener.NotificationCallback
-
requestReceived
public void requestReceived(com.ensarsarajcic.neovim.java.corerpc.message.RequestMessage requestMessage)
- Specified by:
requestReceivedin interfacecom.ensarsarajcic.neovim.java.corerpc.client.RpcListener.RequestCallback
-
-