Package eu.mosaic_cloud.platform.core.configuration

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


    @Override
    public CallbackCompletion<Void> initialize (final PongCloudletContext context, final CloudletCallbackArguments<PongCloudletContext> 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, PingMessage.class, JsonDataEncoder.create (PingMessage.class), new AmqpConsumerCallback (), context);
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (publisherConfiguration, PongMessage.class, JsonDataEncoder.create (PongMessage.class), new AmqpPublisherCallback (), context);
      this.logger.info ("initializing queue connectors...");
      return CallbackCompletion.createAndChained (context.consumer.initialize (), context.publisher.initialize ());
View Full Code Here


  }
 
  @Override
  public final <TConnectorContext, TExtra> IComponentConnector<TExtra> create (final IComponentConnectorCallbacks<TConnectorContext, TExtra> callbacks, final TConnectorContext callbacksContext)
  {
    final IConfiguration configuration = PropertyTypeConfiguration.createEmpty ();
    final IComponentConnector<TExtra> connector = new ComponentConnector<TConnectorContext, TExtra> (this.cloudlet, this.backingConnector, configuration, callbacks, callbacksContext);
    return connector;
  }
View Full Code Here

    @Override
    public CallbackCompletion<Void> initialize (final UserCloudletContext context, final CloudletCallbackArguments<UserCloudletContext> arguments)
    {
      this.logger.info ("UserCloudlet initializing...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration consumerConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("consumer"));
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (consumerConfiguration, AuthenticationToken.class, SerializedDataEncoder.create (AuthenticationToken.class), new AmqpConsumerCallback (), context);
      final IConfiguration publisherConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("publisher"));
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (publisherConfiguration, LoggingData.class, SerializedDataEncoder.create (LoggingData.class), new AmqpPublisherCallback (), context);
      return CallbackCompletion.createAndChained (context.consumer.initialize (), context.publisher.initialize ());
    }
View Full Code Here

      context.logger.info ("initializing cloudlet...");
      context.cloudletCallback = this;
      context.executorCallback = new ExecutorCallback ();
      context.workflow = new Workflow ();
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      context.logger.info ("creating executor...");
      final IConfiguration executorConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("executor"));
      context.executor = context.cloudlet.getConnectorFactory (IExecutorFactory.class).create (executorConfiguration, context.executorCallback, context);
      context.logger.info ("initializing queue connectors...");
      return context.executor.initialize ();
    }
View Full Code Here

    public CallbackCompletion<Void> initialize (final Context context, final CloudletCallbackArguments<Context> arguments)
    {
      this.logger.info ("initializing cloudlet...");
      context.identity = UUID.randomUUID ().toString ();
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration cloudletConfiguration = context.cloudlet.getConfiguration ();
      final IConfiguration gatewayConfiguration = cloudletConfiguration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("gateway"));
      context.gateway = context.cloudlet.getConnectorFactory (IHttpgQueueConnectorFactory.class).create (gatewayConfiguration, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, String.class, PlainTextDataEncoder.DEFAULT_INSTANCE, new GatewayCallbacks (), context);
      return (context.gateway.initialize ());
    }
View Full Code Here

    @Override
    public CallbackCompletion<Void> initialize (final LoggingCloudletContext context, final CloudletCallbackArguments<LoggingCloudletContext> arguments)
    {
      this.logger.info ("LoggingCloudlet initializing...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration consumerConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("consumer"));
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (consumerConfiguration, LoggingData.class, SerializedDataEncoder.create (LoggingData.class), new AmqpConsumerCallback (), context);
      final IConfiguration publisherConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("publisher"));
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (publisherConfiguration, AuthenticationToken.class, SerializedDataEncoder.create (AuthenticationToken.class), new AmqpPublisherCallback (), context);
      return CallbackCompletion.createAndChained (context.consumer.initialize (), context.publisher.initialize ());
    }
