@Override
public CallbackCompletion<Void> initialize (final ServletContext context, final CloudletCallbackArguments<ServletContext> arguments)
{
this.logger.info ("Servlet initializing...");
context.cloudlet = arguments.getCloudlet ();
final IConfiguration configuration = context.cloudlet.getConfiguration ();
final IConfiguration queueConfiguration2 = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queue_input.publisher"));
context.publisher = context.cloudlet.getConnectorFactory (IAmqpQueuePublisherConnectorFactory.class).create (queueConfiguration2, KeyMessage.class, JsonDataEncoder.create(KeyMessage.class), new AmqpPublisherCallback(), context);
final IConfiguration queueConfiguration = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("queuemhttpgw.consumer"));
context.consumer = context.cloudlet.getConnectorFactory (IAmqpQueueConsumerConnectorFactory.class).create (queueConfiguration, byte[].class, NullDataEncoder.create(), new AmqpConsumerCallback (), context);
final IConfiguration kvConfigurationbyte = configuration.spliceConfiguration (ConfigurationIdentifier.resolveAbsolute ("resultstorebyte"));
context.kvStorebyte = context.cloudlet.getConnectorFactory (IKvStoreConnectorFactory.class).create (kvConfigurationbyte, byte[].class, NullDataEncoder.DEFAULT_INSTANCE, new KeyValueCallbackbyte (), context);
return CallbackCompletion.createAndChained (context.kvStorebyte.initialize(),context.publisher.initialize(),context.consumer.initialize());
}