Example usage for com.amazonaws AmazonWebServiceClient getServiceName

List of usage examples for com.amazonaws AmazonWebServiceClient getServiceName

Introduction

In this page you can find the example usage for com.amazonaws AmazonWebServiceClient getServiceName.

Prototype

public String getServiceName() 

Source Link

Document

Returns the service abbreviation for this service, used for identifying service endpoints by region, identifying the necessary signer, etc.

Usage

From source file:org.jooby.aws.Aws.java

License:Apache License

@Override
public void configure(final Env env, final Config config, final Binder binder) {

    callbacks.build().forEach(it -> {
        ConfigCredentialsProvider creds = new ConfigCredentialsProvider(config);
        AmazonWebServiceClient service = it.apply(creds, config);
        creds.service(service.getServiceName());
        Class serviceType = service.getClass();
        Class[] interfaces = serviceType.getInterfaces();
        if (interfaces.length > 0) {
            // pick first
            binder.bind(interfaces[0]).toInstance(service);
        }/*from   w  ww  .j  a va 2  s . c  o m*/
        binder.bind(serviceType).toInstance(service);
        env.onStop(new AwsShutdownSupport(service));
        after(env, binder, config, service);
    });
}