Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / tools / development / RequestEndListener.java
blob1cd47c7b93c0c9f729d5d317dfd9bca8d74e32f7
1 // Copyright 2011 Google Inc. All Rights Reserved.
3 package com.google.appengine.tools.development;
5 import com.google.apphosting.api.ApiProxy.Environment;
7 /**
8 * A {@code RequestEndListener} is a hook that allows
9 * local API services to be notified when a request
10 * to the Dev App Server has completed.
11 * <p>
12 * A <i>local API service</i> is a class that implements
13 * {@link com.google.appengine.tools.development.LocalRpcService}.
14 * As described in that interface, a <i>service call</i> is
15 * a method implemented by a local API service
16 * that takes a request protocol buffer and returns a
17 * response protocol buffer. During a service call
18 * a local API service may register a {@code RequestEndListener} for the current request using
19 * {@link RequestEndListenerHelper}.
22 public interface RequestEndListener {
23 /**
24 * This method is invoked on all registered {@code RequestEndListeners}
25 * when the current request to the Dev App Server has completed.
26 * @param environment Environment associated with the request. Among
27 * other data contained in this environment is a unique request ID.
28 * This may be obtained using the following code:
29 * <blockquote>
30 * <pre>
31 * String requestID =
32 * (String) environment.getAttributes().get(LocalEnvironment.REQUEST_ID);
33 * </pre>
34 * </blockquote>
36 void onRequestEnd(Environment environment);