public class ModuleImpl extends Object implements Module
Constructor and Description |
---|
ModuleImpl(WebEngine engine,
ModuleImpl superModule,
ModuleConfiguration config) |
Modifier and Type | Method and Description |
---|---|
TypeRegistry |
createTypeRegistry()
TODO There are no more reasons to lazy load the type registry since module are lazy loaded.
|
void |
flushCache() |
void |
flushRootResourcesCache()
Deprecated.
resources are deprecated - you should use a jax-rs application to declare more resources.
|
void |
flushSkinCache() |
void |
flushTypeCache() |
List<LinkDescriptor> |
getActiveLinks(Resource context,
String category) |
AdapterType |
getAdapter(Resource ctx,
String name)
Gets the named adapter definition for the given resource.
|
List<String> |
getAdapterNames(Resource ctx)
Gets the list of adapter names that applies to the given resource.
|
AdapterType[] |
getAdapters()
Gets the adapters registered within this module.
|
List<AdapterType> |
getAdapters(Resource ctx)
Gets the list of adapters that applies to the given resource.
|
List<String> |
getEnabledAdapterNames(Resource ctx)
Gets the list of adapter names that are enabled for the given context.
|
List<AdapterType> |
getEnabledAdapters(Resource ctx)
Gets the list of adapters that are enabled for the given context.
|
WebEngine |
getEngine() |
ScriptFile |
getFile(String path)
Gets a file using the configured directory stack.
|
LinkRegistry |
getLinkRegistry() |
List<LinkDescriptor> |
getLinks(String category) |
String |
getMediaTypeId(javax.ws.rs.core.MediaType mt) |
Messages |
getMessages() |
Map<String,String> |
getMessages(String language) |
ModuleConfiguration |
getModuleConfiguration() |
String |
getName() |
Set<String> |
getNatures() |
List<ResourceBinding> |
getResourceBindings() |
File |
getRoot() |
Resource |
getRootObject(WebContext ctx)
Deprecated.
Use
WebApplication to declare modules |
ResourceType |
getRootType()
Deprecated.
Use
WebApplication to declare modules |
static File |
getSkinDir(File moduleDir) |
String |
getSkinPathPrefix()
Get the path prefix to be used from templates to prepend to links to static resources.
|
ScriptFile |
getSkinResource(String path)
Gets a skin resource input stream.
|
ModuleImpl |
getSuperModule() |
String |
getTemplateFileExt() |
ResourceType |
getType(String typeName)
Gets a
ResourceType instance given its name. |
TypeRegistry |
getTypeRegistry() |
ResourceType[] |
getTypes()
Gets the types registered within this module.
|
boolean |
hasNature(String natureId) |
boolean |
isDerivedFrom(String moduleName) |
boolean |
isHeadless()
Whether or not this module has a GUI and should be listed in available GUI module list.
|
Class<?> |
loadClass(String className)
Loads a class given its name.
|
void |
loadConfiguration() |
void |
reloadMessages() |
String |
toString() |
public ModuleImpl(WebEngine engine, ModuleImpl superModule, ModuleConfiguration config)
public boolean isHeadless()
public Set<String> getNatures()
public boolean hasNature(String natureId)
public ModuleImpl getSuperModule()
getSuperModule
in interface Module
public ModuleConfiguration getModuleConfiguration()
@Deprecated public ResourceType getRootType()
WebApplication
to declare modules@Deprecated public Resource getRootObject(WebContext ctx)
WebApplication
to declare modulesgetRootObject
in interface Module
public String getSkinPathPrefix()
Module
This prefix is exposed to templates as ${skinPath}.
getSkinPathPrefix
in interface Module
public TypeRegistry getTypeRegistry()
public Class<?> loadClass(String className) throws ClassNotFoundException
Module
The scripting class loader will be used to load the class.
loadClass
in interface Module
className
- the class nameClassNotFoundException
public ResourceType getType(String typeName)
Module
ResourceType
instance given its name.
The web type lookup is performed in the following order:
public ResourceType[] getTypes()
Module
public AdapterType[] getAdapters()
Module
getAdapters
in interface Module
public AdapterType getAdapter(Resource ctx, String name)
Module
getAdapter
in interface Module
ctx
- the target resourcename
- the adapter namepublic List<String> getAdapterNames(Resource ctx)
Module
getAdapterNames
in interface Module
ctx
- the context resourcepublic List<AdapterType> getAdapters(Resource ctx)
Module
getAdapters
in interface Module
ctx
- the context resourcepublic List<String> getEnabledAdapterNames(Resource ctx)
Module
Enabled services are those adapters which can be accessed in the current security context.
getEnabledAdapterNames
in interface Module
ctx
- the context resourcepublic List<AdapterType> getEnabledAdapters(Resource ctx)
Module
Enabled adapters are those adapters which can be accessed in the current security context.
getEnabledAdapters
in interface Module
ctx
- the context resourcepublic String getMediaTypeId(javax.ws.rs.core.MediaType mt)
getMediaTypeId
in interface Module
public List<ResourceBinding> getResourceBindings()
getResourceBindings
in interface Module
public boolean isDerivedFrom(String moduleName)
isDerivedFrom
in interface Module
public void loadConfiguration()
public List<LinkDescriptor> getLinks(String category)
public List<LinkDescriptor> getActiveLinks(Resource context, String category)
getActiveLinks
in interface Module
public LinkRegistry getLinkRegistry()
public String getTemplateFileExt()
getTemplateFileExt
in interface Module
public void flushSkinCache()
public void flushTypeCache()
@Deprecated public void flushRootResourcesCache()
public void flushCache()
flushCache
in interface Module
public ScriptFile getFile(String path)
Module
Note that the implementation may cache the results. To clear any cached data, you should call the
Module.flushCache()
method.
public ScriptFile getSkinResource(String path) throws IOException
Module
getSkinResource
in interface Module
IOException
public TypeRegistry createTypeRegistry()
public void reloadMessages()
public Messages getMessages()
getMessages
in interface Module
public Map<String,String> getMessages(String language)
getMessages
in interface MessagesProvider
getMessages
in interface Module
Copyright © 2015 Nuxeo SA. All rights reserved.