@Test public void testPreServeTriggersOnJoin() { when(serviceNode.join()).thenReturn(Futures.immediateFuture(lease)); when(lease.getExpirationFuture()).thenReturn(SettableFuture.<Void>create()); ThriftEventHandler handler = new ThriftEventHandler(serviceHandler, serviceNode); handler.preServe(); verify(serviceNode).join(); verify(lease).getExpirationFuture(); verify(serviceHandler).onJoin(); verifyNoMoreInteractions(serviceHandler, serviceNode, lease); }
@Override public void preServe() { ServiceNodeUtils.joinService(serviceNode, retryIntervalMsec, serviceNodeEventHandler); }
ThriftEventHandler implements TServerEventHandler { @Override public void preServe() { ServiceNodeUtils.joinService(serviceNode, retryIntervalMsec, serviceNodeEventHandler); } }
ThriftEventHandler implements TServerEventHandler { @Override public void preServe() { ServiceNodeUtils.joinService(serviceNode, retryIntervalMsec, serviceNodeEventHandler); } @Inject  ThriftEventHandler(@Assisted ServiceNodeEventHandler serviceNodeEventHandler,
                            @Assisted ServiceNode serviceNode); }
ThriftEventHandler implements TServerEventHandler { @Override public void preServe() { ServiceNodeUtils.joinService(serviceNode, retryIntervalMsec, serviceNodeEventHandler); } @Inject  ThriftEventHandler(@Assisted ServiceNodeEventHandler serviceNodeEventHandler,
                            @Assisted ServiceNode serviceNode); @Override void preServe(); @Override ServerContext createContext(TProtocol input, TProtocol output); @Override void deleteContext(ServerContext serverContext, TProtocol input, TProtocol output); @Override void processContext(ServerContext serverContext, TTransport inputTransport, TTransport outputTransport); }
ThriftEventHandler implements TServerEventHandler { @Override public void preServe() { ServiceNodeUtils.joinService(serviceNode, retryIntervalMsec, serviceNodeEventHandler); } @Inject  ThriftEventHandler(@Assisted ServiceNodeEventHandler serviceNodeEventHandler,
                            @Assisted ServiceNode serviceNode); @Override void preServe(); @Override ServerContext createContext(TProtocol input, TProtocol output); @Override void deleteContext(ServerContext serverContext, TProtocol input, TProtocol output); @Override void processContext(ServerContext serverContext, TTransport inputTransport, TTransport outputTransport);  }