play
类 PlayPlugin

java.lang.Object
  继承者 play.PlayPlugin
所有已实现的接口:
java.lang.Comparable<PlayPlugin>
直接已知子类:
ConfigurablePluginDisablingPlugin, CorePlugin, DBPlugin, Evolutions, JobsPlugin, JPAPlugin, MessagesPlugin, TempFilePlugin, ValidationPlugin, WS

public abstract class PlayPlugin
extends java.lang.Object
implements java.lang.Comparable<PlayPlugin>

A framework plugin


字段摘要
 int index
          Plugin priority (0 for highest priority)
 
构造方法摘要
PlayPlugin()
           
 
方法摘要
 java.util.Map<java.lang.String,java.lang.String> addMimeTypes()
          Override to provide additional mime types from your plugin.
 java.util.List<java.lang.String> addTemplateExtensions()
           
 void afterActionInvocation()
          Called at the end of the action invocation.
 void afterApplicationStart()
          Called after the application start.
 void afterFixtureLoad()
           
 void afterInvocation()
          Called after an invocation.
 void beforeActionInvocation(java.lang.reflect.Method actionMethod)
          Called before an 'action' invocation, ie an HTTP request processing.
 void beforeDetectingChanges()
           
 void beforeInvocation()
          Called before a Play!
 java.lang.Object bind(RootParamNode rootParamNode, java.lang.String name, java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations)
          Called when play need to bind a Java object from HTTP params.
 java.lang.Object bind(java.lang.String name, java.lang.Class clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, java.util.Map<java.lang.String,java.lang.String[]> params)
          已过时。 
 java.lang.Object bind(java.lang.String name, java.lang.Object o, java.util.Map<java.lang.String,java.lang.String[]> params)
          已过时。 
 java.lang.Object bindBean(RootParamNode rootParamNode, java.lang.String name, java.lang.Object bean)
          Called when play need to bind an existing Java object from HTTP params.
 int compareTo(PlayPlugin o)
           
 void compileAll(java.util.List<ApplicationClasses.ApplicationClass> classes)
          已过时。 
 boolean compileSources()
           
 void detectChange()
          It's time for the plugin to detect changes.
 boolean detectClassesChange()
          It's time for the plugin to detect changes.
 void enhance(ApplicationClasses.ApplicationClass applicationClass)
          Enhance this class
 JsonObject getJsonStatus()
          Return the plugin status in JSON format
 java.lang.String getMessage(java.lang.String locale, java.lang.Object key, java.lang.Object... args)
          Translate the given key for the given locale and arguments.
 java.lang.String getStatus()
          Return the plugin status
 void invocationFinally()
          Called at the end of the invocation.
 Template loadTemplate(VirtualFile file)
           
 Model.Factory modelFactory(java.lang.Class<? extends Model> modelClass)
           
 void onActionInvocationResult(Result result)
          Called when the action method has thrown a result.
 void onApplicationReady()
           
 void onApplicationStart()
          Called at application start (and at each reloading) Time to start stateful things.
 void onApplicationStop()
          Called at application stop (and before each reloading) Time to shutdown stateful things.
 java.util.List<ApplicationClasses.ApplicationClass> onClassesChange(java.util.List<ApplicationClasses.ApplicationClass> modified)
           
 void onConfigurationRead()
          Called when the application.conf has been read.
 void onEvent(java.lang.String message, java.lang.Object context)
          Event may be sent by plugins or other components
 void onInvocationException(java.lang.Throwable e)
          Called if an exception occured during the invocation.
 void onInvocationSuccess()
           
 void onLoad()
          Called at plugin loading
 void onRequestRouting(Router.Route route)
          Called when the request has been routed.
 void onRoutesLoaded()
          Called after routes loading.
 void onTemplateCompilation(Template template)
          已过时。 
 java.lang.String overrideTemplateSource(BaseTemplate template, java.lang.String source)
           
static void postEvent(java.lang.String message, java.lang.Object context)
          Inter-plugin communication.
 boolean rawInvocation(Http.Request request, Http.Response response)
          Give a chance to this plugin to fully manage this request
 void routeRequest(Http.Request request)
          Let some plugins route themself
 TestEngine.TestResults runTest(java.lang.Class<BaseTest> clazz)
          Run a test class
 boolean serveStatic(VirtualFile file, Http.Request request, Http.Response response)
          Let a chance to this plugin to manage a static resource
 java.util.Map<java.lang.String,java.lang.Object> unBind(java.lang.Object src, java.lang.String name)
           
 java.lang.Object willBeValidated(java.lang.Object value)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

index

public int index
Plugin priority (0 for highest priority)

构造方法详细信息

PlayPlugin

public PlayPlugin()
方法详细信息

onLoad

public void onLoad()
Called at plugin loading


compileSources

public boolean compileSources()

runTest

public TestEngine.TestResults runTest(java.lang.Class<BaseTest> clazz)
Run a test class


bind

@Deprecated
public java.lang.Object bind(java.lang.String name,
                                        java.lang.Class clazz,
                                        java.lang.reflect.Type type,
                                        java.lang.annotation.Annotation[] annotations,
                                        java.util.Map<java.lang.String,java.lang.String[]> params)
已过时。 

Use method using RootParamNode instead

返回:

bind

public java.lang.Object bind(RootParamNode rootParamNode,
                             java.lang.String name,
                             java.lang.Class<?> clazz,
                             java.lang.reflect.Type type,
                             java.lang.annotation.Annotation[] annotations)
Called when play need to bind a Java object from HTTP params. When overriding this method, do not call super impl.. super impl is calling old bind method to be backward compatible.


