Package eu.mosaic_cloud.platform.core.configuration

Examples of eu.mosaic_cloud.platform.core.configuration.IConfiguration


 
  public void testConsume ()
      throws InterruptedException,
        ExecutionException
  {
    final IConfiguration configuration = this.scenario.getConfiguration ();
    final String queue = ConfigUtils.resolveParameter (configuration, "consumer.amqp.queue", String.class, "");
    final boolean autoAck = ConfigUtils.resolveParameter (configuration, "consumer.amqp.auto_ack", Boolean.class, true);
    final boolean exclusive = ConfigUtils.resolveParameter (configuration, "consumer.amqp.exclusive", Boolean.class, true);
    final IAmqpQueueRawConsumerCallback consumerCallback = new ConsumerHandler ();
    Assert.assertTrue (this.awaitSuccess (this.connector.consume (queue, this.clientId, exclusive, autoAck, consumerCallback)));
View Full Code Here


  public void testPublish ()
      throws EncodingException,
        InterruptedException,
        ExecutionException
  {
    final IConfiguration configuration = this.scenario.getConfiguration ();
    final String exchange = ConfigUtils.resolveParameter (configuration, "publisher.amqp.exchange", String.class, "");
    final String routingKey = ConfigUtils.resolveParameter (configuration, "publisher.amqp.routing_key", String.class, "");
    final boolean manadatory = ConfigUtils.resolveParameter (configuration, "publisher.amqp.manadatory", Boolean.class, true);
    final boolean immediate = ConfigUtils.resolveParameter (configuration, "publisher.amqp.immediate", Boolean.class, true);
    final boolean durable = ConfigUtils.resolveParameter (configuration, "publisher.amqp.durable", Boolean.class, false);
View Full Code Here

    Assert.assertTrue (this.awaitSuccess (this.connector.publish (mssg)));
  }
 
  protected void testBindQueue ()
  {
    final IConfiguration configuration = this.scenario.getConfiguration ();
    final String exchange = ConfigUtils.resolveParameter (configuration, "publisher.amqp.exchange", String.class, "");
    final String routingKey = ConfigUtils.resolveParameter (configuration, "publisher.amqp.routing_key", String.class, "");
    final String queue = ConfigUtils.resolveParameter (configuration, "consumer.amqp.queue", String.class, "");
    Assert.assertTrue (this.awaitSuccess (this.connector.bindQueue (exchange, queue, routingKey)));
  }
View Full Code Here

  @BeforeClass
  public static void setUpBeforeClass ()
  {
    final String host = System.getProperty (AmqpQueueRawConnectorTest.MOSAIC_AMQP_HOST, AmqpQueueRawConnectorTest.MOSAIC_AMQP_HOST_DEFAULT);
    final Integer port = Integer.valueOf (System.getProperty (AmqpQueueRawConnectorTest.MOSAIC_AMQP_PORT, AmqpQueueRawConnectorTest.MOSAIC_AMQP_PORT_DEFAULT));
    final IConfiguration configuration = PropertyTypeConfiguration.create ();
    configuration.addParameter ("interop.driver.endpoint", "inproc://f4c74dc5-b548-4ec4-a6a6-ef97c79bf55d");
    configuration.addParameter ("interop.driver.identity", "f4c74dc5-b548-4ec4-a6a6-ef97c79bf55d");
    configuration.addParameter ("amqp.host", host);
    configuration.addParameter ("amqp.port", port);
    configuration.addParameter ("amqp.driver_threads", 1);
    configuration.addParameter ("consumer.amqp.queue", "tests.queue");
    configuration.addParameter ("consumer.amqp.consumer_id", "tests.consumer");
    configuration.addParameter ("consumer.amqp.auto_ack", true);
    configuration.addParameter ("consumer.amqp.exclusive", true);
    configuration.addParameter ("publisher.amqp.exchange", "tests.exchange");
    configuration.addParameter ("publisher.amqp.routing_key", "tests.queue");
    configuration.addParameter ("publisher.amqp.manadatory", true);
    configuration.addParameter ("publisher.amqp.immediate", true);
    configuration.addParameter ("publisher.amqp.durable", false);
    final BaseScenario scenario = new BaseScenario (AmqpQueueRawConnectorTest.class, configuration);
    scenario.registerDriverRole (AmqpSession.DRIVER);
    BaseConnectorTest.driverStub = AmqpStub.createDetached (configuration, scenario.getDriverChannel (), scenario.getThreading ());
    AmqpQueueRawConnectorTest.scenario_ = scenario;
  }
View Full Code Here

    BasicThreadingSecurityManager.initialize ();
    this.threadingContext = BasicThreadingContext.create (this, exceptions, exceptions.catcher);
    this.threadingContext.initialize ();
    final String host = System.getProperty (RedisDriverTest.MOSAIC_REDIS_HOST, RedisDriverTest.MOSAIC_REDIS_HOST_DEFAULT);
    final Integer port = Integer.valueOf (System.getProperty (RedisDriverTest.MOSAIC_REDIS_PORT, RedisDriverTest.MOSAIC_REDIS_PORT_DEFAULT));
    final IConfiguration configuration = PropertyTypeConfiguration.create ();
    configuration.addParameter ("kvstore.host", host);
    configuration.addParameter ("kvstore.port", port);
    configuration.addParameter ("kvstore.driver_name", "REDIS");
    configuration.addParameter ("kvstore.driver_threads", 1);
    configuration.addParameter ("kvstore.bucket", "999");
    this.wrapper = RedisDriver.create (configuration, this.threadingContext);
    this.wrapper.registerClient (RedisDriverTest.keyPrefix, "1");
    this.encoder = PlainTextDataEncoder.DEFAULT_INSTANCE;
  }
