Examples of assignHandler()


Examples of eu.mosaic_cloud.tools.callbacks.implementations.basic.BasicCallbackReactor.assignHandler()

    final ChannelController channelController = channel.getController ();
    final ChannelCallbacks channelCallbacksProxy = reactor.createProxy (ChannelCallbacks.class);
    Assert.assertTrue (channelController.bind (channelCallbacksProxy).await (BasicChannelTest.defaultPollTimeout));
    final QueueingChannelCallbacks channelCallbacks = QueueingChannelCallbacks.create (channelController, exceptions);
    final CallbackIsolate channelCallbacksIsolate = reactor.createIsolate ();
    Assert.assertTrue (reactor.assignHandler (channelCallbacksProxy, channelCallbacks, channelCallbacksIsolate).await (BasicChannelTest.defaultPollTimeout));
    for (int index = 0; index < BasicChannelTest.defaultTries; index++) {
      final ChannelMessage outboundMessage = RandomMessageGenerator.defaultInstance.generateChannelMessage ();
      Assert.assertTrue (channelController.send (outboundMessage).await (BasicChannelTest.defaultPollTimeout));
      final ChannelMessage inboundMessage = channelCallbacks.queue.poll (BasicChannelTest.defaultPollTimeout, TimeUnit.MILLISECONDS);
      Assert.assertNotNull (inboundMessage);
View Full Code Here

Examples of eu.mosaic_cloud.tools.callbacks.implementations.basic.BasicCallbackReactor.assignHandler()

    final ComponentController componentController = component.getController ();
    final ComponentCallbacks componentCallbacksProxy = reactor.createProxy (ComponentCallbacks.class);
    Assert.assertTrue (componentController.bind (componentCallbacksProxy, channel.getController ()).await (BasicComponentTest.defaultPollTimeout));
    final QueueingComponentCallbacks componentCallbacks = QueueingComponentCallbacks.create (componentController, exceptions);
    final CallbackIsolate componentCallbacksIsolate = reactor.createIsolate ();
    Assert.assertTrue (reactor.assignHandler (componentCallbacksProxy, componentCallbacks, componentCallbacksIsolate).await (BasicComponentTest.defaultPollTimeout));
    final ComponentIdentifier peer = ComponentIdentifier.resolve (Strings.repeat ("00", 20));
    for (int index = 0; index < BasicComponentTest.defaultTries; index++) {
      final ComponentCallRequest outboundRequest = RandomMessageGenerator.defaultInstance.generateComponentCallRequest ();
      Assert.assertTrue (componentController.call (peer, outboundRequest).await (BasicComponentTest.defaultPollTimeout));
      final ComponentCallRequest inboundRequest = (ComponentCallRequest) componentCallbacks.queue.poll (BasicComponentTest.defaultPollTimeout, TimeUnit.MILLISECONDS);
View Full Code Here

Examples of eu.mosaic_cloud.tools.callbacks.implementations.basic.BasicCallbackReactor.assignHandler()

    Assert.assertTrue (clientComponentController.bind (clientComponentCallbacksProxy, clientChannel.getController ()).await (AbacusTest.defaultPollTimeout));
    final AbacusComponentCallbacks serverComponentCallbacks = new AbacusComponentCallbacks (ComponentEnvironment.create (ComponentIdentifier.standalone, this.getClass ().getClassLoader (), reactor, threading, exceptions));
    final QueueingComponentCallbacks clientComponentCallbacks = QueueingComponentCallbacks.create (clientComponentController, exceptions);
    final CallbackIsolate serverComponentCallbacksIsolate = reactor.createIsolate ();
    final CallbackIsolate clientComponentCallbacksIsolate = reactor.createIsolate ();
    Assert.assertTrue (reactor.assignHandler (serverComponentCallbacksProxy, serverComponentCallbacks, serverComponentCallbacksIsolate).await (AbacusTest.defaultPollTimeout));
    Assert.assertTrue (reactor.assignHandler (clientComponentCallbacksProxy, clientComponentCallbacks, clientComponentCallbacksIsolate).await (AbacusTest.defaultPollTimeout));
    final ComponentIdentifier peer = ComponentIdentifier.resolve (Strings.repeat ("00", 20));
    for (int index = 0; index < AbacusTest.defaultTries; index++) {
      final double operandA = (int) (Math.random () * 10);
      final double operandB = (int) (Math.random () * 10);
 
View Full Code Here

Examples of eu.mosaic_cloud.tools.callbacks.implementations.basic.BasicCallbackReactor.assignHandler()

    final AbacusComponentCallbacks serverComponentCallbacks = new AbacusComponentCallbacks (ComponentEnvironment.create (ComponentIdentifier.standalone, this.getClass ().getClassLoader (), reactor, threading, exceptions));
    final QueueingComponentCallbacks clientComponentCallbacks = QueueingComponentCallbacks.create (clientComponentController, exceptions);
    final CallbackIsolate serverComponentCallbacksIsolate = reactor.createIsolate ();
    final CallbackIsolate clientComponentCallbacksIsolate = reactor.createIsolate ();
    Assert.assertTrue (reactor.assignHandler (serverComponentCallbacksProxy, serverComponentCallbacks, serverComponentCallbacksIsolate).await (AbacusTest.defaultPollTimeout));
    Assert.assertTrue (reactor.assignHandler (clientComponentCallbacksProxy, clientComponentCallbacks, clientComponentCallbacksIsolate).await (AbacusTest.defaultPollTimeout));
    final ComponentIdentifier peer = ComponentIdentifier.resolve (Strings.repeat ("00", 20));
    for (int index = 0; index < AbacusTest.defaultTries; index++) {
      final double operandA = (int) (Math.random () * 10);
      final double operandB = (int) (Math.random () * 10);
      final ComponentCallRequest request = ComponentCallRequest.create ("+", Arrays.asList (Double.valueOf (operandA), Double.valueOf (operandB)), ByteBuffer.allocate (0), ComponentCallReference.create ());
View Full Code Here

Examples of eu.mosaic_cloud.tools.callbacks.implementations.basic.BasicCallbackReactor.assignHandler()

      }
    }
    final LinkedList<QueueingQueueCallbackHandler<Integer>> handlers = new LinkedList<QueueingQueueCallbackHandler<Integer>> ();
    for (int index = 0; index < BasicCallbackReactorTest.defaultQueueCount; index++) {
      final QueueingQueueCallbackHandler<Integer> handler = QueueingQueueCallbackHandler.create (exceptions);
      final CallbackCompletion<Void> completion = reactor.assignHandler (triggers.get (index), handler, isolate);
      handlers.add (handler);
      completions.add (completion);
    }
    for (final CallbackCompletion<Void> completion : completions)
      Assert.assertTrue (completion.await (BasicCallbackReactorTest.defaultPollTimeout));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.