bind

@Deprecated
public java.lang.Object bind(java.lang.String name,
                                        java.lang.Object o,
                                        java.util.Map<java.lang.String,java.lang.String[]> params)
已过时。 

Use bindBean instead


bindBean

public java.lang.Object bindBean(RootParamNode rootParamNode,
                                 java.lang.String name,
                                 java.lang.Object bean)
Called when play need to bind an existing Java object from HTTP params. When overriding this method, DO NOT call the super method, since its default impl is to call the old bind method to be backward compatible.


unBind

public java.util.Map<java.lang.String,java.lang.Object> unBind(java.lang.Object src,
                                                               java.lang.String name)

getMessage

public java.lang.String getMessage(java.lang.String locale,
                                   java.lang.Object key,
                                   java.lang.Object... args)
Translate the given key for the given locale and arguments. If null is returned, Play's normal message translation mechanism will be used.


getStatus

public java.lang.String getStatus()
Return the plugin status


getJsonStatus

public JsonObject getJsonStatus()
Return the plugin status in JSON format


enhance

public void enhance(ApplicationClasses.ApplicationClass applicationClass)
             throws java.lang.Exception
Enhance this class

参数:
applicationClass -
抛出:
java.lang.Exception

onTemplateCompilation

@Deprecated
public void onTemplateCompilation(Template template)
已过时。 

This hook is not plugged, don't implement it

参数:
template -

rawInvocation

public boolean rawInvocation(Http.Request request,
                             Http.Response response)
                      throws java.lang.Exception
Give a chance to this plugin to fully manage this request

参数:
request - The Play request
response - The Play response
返回:
true if this plugin has managed this request
抛出:
java.lang.Exception

serveStatic

public boolean serveStatic(VirtualFile file,
                           Http.Request request,
                           Http.Response response)
Let a chance to this plugin to manage a static resource

参数:
request - The Play request
response - The Play response
返回:
true if this plugin has managed this request

beforeDetectingChanges

public void beforeDetectingChanges()

loadTemplate

public Template loadTemplate(VirtualFile file)

detectChange

public void detectChange()
It's time for the plugin to detect changes. Throw an exception is the application must be reloaded.


detectClassesChange

public boolean detectClassesChange()
It's time for the plugin to detect changes. Throw an exception is the application must be reloaded.


onApplicationStart

public void onApplicationStart()
Called at application start (and at each reloading) Time to start stateful things.


afterApplicationStart

public void afterApplicationStart()
Called after the application start.


onApplicationStop

public void onApplicationStop()
Called at application stop (and before each reloading) Time to shutdown stateful things.


beforeInvocation

public void beforeInvocation()
Called before a Play! invocation. Time to prepare request specific things.


afterInvocation

public void afterInvocation()
Called after an invocation. (unless an excetion has been thrown). Time to close request specific things.


onInvocationException

public void onInvocationException(java.lang.Throwable e)
Called if an exception occured during the invocation.

参数:
e - The catched exception.

invocationFinally

public void invocationFinally()
Called at the end of the invocation. (even if an exception occured). Time to close request specific things.


beforeActionInvocation

public void beforeActionInvocation(java.lang.reflect.Method actionMethod)
Called before an 'action' invocation, ie an HTTP request processing.


onActionInvocationResult

public void onActionInvocationResult(Result result)
Called when the action method has thrown a result.

参数:
result - The result object for the request.

onInvocationSuccess

public void onInvocationSuccess()

onRequestRouting

public void onRequestRouting(Router.Route route)
Called when the request has been routed.

参数:
route - The route selected.

afterActionInvocation

public void afterActionInvocation()
Called at the end of the action invocation.


onConfigurationRead

public void onConfigurationRead()
Called when the application.conf has been read.


onRoutesLoaded

public void onRoutesLoaded()
Called after routes loading.


onEvent

public void onEvent(java.lang.String message,
                    java.lang.Object context)
Event may be sent by plugins or other components

参数:
message - convention: pluginClassShortName.message
context - depends on the plugin

onClassesChange

public java.util.List<ApplicationClasses.ApplicationClass> onClassesChange(java.util.List<ApplicationClasses.ApplicationClass> modified)

addTemplateExtensions

public java.util.List<java.lang.String> addTemplateExtensions()

addMimeTypes

public java.util.Map<java.lang.String,java.lang.String> addMimeTypes()
Override to provide additional mime types from your plugin. These mimetypes get priority over the default framework mimetypes but not over the application's configuration.

返回:
a Map from extensions (without dot) to mimetypes

compileAll

@Deprecated
public void compileAll(java.util.List<ApplicationClasses.ApplicationClass> classes)
已过时。 

Let a chance to the plugin to compile it owns classes. Must be added to the mutable list.


routeRequest

public void routeRequest(Http.Request request)
Let some plugins route themself

参数:
request -

modelFactory

public Model.Factory modelFactory(java.lang.Class<? extends Model> modelClass)

afterFixtureLoad

public void afterFixtureLoad()

postEvent

public static void postEvent(java.lang.String message,
                             java.lang.Object context)
Inter-plugin communication.


onApplicationReady

public void onApplicationReady()

compareTo

public int compareTo(PlayPlugin o)
指定者:
接口 java.lang.Comparable<PlayPlugin> 中的 compareTo

overrideTemplateSource

public java.lang.String overrideTemplateSource(BaseTemplate template,
                                               java.lang.String source)

willBeValidated

public java.lang.Object willBeValidated(java.lang.Object value)


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly