Package eu.mosaic_cloud.interoperability.implementations.zeromq

Examples of eu.mosaic_cloud.interoperability.implementations.zeromq.ZeroMqChannel$Coder


      this.logger.info ("HDFS driver callback registered to group " + this.selfGroup);
      this.status = Status.Registered;
      // NOTE: create stub and interop channel
      final String channelId = "interop.driver.identifier";
      final String channelEndpoint = "interop.channel.address";
      final ZeroMqChannel driverChannel = this.createDriverChannel (channelId, channelEndpoint, DFSSession.DRIVER);
      try {
        this.stub = DFSInstanceStub.create (this.getDriverConfiguration (), this.threading, driverChannel);
      } catch (Exception exception) {
        throw new Error (exception);
      }
View Full Code Here


    final TranscriptExceptionTracer exceptions = TranscriptExceptionTracer.create (transcript, exceptionsQueue);
    final BasicThreadingContext threading = BasicThreadingContext.create (this, exceptions, exceptions.catcher);
    Assert.assertTrue (threading.initialize (KvTest.defaultPollTimeout));
    final String serverIdentity = UUID.randomUUID ().toString ();
    final String clientIdentity = UUID.randomUUID ().toString ();
    final ZeroMqChannel serverChannel = ZeroMqChannel.create (serverIdentity, threading, exceptions);
    serverChannel.register (KvSession.Server);
    serverChannel.accept (KvTest.defaultServerEndpoint);
    final ZeroMqChannel clientChannel = ZeroMqChannel.create (clientIdentity, threading, exceptions);
    clientChannel.register (KvSession.Client);
    clientChannel.connect (KvTest.defaultServerEndpoint);
    final KvServer server = new KvServer (exceptions, KvTest.defaultPollTimeout);
    server.initialize (serverChannel);
    final KvClient client_1 = new KvClient ();
    Assert.assertEquals (Boolean.TRUE, Threading.awaitOrCatch (client_1.initialize (clientChannel, serverIdentity), KvTest.defaultPollTimeout));
    Assert.assertEquals (Boolean.TRUE, Threading.awaitOrCatch (client_1.put ("a", "1"), KvTest.defaultPollTimeout));
    Assert.assertEquals (Boolean.TRUE, Threading.awaitOrCatch (client_1.put ("b", "2"), KvTest.defaultPollTimeout));
    final KvClient client_2 = new KvClient ();
    Assert.assertEquals (Boolean.TRUE, Threading.awaitOrCatch (client_2.initialize (clientChannel, serverIdentity), KvTest.defaultPollTimeout));
    Assert.assertEquals ("1", Threading.awaitOrCatch (client_2.get ("a"), KvTest.defaultPollTimeout));
    Assert.assertEquals ("2", Threading.awaitOrCatch (client_2.get ("b"), KvTest.defaultPollTimeout));
    Assert.assertTrue (serverChannel.terminate (KvTest.defaultPollTimeout));
    Assert.assertTrue (clientChannel.terminate (KvTest.defaultPollTimeout));
    Assert.assertTrue (threading.destroy (KvTest.defaultPollTimeout));
    Assert.assertNull (exceptionsQueue.queue.poll ());
  }
View Full Code Here

        throw (new IllegalStateException (e));
      }
      this.logger.info ("Key Value Store driver callback registered to group " + this.selfGroup); // $NON-NLS-1$
      this.status = Status.Registered;
      // NOTE: create stub and interop channel
      final ZeroMqChannel driverChannel = this.createDriverChannel (ConfigProperties.getString ("KVDriverComponentCallbacks.4"), ConfigProperties.getString ("KVDriverComponentCallbacks.3"), KeyValueSession.DRIVER);
      this.stub = KeyValueStub.create (this.getDriverConfiguration (), this.threading, driverChannel);
    } else {
      throw new IllegalStateException ();
    }
    return null;
View Full Code Here

      this.logger.info ("AMQP driver callback registered to group " + this.selfGroup); // $NON-NLS-1$
      this.status = Status.Registered;
      // NOTE: create stub and interop channel
      final String channelId = ConfigProperties.getString ("AmqpDriverComponentCallbacks.4");
      final String channelEndpoint = ConfigProperties.getString ("AmqpDriverComponentCallbacks.3");
      final ZeroMqChannel driverChannel = this.createDriverChannel (channelId, channelEndpoint, AmqpSession.DRIVER);
      this.stub = AmqpStub.create (this.getDriverConfiguration (), driverChannel, this.threading);
    } else {
      throw new IllegalStateException ();
    }
    return null;
View Full Code Here

 
  protected ZeroMqChannel createDriverChannel (final String channelIdentifierProp, final String channelEndpointProp, final SessionSpecification role)
  {
    // NOTE: create stub and interop channel
    Preconditions.checkNotNull (this.driverConfiguration);
    final ZeroMqChannel driverChannel = ZeroMqChannel.create (ConfigUtils.resolveParameter (this.driverConfiguration, channelIdentifierProp, String.class, ""), this.threading, this.exceptions);
    driverChannel.register (role);
    driverChannel.accept (ConfigUtils.resolveParameter (this.driverConfiguration, channelEndpointProp, String.class, ""));
    return driverChannel;
  }
View Full Code Here

TOP

Related Classes of eu.mosaic_cloud.interoperability.implementations.zeromq.ZeroMqChannel$Coder

Copyright © 2018 www.massapicom. 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.