View Full Code Here

    @Override
    public CallbackCompletion<Void> initialize (final LoggingCloudletContext context, final CloudletCallbackArguments<LoggingCloudletContext> arguments)
    {
      this.logger.info ("LoggingCloudlet initializing...");
      context.cloudlet = arguments.getCloudlet ();
      final IConfiguration configuration = context.cloudlet.getConfiguration ();
      final IConfiguration kvConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("kvstore"));
      context.kvStore = context.cloudlet.getConnectorFactory (IKvStoreConnectorFactory.class).create (kvConfiguration, String.class, SerializedDataEncoder.create (String.class), new KeyValueCallback (), context);
      final IConfiguration consumerConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("consumer"));
      context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (consumerConfiguration, LoggingData.class, SerializedDataEncoder.create (LoggingData.class), new AmqpConsumerCallback (), context);
      final IConfiguration publisherConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("publisher"));
      context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (publisherConfiguration, AuthenticationToken.class, SerializedDataEncoder.create (AuthenticationToken.class), new AmqpPublisherCallback (), context);
      return CallbackCompletion.createAndChained (context.kvStore.initialize (), context.consumer.initialize (), context.publisher.initialize ());
    }
View Full Code Here

 
  private final Cloudlet<?> createCloudletInstance ()
  {
    final Class<?> cloudletCallbacksClass = this.resolveCloudletCallbacksClass ();
    final Class<?> cloudletContextClass = this.resolveCloudletStateClass ();
    final IConfiguration cloudletConfiguration = this.resolveCloudletConfiguration ();
    // FIXME: Currently exceptions from cloudlets are not deferred anywhere.
    //-- Thus any deferred exception should be treated as an ignored one.
    final ExceptionTracer exceptions = new CloudletExceptionTracer ();
    final ConnectorEnvironment connectorEnvironment = ConnectorEnvironment.create (this.reactor, this.threading, exceptions, this.channelFactory, this.channelResolver);
    final IConnectorsFactory connectorFactory = DefaultConnectorsFactory.create (connectorEnvironment, null);
View Full Code Here

  {
    this.transcript.traceDebugging ("resolving the cloudlet configuration...");
    final String configurationDescriptor = ConfigUtils.resolveParameter (this.configuration, ConfigProperties.getString ("CloudletComponent.10"), String.class, null); // $NON-NLS-1$
    Preconditions.checkNotNull (configurationDescriptor, "unknown cloudlet configuration descriptor");
    this.transcript.traceDebugging ("resolving the cloudlet configuration `%s`...", configurationDescriptor);
    final IConfiguration configuration;
    try {
      configuration = PropertyTypeConfiguration.create (this.classLoader, configurationDescriptor);
    } catch (final Throwable exception) {
      this.exceptions.traceHandledException (exception);
      throw (new IllegalArgumentException ("error encountered while loading cloudlet configuration", exception));
View Full Code Here

  @BeforeClass
  public static void setUpBeforeClass ()
  {
    final String host = System.getProperty (RedisKvStoreConnectorTest.MOSAIC_REDIS_HOST, RedisKvStoreConnectorTest.MOSAIC_REDIS_HOST_DEFAULT);
    final Integer port = Integer.valueOf (System.getProperty (RedisKvStoreConnectorTest.MOSAIC_REDIS_PORT, RedisKvStoreConnectorTest.MOSAIC_REDIS_PORT_DEFAULT));
    final IConfiguration configuration = PropertyTypeConfiguration.create ();
    configuration.addParameter ("interop.driver.endpoint", "inproc://98eceebc-fd87-4ef3-84cf-3feca6044e5a");
    configuration.addParameter ("interop.driver.identity", "98eceebc-fd87-4ef3-84cf-3feca6044e5a");
    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", "10");
    final Scenario scenario = new Scenario (RedisKvStoreConnectorTest.class, configuration);
    scenario.registerDriverRole (KeyValueSession.DRIVER);
    BaseConnectorTest.driverStub = KeyValueStub.createDetached (configuration, scenario.getThreading (), scenario.getDriverChannel ());
    RedisKvStoreConnectorTest.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.