public class PluginCollection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<PlayPlugin> |
allPlugins
List that holds all loaded plugins, enabled or disabled
|
protected java.util.List<PlayPlugin> |
allPlugins_readOnlyCopy
Readonly copy of allPlugins - updated each time allPlugins is updated.
|
protected java.util.List<PlayPlugin> |
enabledPlugins
List of all enabled plugins
|
protected java.util.List<PlayPlugin> |
enabledPlugins_readOnlyCopy
Readonly copy of enabledPlugins - updated each time enabledPlugins is updated.
|
protected java.util.List<PlayPlugin> |
enabledPluginsWithFilters
List of all enabled plugins with filters
|
protected java.util.List<PlayPlugin> |
enabledPluginsWithFilters_readOnlyCopy
Readonly copy of enabledPluginsWithFilters - updated each time enabledPluginsWithFilters is updated.
|
protected java.lang.String |
play_plugins_resourceName
Property holding the name of the play.plugins-resource-name.
|
Constructor and Description |
---|
PluginCollection() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addPlugin(PlayPlugin plugin)
Adds one plugin and enables it
|
java.util.List<java.lang.String> |
addTemplateExtensions() |
void |
afterActionInvocation() |
void |
afterApplicationStart() |
void |
afterFixtureLoad() |
void |
afterInvocation() |
void |
beforeActionInvocation(java.lang.reflect.Method actionMethod) |
void |
beforeDetectingChanges() |
void |
beforeInvocation() |
java.lang.Object |
bind(RootParamNode rootParamNode,
java.lang.String name,
java.lang.Class<?> clazz,
java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations) |
java.lang.Object |
bindBean(RootParamNode rootParamNode,
java.lang.String name,
java.lang.Object bean) |
void |
compileAll(java.util.List<ApplicationClasses.ApplicationClass> classes)
Deprecated.
|
boolean |
compileSources() |
<T> F.Option<PlayPlugin.Filter<T>> |
composeFilters() |
protected java.util.List<PlayPlugin> |
createReadonlyCopy(java.util.List<PlayPlugin> list)
Using readonly list to crash if someone tries to modify the copy.
|
void |
detectChange() |
boolean |
detectClassesChange() |
boolean |
disablePlugin(java.lang.Class<? extends PlayPlugin> pluginClazz)
Disable plugin of specified type
|
boolean |
disablePlugin(PlayPlugin plugin)
disable plugin
|
boolean |
enablePlugin(java.lang.Class<? extends PlayPlugin> pluginClazz)
enable plugin of specified type
|
boolean |
enablePlugin(PlayPlugin plugin)
Enable plugin.
|
void |
enhance(ApplicationClasses.ApplicationClass applicationClass) |
java.util.List<PlayPlugin> |
getAllPlugins()
Returns new readonly list of all plugins
|
java.util.List<PlayPlugin> |
getEnabledPlugins()
Returns new readonly list of all enabled plugins
|
java.util.List<PlayPlugin> |
getEnabledPluginsWithFilters()
Returns new readonly list of all enabled plugins that define filters.
|
java.util.Collection<java.lang.Class> |
getFunctionalTests() |
java.lang.String |
getMessage(java.lang.String locale,
java.lang.Object key,
java.lang.Object... args) |
<T extends PlayPlugin> |
getPluginInstance(java.lang.Class<T> pluginClazz)
Returns the first instance of a loaded plugin of specified type
|
java.util.Collection<PlayPlugin> |
getReversedEnabledPlugins()
Returns readonly view of all enabled plugins in reversed order
|
java.util.Collection<java.lang.Class> |
getUnitTests() |
protected void |
initializePlugin(PlayPlugin plugin)
Calls plugin.onLoad but detects if plugin removes other plugins from Play.plugins-list to detect if plugins
disables a plugin the old hacked way..
|
void |
invocationFinally() |
boolean |
isEnabled(PlayPlugin plugin)
Indicate if a plugin is enabled
|
protected boolean |
isLoadedByApplicationClassloader(PlayPlugin plugin) |
void |
loadPlugins() |
Template |
loadTemplate(VirtualFile file) |
Model.Factory |
modelFactory(java.lang.Class<? extends Model> modelClass) |
void |
onActionInvocationFinally() |
void |
onActionInvocationResult(Result result) |
void |
onApplicationReady() |
void |
onApplicationStart() |
void |
onApplicationStop() |
java.util.List<ApplicationClasses.ApplicationClass> |
onClassesChange(java.util.List<ApplicationClasses.ApplicationClass> modified)
Deprecated.
|
void |
onConfigurationRead() |
void |
onEvent(java.lang.String message,
java.lang.Object context) |
void |
onInvocationException(java.lang.Throwable e) |
void |
onInvocationSuccess() |
void |
onRequestRouting(Router.Route route) |
void |
onRoutesLoaded() |
java.lang.String |
overrideTemplateSource(BaseTemplate template,
java.lang.String source) |
boolean |
rawInvocation(Http.Request request,
Http.Response response) |
void |
reloadApplicationPlugins()
Reloads all loaded plugins that is application-supplied.
|
protected void |
replacePlugin(PlayPlugin oldPlugin,
PlayPlugin newPlugin) |
void |
routeRequest(Http.Request request) |
TestEngine.TestResults |
runTest(java.lang.Class<BaseTest> clazz) |
boolean |
serveStatic(VirtualFile file,
Http.Request request,
Http.Response response) |
java.util.Map<java.lang.String,java.lang.Object> |
unBind(java.lang.Object src,
java.lang.String name) |
void |
updatePlayPluginsList()
Must update Play.plugins-list to be backward compatible
|
java.lang.Object |
willBeValidated(java.lang.Object value) |
protected java.lang.String play_plugins_resourceName
protected java.util.List<PlayPlugin> allPlugins
protected java.util.List<PlayPlugin> allPlugins_readOnlyCopy
protected java.util.List<PlayPlugin> enabledPlugins
protected java.util.List<PlayPlugin> enabledPlugins_readOnlyCopy
protected java.util.List<PlayPlugin> enabledPluginsWithFilters
protected java.util.List<PlayPlugin> enabledPluginsWithFilters_readOnlyCopy
protected java.util.List<PlayPlugin> createReadonlyCopy(java.util.List<PlayPlugin> list)
list
- The list of pluginspublic void loadPlugins()
public void reloadApplicationPlugins() throws java.lang.Exception
java.lang.Exception
- If problem occurred during reloadprotected boolean isLoadedByApplicationClassloader(PlayPlugin plugin)
protected void initializePlugin(PlayPlugin plugin)
plugin
- The given pluginprotected boolean addPlugin(PlayPlugin plugin)
plugin
- The given pluginprotected void replacePlugin(PlayPlugin oldPlugin, PlayPlugin newPlugin)
public boolean enablePlugin(PlayPlugin plugin)
plugin
- The given pluginpublic boolean enablePlugin(java.lang.Class<? extends PlayPlugin> pluginClazz)
pluginClazz
- The plugin classpublic <T extends PlayPlugin> T getPluginInstance(java.lang.Class<T> pluginClazz)
pluginClazz
- The plugin classpublic boolean disablePlugin(PlayPlugin plugin)
plugin
- The given pluginpublic boolean disablePlugin(java.lang.Class<? extends PlayPlugin> pluginClazz)
pluginClazz
- The plugin classpublic void updatePlayPluginsList()
public java.util.List<PlayPlugin> getEnabledPlugins()
public java.util.List<PlayPlugin> getEnabledPluginsWithFilters()
public <T> F.Option<PlayPlugin.Filter<T>> composeFilters()
public java.util.Collection<PlayPlugin> getReversedEnabledPlugins()
public java.util.List<PlayPlugin> getAllPlugins()
public boolean isEnabled(PlayPlugin plugin)
plugin
- The given pluginpublic boolean compileSources()
public boolean detectClassesChange()
public void invocationFinally()
public void beforeInvocation()
public void afterInvocation()
public void onInvocationSuccess()
public void onInvocationException(java.lang.Throwable e)
public void beforeDetectingChanges()
public void detectChange()
public void onApplicationReady()
public void onConfigurationRead()
public void onApplicationStart()
public void afterApplicationStart()
public void onApplicationStop()
public void onEvent(java.lang.String message, java.lang.Object context)
public void enhance(ApplicationClasses.ApplicationClass applicationClass)
@Deprecated public java.util.List<ApplicationClasses.ApplicationClass> onClassesChange(java.util.List<ApplicationClasses.ApplicationClass> modified)
@Deprecated public void compileAll(java.util.List<ApplicationClasses.ApplicationClass> classes)
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)
public java.lang.Object bindBean(RootParamNode rootParamNode, java.lang.String name, java.lang.Object bean)
public java.util.Map<java.lang.String,java.lang.Object> unBind(java.lang.Object src, java.lang.String name)
public java.lang.Object willBeValidated(java.lang.Object value)
public Model.Factory modelFactory(java.lang.Class<? extends Model> modelClass)
public java.lang.String getMessage(java.lang.String locale, java.lang.Object key, java.lang.Object... args)
public void beforeActionInvocation(java.lang.reflect.Method actionMethod)
public void onActionInvocationResult(Result result)
public void afterActionInvocation()
public void onActionInvocationFinally()
public void routeRequest(Http.Request request)
public void onRequestRouting(Router.Route route)
public void onRoutesLoaded()
public boolean rawInvocation(Http.Request request, Http.Response response) throws java.lang.Exception
java.lang.Exception
public boolean serveStatic(VirtualFile file, Http.Request request, Http.Response response)
public java.util.List<java.lang.String> addTemplateExtensions()
public java.lang.String overrideTemplateSource(BaseTemplate template, java.lang.String source)
public Template loadTemplate(VirtualFile file)
public void afterFixtureLoad()
public TestEngine.TestResults runTest(java.lang.Class<BaseTest> clazz)
public java.util.Collection<java.lang.Class> getUnitTests()
public java.util.Collection<java.lang.Class> getFunctionalTests()
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly