org.jclouds.location.config
Class LocationModule

java.lang.Object
  extended by com.google.inject.AbstractModule
      extended by org.jclouds.location.config.LocationModule
All Implemented Interfaces:
com.google.inject.Module

public class LocationModule
extends com.google.inject.AbstractModule

All of these are memoized as locations do not change often at runtime. Note that we take care to propagate authorization exceptions. this is so that we do not lock out the account.

Author:
Adrian Cole

Constructor Summary
LocationModule()
           
 
Method Summary
protected  void configure()
           
protected  com.google.common.base.Supplier<Location> implicitLocationSupplier(AtomicReference<AuthorizationException> authException, long seconds, ImplicitLocationSupplier uncached)
           
protected  com.google.common.base.Supplier<String> implicitRegionIdSupplier(AtomicReference<AuthorizationException> authException, long seconds, ImplicitRegionIdSupplier uncached)
           
protected  com.google.common.base.Supplier<Map<String,com.google.common.base.Supplier<Set<String>>>> isoCodesSupplier(AtomicReference<AuthorizationException> authException, long seconds, LocationIdToIso3166CodesSupplier uncached)
           
protected  com.google.common.base.Supplier<Set<? extends Location>> memoizedLocationsSupplier(AtomicReference<AuthorizationException> authException, long seconds, LocationsSupplier uncached)
           
protected  com.google.common.base.Supplier<URI> provideProvider(AtomicReference<AuthorizationException> authException, long seconds, ProviderURISupplier uncached)
           
protected  com.google.common.base.Supplier<Set<String>> regionIdsSupplier(AtomicReference<AuthorizationException> authException, long seconds, RegionIdsSupplier uncached)
           
protected  com.google.common.base.Supplier<Set<String>> regionIdsSupplier(AtomicReference<AuthorizationException> authException, long seconds, ZoneIdsSupplier uncached)
           
protected  com.google.common.base.Supplier<Map<String,com.google.common.base.Supplier<URI>>> regionIdToURISupplier(AtomicReference<AuthorizationException> authException, long seconds, RegionIdToURISupplier uncached)
           
protected  com.google.common.base.Supplier<Map<String,com.google.common.base.Supplier<Set<String>>>> regionIdToZoneIdsSupplier(AtomicReference<AuthorizationException> authException, long seconds, RegionIdToZoneIdsSupplier uncached)
           
protected  com.google.common.base.Supplier<Map<String,com.google.common.base.Supplier<URI>>> zoneIdToURISupplier(AtomicReference<AuthorizationException> authException, long seconds, ZoneIdToURISupplier uncached)
           
 
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationModule

public LocationModule()
Method Detail

configure

protected void configure()
Specified by:
configure in class com.google.inject.AbstractModule

isoCodesSupplier

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,com.google.common.base.Supplier<Set<String>>>> isoCodesSupplier(AtomicReference<AuthorizationException> authException,
                                                                                                                                        @Named(value="jclouds.session-interval")
                                                                                                                                        long seconds,
                                                                                                                                        LocationIdToIso3166CodesSupplier uncached)

provideProvider

@Provides
@Singleton
protected com.google.common.base.Supplier<URI> provideProvider(AtomicReference<AuthorizationException> authException,
                                                                                  @Named(value="jclouds.session-interval")
                                                                                  long seconds,
                                                                                  ProviderURISupplier uncached)

implicitLocationSupplier

@Provides
@Singleton
protected com.google.common.base.Supplier<Location> implicitLocationSupplier(AtomicReference<AuthorizationException> authException,
                                                                                                @Named(value="jclouds.session-interval")
                                                                                                long seconds,
                                                                                                ImplicitLocationSupplier uncached)

memoizedLocationsSupplier

@Provides
@Singleton
protected com.google.common.base.Supplier<Set<? extends Location>> memoizedLocationsSupplier(AtomicReference<AuthorizationException> authException,
                                                                                                                @Named(value="jclouds.session-interval")
                                                                                                                long seconds,
                                                                                                                LocationsSupplier uncached)

regionIdsSupplier

@Provides
@Singleton
protected com.google.common.base.Supplier<Set<String>> regionIdsSupplier(AtomicReference<AuthorizationException> authException,
                                                                                            @Named(value="jclouds.session-interval")
                                                                                            long seconds,
                                                                                            RegionIdsSupplier uncached)

regionIdToURISupplier

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,com.google.common.base.Supplier<URI>>> regionIdToURISupplier(AtomicReference<AuthorizationException> authException,
                                                                                                                                     @Named(value="jclouds.session-interval")
                                                                                                                                     long seconds,
                                                                                                                                     RegionIdToURISupplier uncached)

implicitRegionIdSupplier

@Provides
@Singleton
protected com.google.common.base.Supplier<String> implicitRegionIdSupplier(AtomicReference<AuthorizationException> authException,
                                                                                              @Named(value="jclouds.session-interval")
                                                                                              long seconds,
                                                                                              ImplicitRegionIdSupplier uncached)

regionIdsSupplier

@Provides
@Singleton
protected com.google.common.base.Supplier<Set<String>> regionIdsSupplier(AtomicReference<AuthorizationException> authException,
                                                                                            @Named(value="jclouds.session-interval")
                                                                                            long seconds,
                                                                                            ZoneIdsSupplier uncached)

regionIdToZoneIdsSupplier

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,com.google.common.base.Supplier<Set<String>>>> regionIdToZoneIdsSupplier(AtomicReference<AuthorizationException> authException,
                                                                                                                                                 @Named(value="jclouds.session-interval")
                                                                                                                                                 long seconds,
                                                                                                                                                 RegionIdToZoneIdsSupplier uncached)

zoneIdToURISupplier

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,com.google.common.base.Supplier<URI>>> zoneIdToURISupplier(AtomicReference<AuthorizationException> authException,
                                                                                                                                   @Named(value="jclouds.session-interval")
                                                                                                                                   long seconds,
                                                                                                                                   ZoneIdToURISupplier uncached)


Copyright © 2009-2012 jclouds. All Rights Reserved.