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 void
addPlugin
(PlayPlugin plugin) Adds one plugin and enables itvoid
afterActionInvocation
(Http.Request request, Http.Response response, Scope.Session session, Scope.Flash flash) void
void
void
beforeActionInvocation
(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash, Method actionMethod) void
bind
(Http.Request request, Scope.Session session, RootParamNode rootParamNode, String name, Class<?> clazz, Type type, Annotation[] annotations) void
Returns new readonly list of all pluginsgetMessage
(String locale, Object key, Object... args) <T extends PlayPlugin>
TgetPluginInstance
(Class<T> pluginClazz) Returns the first instance of a loaded plugin of specified typevoid
Load plugins from .plugin files, if anyvoid
loadPlugins
(SortedSet<PluginDescriptor> pluginsToLoad) loadTemplate
(File file) void
onActionInvocationException
(Http.Request request, Http.Response response, Throwable e) void
onActionInvocationFinally
(Http.Request request, Http.Response response) void
onActionInvocationResult
(Http.Request request, Http.Response response, Scope.Session session, Scope.Flash flash, Scope.RenderArgs renderArgs, Result result) void
void
void
void
void
void
boolean
rawInvocation
(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash) void
routeRequest
(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
public void onActionInvocationException(@Nonnull Http.Request request, @Nonnull Http.Response response, @Nonnull Throwable e) -
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
public void onActionInvocationFinally(@Nonnull Http.Request request, @Nonnull Http.Response response) -
routeRequest
-
rawInvocation
public boolean rawInvocation(Http.Request request, Http.Response response, Scope.Session session, Scope.RenderArgs renderArgs, Scope.Flash flash) -
loadTemplate
-