public class ModuleImpl extends Object implements Module
| Modifier and Type | Field and Description |
|---|---|
protected ModuleConfiguration |
configuration |
protected DirectoryStack |
dirStack |
protected WebEngine |
engine |
protected ConcurrentMap<String,ScriptFile> |
fileCache |
protected LinkRegistry |
linkReg |
protected Messages |
messages |
protected ResourceType |
rootType
Deprecated.
Use
WebApplication to declare modules - modules may have multiple roots |
protected com.sun.jersey.server.impl.inject.ServerInjectableProviderContext |
sic |
protected String |
skinPathPrefix |
protected ModuleImpl |
superModule |
protected Object |
typeLock |
protected TypeRegistry |
typeReg |
| Constructor and Description |
|---|
ModuleImpl(WebEngine engine,
ModuleImpl superModule,
ModuleConfiguration config,
com.sun.jersey.server.impl.inject.ServerInjectableProviderContext sic) |
| 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.
|
protected ScriptFile |
findFile(String path) |
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() |
protected void |
loadDirectoryStack() |
void |
reloadMessages() |
String |
toString() |
protected TypeRegistry typeReg
protected final ModuleConfiguration configuration
protected final com.sun.jersey.server.impl.inject.ServerInjectableProviderContext sic
protected final ModuleImpl superModule
protected LinkRegistry linkReg
protected final String skinPathPrefix
@Deprecated protected ResourceType rootType
WebApplication to declare modules - modules may have multiple rootsprotected DirectoryStack dirStack
protected ConcurrentMap<String,ScriptFile> fileCache
public ModuleImpl(WebEngine engine, ModuleImpl superModule, ModuleConfiguration config, com.sun.jersey.server.impl.inject.ServerInjectableProviderContext sic)
public boolean isHeadless()
public Set<String> getNatures()
public ModuleImpl getSuperModule()
getSuperModule in interface Modulepublic ModuleConfiguration getModuleConfiguration()
@Deprecated public ResourceType getRootType()
WebApplication to declare modules@Deprecated public Resource getRootObject(WebContext ctx)
WebApplication to declare modulesgetRootObject in interface Modulepublic String getSkinPathPrefix()
ModuleThis prefix is exposed to templates as ${skinPath}.
getSkinPathPrefix in interface Modulepublic TypeRegistry getTypeRegistry()
public Class<?> loadClass(String className) throws ClassNotFoundException
ModuleThe scripting class loader will be used to load the class.
loadClass in interface ModuleclassName - the class nameClassNotFoundExceptionpublic ResourceType getType(String typeName)
ModuleResourceType instance given its name.
The web type lookup is performed in the following order:
public ResourceType[] getTypes()
Modulepublic AdapterType[] getAdapters()
ModulegetAdapters in interface Modulepublic AdapterType getAdapter(Resource ctx, String name)
ModulegetAdapter in interface Modulectx - the target resourcename - the adapter namepublic List<String> getAdapterNames(Resource ctx)
ModulegetAdapterNames in interface Modulectx - the context resourcepublic List<AdapterType> getAdapters(Resource ctx)
ModulegetAdapters in interface Modulectx - the context resourcepublic List<String> getEnabledAdapterNames(Resource ctx)
ModuleEnabled services are those adapters which can be accessed in the current security context.
getEnabledAdapterNames in interface Modulectx - the context resourcepublic List<AdapterType> getEnabledAdapters(Resource ctx)
ModuleEnabled adapters are those adapters which can be accessed in the current security context.
getEnabledAdapters in interface Modulectx - the context resourcepublic String getMediaTypeId(javax.ws.rs.core.MediaType mt)
getMediaTypeId in interface Modulepublic List<ResourceBinding> getResourceBindings()
getResourceBindings in interface Modulepublic boolean isDerivedFrom(String moduleName)
isDerivedFrom in interface Modulepublic void loadConfiguration()
public List<LinkDescriptor> getLinks(String category)
public List<LinkDescriptor> getActiveLinks(Resource context, String category)
getActiveLinks in interface Modulepublic LinkRegistry getLinkRegistry()
public String getTemplateFileExt()
getTemplateFileExt in interface Modulepublic void flushSkinCache()
public void flushTypeCache()
@Deprecated public void flushRootResourcesCache()
public void flushCache()
flushCache in interface Modulepublic static File getSkinDir(File moduleDir)
protected void loadDirectoryStack()
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.
protected ScriptFile findFile(String path) throws IOException
path - a normalized path (absolute path)IOExceptionpublic ScriptFile getSkinResource(String path) throws IOException
ModulegetSkinResource in interface ModuleIOExceptionpublic TypeRegistry createTypeRegistry()
public void reloadMessages()
public Messages getMessages()
getMessages in interface Modulepublic Map<String,String> getMessages(String language)
getMessages in interface MessagesProvidergetMessages in interface ModuleCopyright © 2017 Nuxeo. All rights reserved.