Package play.plugins
Class PluginCollection
- java.lang.Object
-
- play.plugins.PluginCollection
-
public class PluginCollection extends java.lang.ObjectClass 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 Constructor Description PluginCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddPlugin(PlayPlugin plugin)Adds one plugin and enables itvoidafterActionInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.Flash flash)voidafterApplicationStart()voidafterInvocation()voidbeforeActionInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash, java.lang.reflect.Method actionMethod)voidbeforeInvocation()java.util.Optional<java.lang.Object>bind(Http.Request request, Scope.Session session, RootParamNode rootParamNode, java.lang.String name, java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations)voiddetectChange()java.util.stream.Stream<PlayPlugin>getAllPlugins()Returns new readonly list of all pluginsjava.util.stream.Stream<PlayPlugin>getEnabledPlugins()java.util.Optional<java.lang.String>getMessage(java.lang.String locale, java.lang.Object key, java.lang.Object... args)<T extends PlayPlugin>
TgetPluginInstance(java.lang.Class<T> pluginClazz)Returns the first instance of a loaded plugin of specified typevoidloadPlugins()java.util.Optional<Template>loadTemplate(VirtualFile file)voidonActionInvocationException(Http.Request request, Http.Response response, java.lang.Throwable e)voidonActionInvocationFinally(Http.Request request)voidonActionInvocationResult(Http.Request request, Http.Response response, Scope.Session session, Scope.Flash flash, Scope.RenderArgs renderArgs, Result result)voidonApplicationStart()voidonApplicationStop()voidonConfigurationRead()voidonInvocationSuccess()voidonJobInvocationException(java.lang.Throwable e)voidonJobInvocationFinally()booleanrawInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash)voidrouteRequest(Http.Request request)
-
-
-
Method Detail
-
loadPlugins
public void loadPlugins()
-
addPlugin
protected void addPlugin(PlayPlugin plugin)
Adds one plugin and enables it- Parameters:
plugin- The given plugin
-
getPluginInstance
@Nullable public <T extends PlayPlugin> T getPluginInstance(java.lang.Class<T> pluginClazz)
Returns the first instance of a loaded plugin of specified type- Parameters:
pluginClazz- The plugin class- Returns:
- PlayPlugin
-
getEnabledPlugins
public java.util.stream.Stream<PlayPlugin> getEnabledPlugins()
-
getAllPlugins
public java.util.stream.Stream<PlayPlugin> 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
public void onActionInvocationException(@Nonnull Http.Request request, @Nonnull Http.Response response, @Nonnull java.lang.Throwable e)
-
onJobInvocationException
public void onJobInvocationException(@Nonnull java.lang.Throwable e)
-
detectChange
public void detectChange()
-
onConfigurationRead
public void onConfigurationRead()
-
onApplicationStart
public void onApplicationStart()
-
afterApplicationStart
public void afterApplicationStart()
-
onApplicationStop
public void onApplicationStop()
-
bind
public java.util.Optional<java.lang.Object> bind(Http.Request request, Scope.Session session, RootParamNode rootParamNode, java.lang.String name, java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations)
-
getMessage
public java.util.Optional<java.lang.String> getMessage(java.lang.String locale, java.lang.Object key, java.lang.Object... args)
-
beforeActionInvocation
public void beforeActionInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash, java.lang.reflect.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
public void onActionInvocationFinally(@Nonnull Http.Request request)
-
routeRequest
public void routeRequest(Http.Request request)
-
rawInvocation
public boolean rawInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash)
-
loadTemplate
public java.util.Optional<Template> loadTemplate(VirtualFile file)
-
-