View Full Code Here

   */
  public KvDriverComponentCallbacks (final ComponentEnvironment context)
  {
    super (context);
    try {
      final IConfiguration configuration = PropertyTypeConfiguration.create (KvDriverComponentCallbacks.class.getResourceAsStream ("driver-component.properties"));
      this.setDriverConfiguration (configuration);
      this.resourceGroup = ComponentIdentifier.resolve (ConfigUtils.resolveParameter (this.getDriverConfiguration (), ConfigProperties.getString ("KVDriverComponentCallbacks.0"), String.class, "")); // $NON-NLS-1$ $NON-NLS-2$
      this.selfGroup = ComponentIdentifier.resolve (ConfigUtils.resolveParameter (this.getDriverConfiguration (), ConfigProperties.getString ("KVDriverComponentCallbacks.1"), String.class, "")); // $NON-NLS-1$ $NON-NLS-2$
      this.driverName = ConfigUtils.resolveParameter (this.getDriverConfiguration (), ConfigProperties.getString ("KVStoreDriver.6"), String.class, ""); // $NON-NLS-1$ $NON-NLS-2$
      this.status = Status.Created;
View Full Code Here

    @Override
    public CallbackCompletion<Void> initialize (final ClientParametirezedCloudletContext context, final CloudletCallbackArguments<ClientParametirezedCloudletContext> arguments)
    {
      this.logger.info ("ClientParametirezedCloudlet initializing...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration queueConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queueclient.publisher"));
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (queueConfiguration, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpPublisherCallback (), context);
      return context.publisher.initialize ();
    }
View Full Code Here

    @Override
    public CallbackCompletion<Void> initialize (final ResultCloudletContext context, final CloudletCallbackArguments<ResultCloudletContext> arguments)
    {
      this.logger.info ("ResultCloudlet initializing...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration kvConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("resultstore"));
      context.kvStore = context.cloudlet.getConnectorFactory (IKvStoreConnectorFactory.class).create (kvConfiguration, ListaResult.class, JsonDataEncoder.create (ListaResult.class), new KeyValueCallback (), context);
      final IConfiguration queueConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queueresult.consumer"));
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (queueConfiguration, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpConsumerCallback (), context);
      return CallbackCompletion.createAndChained (context.kvStore.initialize (), context.consumer.initialize ());
    }
View Full Code Here

    @Override
    public CallbackCompletion<Void> initialize (final ResultCloudletStringContext context, final CloudletCallbackArguments<ResultCloudletStringContext> arguments)
    {
      this.logger.info ("ResultCloudlet_KVString initializing...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration kvConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("resultstore"));
      context.kvStore = context.cloudlet.getConnectorFactory (IKvStoreConnectorFactory.class).create (kvConfiguration, String.class, JsonDataEncoder.create (String.class), new KeyValueCallback (), context);
      final IConfiguration queueConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queueresult.consumer"));
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (queueConfiguration, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpConsumerCallback (), context);
      final IConfiguration kvConfigurationbyte = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("resultstorestring"));
      context.kvStorestring = context.cloudlet.getConnectorFactory (IKvStoreConnectorFactory.class).create (kvConfigurationbyte, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new KeyValueCallbackString (), context);
      return CallbackCompletion.createAndChained (context.kvStore.initialize (), context.consumer.initialize (),context.kvStorestring.initialize());
    }
View Full Code Here

    @Override
    public CallbackCompletion<Void> initialize (final DebugKvbyteContext context, final CloudletCallbackArguments<DebugKvbyteContext> arguments)
    {
      this.logger.info ("DebugKvByte initializing...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration kvConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("resultstore"));
      context.kvStore = context.cloudlet.getConnectorFactory (IKvStoreConnectorFactory.class).create (kvConfiguration, byte[].class, NullDataEncoder.create (), new KeyValueCallback (), context);
      final IConfiguration queueConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queueresult.consumer"));
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (queueConfiguration, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpConsumerCallback (), context);
      final IConfiguration queueConfiguration2 =  configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queuefine.publisher"));
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (queueConfiguration2, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpPublisherCallback (), context);
     
      return CallbackCompletion.createAndChained (context.kvStore.initialize (), context.consumer.initialize (),context.publisher.initialize());
    }
View Full Code Here

TOP

Related Classes of eu.mosaic_cloud.platform.core.configuration.IConfiguration

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.