Package play.plugins
Class PluginCollection
java.lang.Object
play.plugins.PluginCollection
Class handling all plugins used by Play.
Loading/reloading/enabling/disabling is handled here.
This class also exposes many PlayPlugin-methods which when called, the method is executed on all enabled plugins.
Since all the enabled-plugins-iteration is done here, the code elsewhere is cleaner.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddPlugin(PlayPlugin plugin) Adds one plugin and enables itvoidafterActionInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.Flash flash) voidvoidvoidbeforeActionInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash, Method actionMethod) voidbind(Http.Request request, Scope.Session session, RootParamNode rootParamNode, String name, Class<?> clazz, Type type, Annotation[] annotations) voidReturns new readonly list of all pluginsgetMessage(String locale, Object key, Object... args) <T extends PlayPlugin>
@Nullable TgetPluginInstance(Class<T> pluginClazz) Returns the first instance of a loaded plugin of specified typevoidLoad plugins from .plugin files, if anyvoidloadPlugins(SortedSet<PluginDescriptor> pluginsToLoad) loadTemplate(File file) voidonActionInvocationException(Http.Request request, Http.Response response, Throwable e) voidonActionInvocationFinally(Http.Request request, Http.Response response) voidonActionInvocationResult(Http.Request request, Http.Response response, Scope.Session session, Scope.Flash flash, Scope.RenderArgs renderArgs, Result result) voidvoidvoidvoidvoidvoidbooleanrawInvocation(Http.Request request, Http.Response response, @Nullable Scope.Session session, Scope.RenderArgs renderArgs, @Nullable Scope.Flash flash) voidrouteRequest(Http.Request request)
-
Constructor Details
-
PluginCollection
public PluginCollection() -
PluginCollection
-
-
Method Details
-
loadPlugins
public void loadPlugins()Load plugins from .plugin files, if any -
loadPlugins
-
addPlugin
Adds one plugin and enables it- Parameters:
plugin- The given plugin
-
getPluginInstance
Returns the first instance of a loaded plugin of specified type- Parameters:
pluginClazz- The plugin class- Returns:
- PlayPlugin
-
getEnabledPlugins
-
getAllPlugins
Returns new readonly list of all plugins- Returns:
- List of plugins
-
onJobInvocationFinally
public void onJobInvocationFinally() -
beforeInvocation
public void beforeInvocation() -
afterInvocation
public void afterInvocation() -
onInvocationSuccess
public void onInvocationSuccess() -
onActionInvocationException
-
onJobInvocationException
-
detectChange
public void detectChange() -
onConfigurationRead
public void onConfigurationRead() -
onApplicationStart
public void onApplicationStart() -
afterApplicationStart
public void afterApplicationStart() -
onApplicationStop
public void onApplicationStop() -
bind
public Optional<Object> bind(Http.Request request, Scope.Session session, RootParamNode rootParamNode, String name, Class<?> clazz, Type type, Annotation[] annotations) -
getMessage
-
beforeActionInvocation
public void beforeActionInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash, Method actionMethod) -
onActionInvocationResult
public void onActionInvocationResult(Http.Request request, Http.Response response, Scope.Session session, Scope.Flash flash, Scope.RenderArgs renderArgs, Result result) -
afterActionInvocation
public void afterActionInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.Flash flash) -
onActionInvocationFinally
-
routeRequest
-
rawInvocation
public boolean rawInvocation(Http.Request request, Http.Response response, @Nullable Scope.Session session, Scope.RenderArgs renderArgs, @Nullable Scope.Flash flash) -
loadTemplate
-