diff --git a/src/main/java/com/google/maps/GeoApiContext.java b/src/main/java/com/google/maps/GeoApiContext.java index e7561b641..222dacdff 100644 --- a/src/main/java/com/google/maps/GeoApiContext.java +++ b/src/main/java/com/google/maps/GeoApiContext.java @@ -27,6 +27,8 @@ import com.google.maps.metrics.NoOpRequestMetricsReporter; import com.google.maps.metrics.RequestMetrics; import com.google.maps.metrics.RequestMetricsReporter; +import java.io.Closeable; +import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.Proxy; import java.net.URLEncoder; @@ -51,7 +53,7 @@ *

When you are finished with a GeoApiContext object, you must call {@link #shutdown()} on it to * release its resources. */ -public class GeoApiContext { +public class GeoApiContext implements Closeable { private static final String VERSION = "@VERSION@"; // Populated by the build script private static final String USER_AGENT = "GoogleGeoApiClientJava/" + VERSION; @@ -95,6 +97,16 @@ public class GeoApiContext { setExperienceId(experienceIdHeaderValue); } + /** + * standard Java API to reclaim resources + * + * @throws IOException + */ + @Override + public void close() throws IOException { + shutdown(); + } + /** * The service provider interface that enables requests to be handled via switchable back ends. * There are supplied implementations of this interface for both OkHttp and Google App Engine's