Guest User

Untitled

a guest
Dec 16th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. final EventListener implmentation = // create actual implementation
  2. final Disruptor<ProxyMethodInvocation> disruptor = // create disruptor
  3.  
  4. final RingBufferProxyGeneratorFactory generatorFactory =
  5. new RingBufferProxyGeneratorFactory();
  6.  
  7. final RingBufferProxyGenerator proxyGenerator =
  8. generatorFactory.create(GeneratorType.BYTECODE_GENERATION);
  9.  
  10. final EventListener proxy = ringBufferProxyGenerator.createRingBufferProxy(
  11. implementation, EventListener.class, disruptor);
  12.  
  13. disruptor.start();
  14.  
  15. proxy.onEventA("foo", 42);
  16. proxy.onEventB(Long.MIN_VALUE, Long.MAX_VALUE);
Add Comment
Please, Sign In to add comment