List of usage examples for com.amazonaws AmazonWebServiceClient getServiceName
public String getServiceName()
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); }); }