|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object play.plugins.PluginCollection
public class 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.
Field Summary | |
---|---|
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.lang.Object |
lock
|
protected java.lang.String |
play_plugins_resourceName
Property holding the name of the play.plugins-resource-name. |
Constructor Summary | |
---|---|
PluginCollection()
|
Method Summary | |
---|---|
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()
|
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.lang.String |
getMessage(java.lang.String locale,
java.lang.Object key,
java.lang.Object... args)
|
PlayPlugin |
getPluginInstance(java.lang.Class<? extends PlayPlugin> 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 |
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)
|
protected boolean |
isLoadedByApplicationClassloader(PlayPlugin plugin)
|
void |
loadPlugins()
Enable found plugins |
Template |
loadTemplate(VirtualFile file)
|
Model.Factory |
modelFactory(java.lang.Class<? extends Model> modelClass)
|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String play_plugins_resourceName
protected java.lang.Object lock
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
Constructor Detail |
---|
public PluginCollection()
Method Detail |
---|
protected java.util.List<PlayPlugin> createReadonlyCopy(java.util.List<PlayPlugin> list)
list
-
public void loadPlugins()
public void reloadApplicationPlugins() throws java.lang.Exception
java.lang.Exception
protected boolean isLoadedByApplicationClassloader(PlayPlugin plugin)
protected void initializePlugin(PlayPlugin plugin)
plugin
- protected boolean addPlugin(PlayPlugin plugin)
plugin
-
protected void replacePlugin(PlayPlugin oldPlugin, PlayPlugin newPlugin)
public boolean enablePlugin(PlayPlugin plugin)
plugin
-
public boolean enablePlugin(java.lang.Class<? extends PlayPlugin> pluginClazz)
public PlayPlugin getPluginInstance(java.lang.Class<? extends PlayPlugin> pluginClazz)
pluginClazz
-
public boolean disablePlugin(PlayPlugin plugin)
plugin
-
public boolean disablePlugin(java.lang.Class<? extends PlayPlugin> pluginClazz)
public void updatePlayPluginsList()
public java.util.List<PlayPlugin> getEnabledPlugins()
public java.util.Collection<PlayPlugin> getReversedEnabledPlugins()
public java.util.List<PlayPlugin> getAllPlugins()
public boolean isEnabled(PlayPlugin plugin)
plugin
-
public 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 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |