|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.config.DefaultConfigurable
org.norther.tammi.spray.engine.AbstractTemplateEngine
org.norther.tammi.spray.servlet.DefaultServletEngine
public class DefaultServletEngine
DefaultServletEngine implements TemplateEngine for servlet templates.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
MODIFIED, SYNCHRONIZED, UNMODIFIED |
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.spray.servlet.ServletEngine |
|---|
CONTEXT_NAME_PROPERTY, FOLDER_PATHS_PROPERTY, FORWARDED_PROPERTY, TEMPLATE_KEY_PROPERTY |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultServletEngine()
Constructs a new engine. |
|
| Method Summary | |
|---|---|
void |
addFolderPath(int index,
String path)
Adds a template folder path at the specified index. |
void |
addFolderPath(String path)
Adds a template folder path. |
protected void |
checkProperties()
Checks properties. |
void |
clearFolders()
Clears all template folders. |
protected void |
dispatch(String path,
TemplateContext context,
ServletRequest request,
ServletResponse response,
Writer writer)
Dispatches the specified template path. |
ObjectName |
getContextName()
Gets the startup context name. |
String[] |
getFolderPaths()
Gets the template folder paths. |
String |
getTemplateKey()
Gets the path finder key for resolving template paths. |
boolean |
isForwarded()
Gets the forwarded option. |
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
protected void |
process(CharSequence content,
TemplateContext context,
String template,
String encoding,
Writer writer)
Subclasses implement this method to process the specified run-time content or target template. |
void |
removeFolderPath(String path)
Removes a template folder path. |
void |
setContextName(ObjectName name)
Sets the startup context name. |
void |
setFolderPaths(String[] paths)
Sets the template folder paths. |
void |
setForwarded(boolean option)
Sets the forwarded option. |
void |
setTemplateKey(String key)
Sets the path finder key for resolving template paths. |
boolean |
templateExists(String template)
Checks whether a specific template exists. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
protected void |
updateProperties()
Updates properties. |
| Methods inherited from class org.norther.tammi.spray.engine.AbstractTemplateEngine |
|---|
clearCached, evaluate, evaluate, evaluate, execute, execute, execute, expireCached, expireFraction, getCache, getDefaultEncoding, getRefreshed, getTemplateEncoding, isCachingDisabled, isStarted, refresh, removeCache, resolveLocalizedTemplate, setCachingDisabled, setDefaultEncoding, start, stop |
| Methods inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getConfiguration, getModifiedState, getProperties, getProperty, getPropertyFilePath, indexOfProperty, loadConfiguration, loadConfiguration, loadConfiguration, modified, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setModifiedState, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.spray.engine.TemplateEngine |
|---|
evaluate, evaluate, evaluate, execute, execute, execute, getDefaultEncoding, resolveLocalizedTemplate, setDefaultEncoding |
| Methods inherited from interface org.norther.tammi.core.config.Configurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties |
| Methods inherited from interface org.norther.tammi.core.cache.CacheClient |
|---|
clearCached, expireCached, expireFraction, getCache, isCachingDisabled, removeCache, setCachingDisabled |
| Methods inherited from interface org.norther.tammi.core.base.Refreshable |
|---|
getRefreshed, refresh |
| Methods inherited from interface org.norther.tammi.core.base.Startable |
|---|
isStarted, start, stop |
| Constructor Detail |
|---|
public DefaultServletEngine()
| Method Detail |
|---|
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class Adaptee
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.public String getTemplateKey()
ServletEngine
getTemplateKey in interface ServletEnginepublic void setTemplateKey(String key)
ServletEngine
setTemplateKey in interface ServletEnginekey - the path finder key.public boolean isForwarded()
ServletEngine
isForwarded in interface ServletEnginepublic void setForwarded(boolean option)
ServletEngine
setForwarded in interface ServletEngineoption - true to set the forwarded option, otherwise false.public String[] getFolderPaths()
ServletEngine
getFolderPaths in interface ServletEnginepublic void setFolderPaths(String[] paths)
ServletEngine
setFolderPaths in interface ServletEnginepaths - an array of folder paths.public void addFolderPath(String path)
ServletEngine
addFolderPath in interface ServletEnginepath - the folder path.
public void addFolderPath(int index,
String path)
ServletEngine
addFolderPath in interface ServletEngineindex - the index.path - the folder path.public void removeFolderPath(String path)
ServletEngine
removeFolderPath in interface ServletEnginepath - the folder path.public void clearFolders()
ServletEngine
clearFolders in interface ServletEnginepublic ObjectName getContextName()
ServletEngine
getContextName in interface ServletEnginepublic void setContextName(ObjectName name)
ServletEngine
setContextName in interface ServletEnginename - the name of the context or a query.public boolean templateExists(String template)
TemplateEngine
templateExists in interface TemplateEnginetemplateExists in class AbstractTemplateEnginetemplate - the name of the template.
protected void process(CharSequence content,
TemplateContext context,
String template,
String encoding,
Writer writer)
throws TemplateException
AbstractTemplateEngineNote that implementations should catch TemplateBreakExceptions.
process in class AbstractTemplateEnginecontent - optional run-time content.context - the template context.template - the target template.encoding - the template encoding.writer - the content writer.
TemplateException - on errors.
protected void dispatch(String path,
TemplateContext context,
ServletRequest request,
ServletResponse response,
Writer writer)
throws IOException,
ServletException
path - the resolved template path.context - the template context.request - the servlet request.response - the servlet response.writer - the content writer.
IOException - on I/O errors.
ServletException - on servlet errors.protected void checkProperties()
protected void updateProperties()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||