public class PluginCollection extends Object
Modifier and Type | Field and Description |
---|---|
protected List<PlayPlugin> |
allPlugins
List that holds all loaded plugins, enabled or disabled
|
protected List<PlayPlugin> |
allPlugins_readOnlyCopy
Readonly copy of allPlugins - updated each time allPlugins is updated.
|
protected List<PlayPlugin> |
enabledPlugins
List of all enabled plugins
|
protected List<PlayPlugin> |
enabledPlugins_readOnlyCopy
Readonly copy of enabledPlugins - updated each time enabledPlugins is
updated.
|
protected List<PlayPlugin> |
enabledPluginsWithFilters
List of all enabled plugins with filters
|
protected List<PlayPlugin> |
enabledPluginsWithFilters_readOnlyCopy
Readonly copy of enabledPluginsWithFilters - updated each time
enabledPluginsWithFilters is updated.
|
protected 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
|
List<String> |
addTemplateExtensions() |
void |
afterActionInvocation() |
void |
afterApplicationStart() |
void |
afterFixtureLoad() |
void |
afterInvocation() |
void |
beforeActionInvocation(Method actionMethod) |
void |
beforeDetectingChanges() |
void |
beforeInvocation() |
Object |
bind(RootParamNode rootParamNode,
String name,
Class<?> clazz,
Type type,
Annotation[] annotations) |
Object |
bindBean(RootParamNode rootParamNode,
String name,
Object bean) |
void |
compileAll(List<ApplicationClasses.ApplicationClass> classes)
Deprecated.
|
boolean |
compileSources() |
<T> F.Option<PlayPlugin.Filter<T>> |
composeFilters() |
protected List<PlayPlugin> |
createReadonlyCopy(List<PlayPlugin> list)
Using readonly list to crash if someone tries to modify the copy.
|
void |
detectChange() |
boolean |
detectClassesChange() |
boolean |
disablePlugin(Class<? extends PlayPlugin> pluginClazz)
disable plugin of specified type
|
boolean |
disablePlugin(PlayPlugin plugin)
disable plugin
|
boolean |
enablePlugin(Class<? extends PlayPlugin> pluginClazz)
enable plugin of specified type
|
boolean |
enablePlugin(PlayPlugin plugin)
Enable plugin.
|
void |
enhance(ApplicationClasses.ApplicationClass applicationClass) |
List<PlayPlugin> |
getAllPlugins()
Returns new readonly list of all plugins
|
List<PlayPlugin> |
getEnabledPlugins()
Returns new readonly list of all enabled plugins
|
List<PlayPlugin> |
getEnabledPluginsWithFilters()
Returns new readonly list of all enabled plugins that define filters.
|
Collection<Class> |
getFunctionalTests() |
String |
getMessage(String locale,
Object key,
Object... args) |
PlayPlugin |
getPluginInstance(Class<? extends PlayPlugin> pluginClazz)
Returns the first instance of a loaded plugin of specified type
|
Collection<PlayPlugin> |
getReversedEnabledPlugins()
Returns readonly view of all enabled plugins in reversed order
|
Collection<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) |
protected boolean |
isLoadedByApplicationClassloader(PlayPlugin plugin) |
void |
loadPlugins()
Enable found plugins
|
Template |
loadTemplate(VirtualFile file) |
Model.Factory |
modelFactory(Class<? extends Model> modelClass) |
void |
onActionInvocationFinally() |
void |
onActionInvocationResult(Result result) |
void |
onApplicationReady() |
void |
onApplicationStart() |
void |
onApplicationStop() |
List<ApplicationClasses.ApplicationClass> |
onClassesChange(List<ApplicationClasses.ApplicationClass> modified)
Deprecated.
|
void |
onConfigurationRead() |
void |
onEvent(String message,
Object context) |
void |
onInvocationException(Throwable e) |
void |
onInvocationSuccess() |
void |
onRequestRouting(Router.Route route) |
void |
onRoutesLoaded() |
String |
overrideTemplateSource(BaseTemplate template,
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(Class<BaseTest> clazz) |
boolean |
serveStatic(VirtualFile file,
Http.Request request,
Http.Response response) |
Map<String,Object> |
unBind(Object src,
String name) |
void |
updatePlayPluginsList()
Must update Play.plugins-list to be backward compatible
|
Object |
willBeValidated(Object value) |
protected String play_plugins_resourceName
protected List<PlayPlugin> allPlugins
protected List<PlayPlugin> allPlugins_readOnlyCopy
protected List<PlayPlugin> enabledPlugins
protected List<PlayPlugin> enabledPlugins_readOnlyCopy
protected List<PlayPlugin> enabledPluginsWithFilters
protected List<PlayPlugin> enabledPluginsWithFilters_readOnlyCopy
protected List<PlayPlugin> createReadonlyCopy(List<PlayPlugin> list)
list
- public void loadPlugins()
public void reloadApplicationPlugins() throws Exception
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(Class<? extends PlayPlugin> pluginClazz)
public PlayPlugin getPluginInstance(Class<? extends PlayPlugin> pluginClazz)
pluginClazz
- public boolean disablePlugin(PlayPlugin plugin)
plugin
- public boolean disablePlugin(Class<? extends PlayPlugin> pluginClazz)
public void updatePlayPluginsList()
public List<PlayPlugin> getEnabledPlugins()
public List<PlayPlugin> getEnabledPluginsWithFilters()
public <T> F.Option<PlayPlugin.Filter<T>> composeFilters()
public Collection<PlayPlugin> getReversedEnabledPlugins()
public 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(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 enhance(ApplicationClasses.ApplicationClass applicationClass)
@Deprecated public List<ApplicationClasses.ApplicationClass> onClassesChange(List<ApplicationClasses.ApplicationClass> modified)
@Deprecated public void compileAll(List<ApplicationClasses.ApplicationClass> classes)
public Object bind(RootParamNode rootParamNode, String name, Class<?> clazz, Type type, Annotation[] annotations)
public Object bindBean(RootParamNode rootParamNode, String name, Object bean)
public Model.Factory modelFactory(Class<? extends Model> modelClass)
public void beforeActionInvocation(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 Exception
Exception
public boolean serveStatic(VirtualFile file, Http.Request request, Http.Response response)
public String overrideTemplateSource(BaseTemplate template, String source)
public Template loadTemplate(VirtualFile file)
public void afterFixtureLoad()
public TestEngine.TestResults runTest(Class<BaseTest> clazz)
public Collection<Class> getUnitTests()
public Collection<Class> getFunctionalTests()
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly