Package eu.mosaic_cloud.platform.core.configuration

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


    @Override
    public CallbackCompletion<Void> initialize (final ConsumerByteBenchmarkWithTimeInizioContext context, final CloudletCallbackArguments<ConsumerByteBenchmarkWithTimeInizioContext> arguments)
    {
      this.logger.info ("ConsumerByte initializing...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration queueConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queuemhttpgw.consumer"));
      final IConfiguration queueConfiguration2 = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queueclient.publisher"));
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (queueConfiguration2, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpPublisherCallback (), context);
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (queueConfiguration, byte[].class, NullDataEncoder.create(), new AmqpConsumerCallback (), context);
      final IConfiguration kvConfiguration2 = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("timestore"));
      context.kvStoretempi = context.cloudlet.getConnectorFactory (IKvStoreConnectorFactory.class).create (kvConfiguration2, ListaTempi.class, JsonDataEncoder.create(ListaTempi.class) , new KeyValueCallbackTempi (), context);
      return CallbackCompletion.createAndChained (context.consumer.initialize (),context.publisher.initialize (),context.kvStoretempi.initialize());
    }
View Full Code Here


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

    @Override
    public CallbackCompletion<Void> initialize (final XmlAnalyzerCloudletKvWithTimeContext context, final CloudletCallbackArguments<XmlAnalyzerCloudletKvWithTimeContext> arguments)
    {
      this.logger.info ("XmlAnalyzerCloudletKv initializing...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration queueConfiguration2 = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queue1.consumer"));
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (queueConfiguration2, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpConsumerCallback (), context);
      final IConfiguration queueConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queue2.publisher"));
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (queueConfiguration, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpPublisherCallback (), context);
      final IConfiguration kvConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("resultstore"));
      context.kvStore = context.cloudlet.getConnectorFactory (IKvStoreConnectorFactory.class).create (kvConfiguration, Dato.class, JsonDataEncoder.create(Dato.class) , new KeyValueCallback (), context);
      final IConfiguration kvConfiguration2 = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("timestore"));
      context.kvStoretempi = context.cloudlet.getConnectorFactory (IKvStoreConnectorFactory.class).create (kvConfiguration2, ListaTempi.class, JsonDataEncoder.create(ListaTempi.class) , new KeyValueCallbackTempi (), context);
      return CallbackCompletion.createAndChained (context.consumer.initialize (),context.publisher.initialize (),context.kvStore.initialize(),context.kvStoretempi.initialize());
    }
View Full Code Here

       *
       * Interfaccia generica per la gestione del file di configurazione (descrittore Cloudlet)
       *
       */
     
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
     
     
     
     
      /*
       * spliceConfiguration
       *
       * Restituisce una configurazione che contiene tutti i parametri
       * i cui nomi iniziano con un determinato identificatore (identificatore di root).
       */
     
      final IConfiguration queueConfiguration2 = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queue1.consumer"));
     
      /* L'implementare  dei connector richiede una  classe di callback.
       *  Inoltre, si dovrebbe anche fornire un encoder (serializzatore e deserializzatore) per i dati.
       *  La ragione di questo è che i connettori e driver gestiscono i dati utilizzando i flussi di byte e lasciano
       *   il compito di interpretare questi flussi di byte.
       *
       */
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (queueConfiguration2, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpConsumerCallback (), context);
      final IConfiguration queueConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queue2.publisher"));
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (queueConfiguration, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpPublisherCallback (), context);
      return CallbackCompletion.createAndChained (context.consumer.initialize (),context.publisher.initialize ());
    }
View Full Code Here

    @Override
    public CallbackCompletion<Void> initialize (final ConsumerByteSlaContext context, final CloudletCallbackArguments<ConsumerByteSlaContext> arguments)
    {
      this.logger.info ("ConsumerByteSla initializing...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration queueConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queuemhttpgw.consumer"));
      final IConfiguration queueConfiguration2 = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queueclient.publisher"));
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (queueConfiguration2, String.class, JsonDataEncoder.create(String.class), new AmqpPublisherCallback (), context);
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (queueConfiguration, byte[].class, NullDataEncoder.create(), new AmqpConsumerCallback (), context);
      return CallbackCompletion.createAndChained (context.consumer.initialize (),context.publisher.initialize ());
    }
View Full Code Here

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

    public CallbackCompletion<Void> initialize (final ConsumerCloudletContext context, final CloudletCallbackArguments<ConsumerCloudletContext> arguments)
    {
      context.cloudlet = arguments.getCloudlet ();
      context.logger = this.logger;
      context.logger.info ("ConsumerCloudlet initializing...");
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration queueConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("consumer"));
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (queueConfiguration, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new AmqpConsumerCallback (), context);
      return context.consumer.initialize ();
    }
View Full Code Here

    @Override
    public CallbackCompletion<Void> initialize (final PingCloudletContext context, final CloudletCallbackArguments<PingCloudletContext> arguments)
    {
      this.logger.info ("initializing cloudlet...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration consumerConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("consumer"));
      final IConfiguration publisherConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("publisher"));
      this.logger.info ("creating queue connectors...");
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (consumerConfiguration, PongMessage.class, JsonDataEncoder.create (PongMessage.class), new AmqpConsumerCallback (), context);
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (publisherConfiguration, PingMessage.class, JsonDataEncoder.create (PingMessage.class), new AmqpPublisherCallback (), context);
      this.logger.info ("initializing queue connectors...");
      return CallbackCompletion.createAndChained (context.consumer.initialize (), context.publisher.initialize ());
View Full Code Here

  @BeforeClass
  public static void setUpBeforeClass ()
  {
    final String host = System.getProperty (RiakKvStoreConnectorTest.MOSAIC_RIAK_HOST, RiakKvStoreConnectorTest.MOSAIC_RIAK_HOST_DEFAULT);
    final Integer port = Integer.valueOf (System.getProperty (RiakKvStoreConnectorTest.MOSAIC_RIAK_PORT, RiakKvStoreConnectorTest.MOSAIC_RIAK_PORT_DEFAULT));
    final IConfiguration configuration = PropertyTypeConfiguration.create ();
    configuration.addParameter ("interop.driver.endpoint", "inproc://fb012d6b-c238-4b31-b889-4121a318b2cb");
    configuration.addParameter ("interop.driver.identity", "fb012d6b-c238-4b31-b889-4121a318b2cb");
    configuration.addParameter ("kvstore.host", host);
    configuration.addParameter ("kvstore.port", port);
    configuration.addParameter ("kvstore.driver_name", "RIAKREST");
    configuration.addParameter ("kvstore.driver_threads", 1);
    configuration.addParameter ("kvstore.bucket", "tests");
    final Scenario scenario = new Scenario (RiakKvStoreConnectorTest.class, configuration);
    scenario.registerDriverRole (KeyValueSession.DRIVER);
    BaseConnectorTest.driverStub = KeyValueStub.createDetached (configuration, scenario.getThreading (), scenario.getDriverChannel ());
    RiakKvStoreConnectorTest.scenario_ = scenario;
  }
View Full Code Here

  @BeforeClass
  public static void setUpBeforeClass ()
  {
    final String host = System.getProperty (MemcacheKvStoreConnectorTest.MOSAIC_MEMCACHED_HOST, MemcacheKvStoreConnectorTest.MOSAIC_MEMCACHED_HOST_DEFAULT);
    final Integer port = Integer.valueOf (System.getProperty (MemcacheKvStoreConnectorTest.MOSAIC_MEMCACHED_PORT, MemcacheKvStoreConnectorTest.MOSAIC_MEMCACHED_PORT_DEFAULT));
    final IConfiguration configuration = PropertyTypeConfiguration.create ();
    configuration.addParameter ("interop.driver.endpoint", "inproc://f0bfd2cc-07ab-4df1-935c-22e80779bc87");
    configuration.addParameter ("interop.driver.identity", "f0bfd2cc-07ab-4df1-935c-22e80779bc87");
    configuration.addParameter ("memcached.host_1", host);
    configuration.addParameter ("memcached.port_1", port);
    configuration.addParameter ("kvstore.driver_name", "MEMCACHED");
    configuration.addParameter ("kvstore.driver_threads", 1);
    configuration.addParameter ("kvstore.bucket", "test");
    configuration.addParameter ("kvstore.user", "test");
    configuration.addParameter ("kvstore.passwd", "test");
    final Scenario scenario = new Scenario (MemcacheKvStoreConnectorTest.class, configuration);
    scenario.registerDriverRole (KeyValueSession.DRIVER);
    scenario.registerDriverRole (MemcachedSession.DRIVER);
    BaseConnectorTest.driverStub = MemcachedStub.createDetached (configuration, scenario.getDriverChannel (), scenario.getThreading ());
    MemcacheKvStoreConnectorTest.scenario_ = scenario;
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.