Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/main/java/com/google/maps/GeoApiContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -51,7 +53,7 @@
* <p>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;
Expand Down Expand Up @@ -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
Expand Down