Package play.plugins
Class PlayStatusPlugin
- java.lang.Object
-
- play.PlayPlugin
-
- play.plugins.PlayStatusPlugin
-
- All Implemented Interfaces:
java.lang.Comparable<PlayPlugin>
public class PlayStatusPlugin extends PlayPlugin
-
-
Field Summary
-
Fields inherited from class play.PlayPlugin
index
-
-
Constructor Summary
Constructors Constructor Description PlayStatusPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcomputeApplicationStatus(boolean json)Get the application statuscom.google.gson.JsonObjectgetJsonStatus()Return the plugin status in JSON formatjava.lang.StringgetStatus()Retrieve status about play core.booleanrawInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash)Intercept /@status and check that the Authorization header is valid.-
Methods inherited from class play.PlayPlugin
afterActionInvocation, afterApplicationStart, afterInvocation, beforeActionInvocation, beforeInvocation, bind, compareTo, detectChange, disable, getMessage, isEnabled, loadTemplate, onActionInvocationException, onActionInvocationFinally, onActionInvocationResult, onActionInvocationResult, onApplicationStart, onApplicationStop, onConfigurationRead, onInvocationSuccess, onJobInvocationException, onJobInvocationFinally, onLoad, routeRequest
-
-
-
-
Method Detail
-
computeApplicationStatus
public java.lang.String computeApplicationStatus(boolean json)
Get the application status- Parameters:
json- true if the status should be return in JSON- Returns:
- application status
-
rawInvocation
public boolean rawInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash) throws java.lang.Exception
Intercept /@status and check that the Authorization header is valid. Then ask each plugin for a status dump and send it over the HTTP response. You can ask the /@status using the authorization header and putting your status secret key in it. Prior to that you would be required to start play with a -DstatusKey=yourkey- Overrides:
rawInvocationin classPlayPlugin- Parameters:
request- The Play requestresponse- The Play response- Returns:
- true if this plugin has managed this request
- Throws:
java.lang.Exception
-
getStatus
public java.lang.String getStatus()
Retrieve status about play core.- Overrides:
getStatusin classPlayPlugin- Returns:
- the plugin status
-
getJsonStatus
public com.google.gson.JsonObject getJsonStatus()
Description copied from class:PlayPluginReturn the plugin status in JSON format- Overrides:
getJsonStatusin classPlayPlugin- Returns:
- the plugin status in JSON format
-
-