|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<RythmConfigurationKey>
org.rythmengine.conf.RythmConfigurationKey
public enum RythmConfigurationKey
RythmEngine
configuration keys. General rules:
.enabled
, then you should be able to set
the setting without .enabled
or replace it with .disabled
but the value will be inverted. For example, built_in.transformer.enabled
is equal to built_in.transformer
and invert to
built_in.transformer.disabled
.impl
, then you can either put an instance into
the configuration map or a string of the class name
Enum Constant Summary | |
---|---|
BUILT_IN_CODE_TYPE_ENABLED
"built_in.code_type.enabled": Enable built-in code type implementations
|
|
BUILT_IN_TRANSFORMER_ENABLED
"built_in.transformer.enabled": Enable built-in transformer implementations
|
|
CACHE_DURATION_PARSER_IMPL
"cache.duration_parser.impl": set duration parser implementation. |
|
CACHE_ENABLED
"cache.enabled": Enable disable cache service . |
|
CACHE_PROD_ONLY_ENABLED
"cache.prod_only.enabled": Turn on/off cache at dev mode. |
|
CACHE_SERVICE_IMPL
"cache.service.impl": Set cache service implementation
|
|
CODEGEN_BYTE_CODE_ENHANCER
"codegen.byte_code_enhancer.impl": Set template byte code enhancer implementation. |
|
CODEGEN_COMPACT_ENABLED
"codegen.compact.enabled": Enable/disable compact redundant space and lines |
|
CODEGEN_SOURCE_CODE_ENHANCER
"codegen.source_code_enhancer.impl": Set template source code enhancer
implementation. |
|
DEFAULT_CACHE_TTL
"default.cache_ttl": Set default cache ttl
in second
|
|
DEFAULT_CODE_TYPE_IMPL
"default.code_type.impl": Set default code type
|
|
ENGINE_CLASS_LOADER_BYTE_CODE_HELPER_IMPL
"engine.class_loader.byte_code_helper.impl": Set the bytecode helper
implementation |
|
ENGINE_CLASS_LOADER_PARENT_IMPL
"engine.class_loader.parent.impl": Set the parent class loader of the rythm
template class loader |
|
ENGINE_FILE_WRITE_ENABLED
"engine.file_write.enabled": Enable/disable write to file system. |
|
ENGINE_ID
"engine.id": Set the ID of rythm engine instance |
|
ENGINE_LOAD_PRECOMPILED_ENABLED
"engine.load_precompiled.enabled": Set the flag so that Rythm will load precompiled template class directly from bytecode cached in the precompiled root when running
in prod mode. |
|
ENGINE_MODE
"engine.mode": Set the mode of rythm engine |
|
ENGINE_OUTPUT_JAVA_SOURCE_ENABLED
|
|
ENGINE_PLAYFRAMEWORK
"engine.playframework.enabled": A special flag used when Rythm is working with rythm-plugin for Play!Framework. |
|
ENGINE_PLUGIN_VERSION
"engine.plugin.version": Set by plugin of certain framework, e.g. |
|
ENGINE_PRECOMPILE_MODE
"engine.precompile_mode.enabled": Set/unset precompile mode. |
|
EXT_PROP_ACCESSOR
"ext.prop_accessor": User defined property accessors, should be a list of class names separated by ",". |
|
EXT_TRANSFORMER
"ext.transformer": User defined transformers, should be a list of class names separated by ",". |
|
FEATURE_DYNAMIC_EXP
"engine.dynamic_exp.eanbled": Generate code to enable evaluate dynamic expressions, and the java beans spec can be supported when this option is turned on |
|
FEATURE_NATURAL_TEMPLATE_ENABLED
"feature.natural_template.enabled": Enable disable natural template. |
|
FEATURE_SMART_ESCAPE_ENABLED
"feature.smart_escape.enabled": Enable disable smart escape. |
|
FEATURE_TRANSFORM_ENABLED
"feature.transform.enabled": Enable disable transformer
|
|
FEATURE_TYPE_INFERENCE_ENABLED
"feature.type_inference.enabled": Enable disable type inference. |
|
HOME_PRECOMPILED
"home.precompiled.dir": Set the dir root of the precompiled template bytecodes. |
|
HOME_TEMPLATE
"home.template.dir": Set the home dir of template files. |
|
HOME_TMP
"home.tmp.dir": Set the rythm tmp dir. |
|
I18N_LOCALE
"i18n.locale": the locale for the rythm runtime environment. |
|
I18N_MESSAGE_RESOLVER
"i18n.message.resolver.impl": Set i18n message resolver. |
|
I18N_MESSAGE_SOURCES
"i18n.message.sources": Set message sources. |
|
LOG_ENABLED
"log.enabled": Enable disable log in Rythm. |
|
LOG_FACTORY_IMPL
"log.factory.impl": Configure the logger factory implementation. |
|
LOG_SOURCE_JAVA_ENABLED
"log.source.java.enabled": Print out relevant java source lines when exception encountered |
|
LOG_SOURCE_TEMPLATE_ENABLED
"log.source.template.enabled": Print out relevant template source lines when exception encountered |
|
LOG_TIME_RENDER_ENABLED
"log.time.render.enabled": Log time spent executing a template. |
|
RENDER_EXCEPTION_HANDLER
"render.exception_handler.impl": Set render exception handler implementation. |
|
RENDER_LISTENER
"render.listener.impl": Set tag
invocation listener implementation. |
|
RESOURCE_LOADER_IMPL
"resource.loader.impl": The resource loader
implementation |
|
RESOURCE_NAME_SUFFIX
"resource.name.suffix": does resource name has special rythm suffix attached? E.g. |
|
SANBOX_THREAD_FACTORY_IMPL
"sandbox.thread_factory.impl": Configure the thread factory to be used by the sandbox executing service. |
|
SANDBOX_ALLOWED_SYSTEM_PROPERTIES
"sandbox.allowed_system_properties": Set allowed system properties in string separated by ,. |
|
SANDBOX_POOL_SIZE
"sandbox.pool.size": Set the thread pool size of sandbox executors. |
|
SANDBOX_RESTRICTED_CLASS
"sandbox.restricted_class": Set restricted classes for sandbox execution. |
|
SANDBOX_SECURE_CODE
"sandbox.secure_mode": used in sandbox security manager to turn on/off secure zone |
|
SANDBOX_SECURITY_MANAGER_IMPL
"sandbox.security_manager.impl": Set the security manager to be used when running a template in sandbox mode. |
|
SANDBOX_TEMP_IO_ENABLED
"sandbox.tmp_dir.io.enabled": enable or disable tmp dir IO in sandbox mode When tmp_dir io is enabled, template running in sandbox mode can read/write files in "java.io.tmpdir" |
|
SANDBOX_TIMEOUT
"sandbox.timeout": Set the timeout of a sandbox execution in milliseconds. |
Method Summary | ||
---|---|---|
|
getConfiguration(Map<String,?> configuration)
Return configuration value from the configuration data map using the key
of this setting instance |
|
|
getDefaultConfiguration()
Return default configuration of this item |
|
protected Object |
getDefVal(Map<String,?> configuration)
Return default value of this setting. |
|
String |
getKey()
Return the key string |
|
String |
toString()
Calling to this method is equals to calling getKey() |
|
static RythmConfigurationKey |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
|
static RythmConfigurationKey |
valueOfIgnoreCase(String s)
Return key enum instance from the string in case insensitive mode |
|
static RythmConfigurationKey[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final RythmConfigurationKey BUILT_IN_CODE_TYPE_ENABLED
code type
implementations
Default value: true
public static final RythmConfigurationKey BUILT_IN_TRANSFORMER_ENABLED
transformer
implementations
Default value: true
FEATURE_TRANSFORM_ENABLED
public static final RythmConfigurationKey CACHE_ENABLED
cache service
. When this
setting is turned off, the CACHE_SERVICE_IMPL
will be set to
NoCacheService
without regarding to it's configuration
Default value: false
public static final RythmConfigurationKey CACHE_SERVICE_IMPL
cache service
implementation
Default value: SimpleCacheService
Note when CACHE_ENABLED
is set to false
, then this setting
will be ignored, and the service impl will be set to NoCacheService
anyway
public static final RythmConfigurationKey CACHE_DURATION_PARSER_IMPL
duration parser
implementation.
Default value: IDurationParser.DEFAULT_PARSER
public static final RythmConfigurationKey CACHE_PROD_ONLY_ENABLED
dev
mode. When
this setting is turned on, then cache will not effect at dev mode
Default value: true
public static final RythmConfigurationKey CODEGEN_COMPACT_ENABLED
Default value: true
public static final RythmConfigurationKey CODEGEN_SOURCE_CODE_ENHANCER
source code enhancer
implementation.
Default value: null
public static final RythmConfigurationKey CODEGEN_BYTE_CODE_ENHANCER
byte code enhancer
implementation.
Default value: null
public static final RythmConfigurationKey DEFAULT_CODE_TYPE_IMPL
code type
Default value: raw
BUILT_IN_CODE_TYPE_ENABLED
is false
public static final RythmConfigurationKey DEFAULT_CACHE_TTL
cache
ttl
in second
Default value: 60 * 60(1hr
public static final RythmConfigurationKey ENGINE_MODE
mode
of rythm engine
Default value: Rythm.Mode.prod
public static final RythmConfigurationKey ENGINE_ID
Default value: "re-" plus a random String with 3 chars
public static final RythmConfigurationKey ENGINE_CLASS_LOADER_PARENT_IMPL
parent
class loader of the rythm
template class loader
Default value: first try to use current thread's context class loader
if the context classloader is null
, then use the class loader which loads the Rythm.class
public static final RythmConfigurationKey ENGINE_CLASS_LOADER_BYTE_CODE_HELPER_IMPL
bytecode helper
implementation
Default value: null
public static final RythmConfigurationKey ENGINE_LOAD_PRECOMPILED_ENABLED
precompiled root
when running
in prod
mode.
Default value: false
public static final RythmConfigurationKey ENGINE_FILE_WRITE_ENABLED
Default value: true
public static final RythmConfigurationKey ENGINE_PRECOMPILE_MODE
Default value: false
public static final RythmConfigurationKey ENGINE_OUTPUT_JAVA_SOURCE_ENABLED
public static final RythmConfigurationKey ENGINE_PLAYFRAMEWORK
Default value: false
public static final RythmConfigurationKey ENGINE_PLUGIN_VERSION
""
(empty string)
public static final RythmConfigurationKey FEATURE_TRANSFORM_ENABLED
transformer
Default value: true
public static final RythmConfigurationKey FEATURE_TYPE_INFERENCE_ENABLED
Default value: false
public static final RythmConfigurationKey FEATURE_SMART_ESCAPE_ENABLED
Default value: true
public static final RythmConfigurationKey FEATURE_NATURAL_TEMPLATE_ENABLED
Default value: true
public static final RythmConfigurationKey FEATURE_DYNAMIC_EXP
public static final RythmConfigurationKey HOME_TEMPLATE
RESOURCE_LOADER_IMPL
is not configured, therefore the TemplateResourceManager
will
try to load FileTemplateResource
from this template home dir
configured.
Default value: a file created with the following logic
new File(Thread.currentThread().getContextClassLoader().getResource("rythm").getFile())
public static final RythmConfigurationKey HOME_TMP
dev
mode.
Default value: a file created with the following logic
new File(System.__getProperty("java.io.tmpdir"), "__rythm")
public static final RythmConfigurationKey HOME_PRECOMPILED
null
ENGINE_LOAD_PRECOMPILED_ENABLED
public static final RythmConfigurationKey I18N_LOCALE
Locale
type of instance.
Default value: java.util.Locale.getDefault()
public static final RythmConfigurationKey I18N_MESSAGE_SOURCES
Default value: message
public static final RythmConfigurationKey I18N_MESSAGE_RESOLVER
II18nMessageResolver
interface. Default value: II18nMessageResolver.DefaultImpl.INSTANCE
, which delegate
to S.i18n(org.rythmengine.template.ITemplate, String, Object...)
method
public static final RythmConfigurationKey LOG_ENABLED
public static final RythmConfigurationKey LOG_FACTORY_IMPL
logger factory
implementation.
When this configuration is not set, then a JDKLogger.Factory
instance
is used to create the logger
Default value: org.rythmengine.logger.JDKLogger.Factory
public static final RythmConfigurationKey LOG_SOURCE_JAVA_ENABLED
Default value: true
public static final RythmConfigurationKey LOG_SOURCE_TEMPLATE_ENABLED
Default value: true
public static final RythmConfigurationKey LOG_TIME_RENDER_ENABLED
ILogger.debug(String, Object...)
Default value: false
public static final RythmConfigurationKey RENDER_LISTENER
tag
invocation listener
implementation.
Default value: null
public static final RythmConfigurationKey RENDER_EXCEPTION_HANDLER
render exception handler
implementation.
Default value: null
public static final RythmConfigurationKey RESOURCE_LOADER_IMPL
resource loader
implementation
Default value: null
. But if this is not configured, try templates will be loaded as
file template resource
first and if
still not found then try to load as
classpath resource
.
HOME_TEMPLATE
public static final RythmConfigurationKey RESOURCE_NAME_SUFFIX
Note, do not use regular file extensions for this setting, like ".html", ".js" etc as they can be used to identify the code type of the template
public static final RythmConfigurationKey SANDBOX_SECURITY_MANAGER_IMPL
sandbox
mode.
Default value: null
. When no security manager is configured, when the sandbox mode is running, an
instance of RythmSecurityManager
will be initiated to supervise the
execution. Usually you should NOT set this configuration and allow Rythm to run it's SecurityManager
implementation.
public static final RythmConfigurationKey SANDBOX_TIMEOUT
sandbox
execution in milliseconds.
If the execution failed to return after timeout, then Rythm will interrupt the execution thread and force it
to return. This setting prevent infinite loop in untrusted template.
Default value: 2000
public static final RythmConfigurationKey SANDBOX_POOL_SIZE
sandbox
executors.
Default value: 10
public static final RythmConfigurationKey SANDBOX_RESTRICTED_CLASS
sandbox
execution.
The value should be full name of the classes or packages separated by ;
. For example,
"foo.bar.Employee;foo.secure;...".
If a class or package name is presented in this setting, then the sandbox executor will raise a
SecurityException
when the template trying to access the class. Note whatever this setting is
configured, Rythm will prevent the access to the following classes/packages:
org.rythmengine.Rythm;
org.rythmengine.RythmEngine;
java.io;
java.nio;
java.security;
java.rmi;
java.net;
java.awt;
java.applet
Default value: ""
public static final RythmConfigurationKey SANDBOX_ALLOWED_SYSTEM_PROPERTIES
file.encoding
file.separator
line.separator
java.home
java.protocol.handler.pkgs
java.vm.name
path.separator
sun.timezone.ids.oldmapping
suppressRawWhenUnchecked
user.country
user.dir
user.language
user.region
user.timezone
public static final RythmConfigurationKey SANBOX_THREAD_FACTORY_IMPL
Default value: SandboxThreadFactory
public static final RythmConfigurationKey SANDBOX_TEMP_IO_ENABLED
Default value: true
public static final RythmConfigurationKey SANDBOX_SECURE_CODE
Default value: UUID.randomUUID().toString()
public static final RythmConfigurationKey EXT_TRANSFORMER
RythmEngine.registerTransformer
will
be called to register these user defined transformer classes. Default value: null
public static final RythmConfigurationKey EXT_PROP_ACCESSOR
RythmEngine.registerPropertyAccessor(org.rythmengine.extension.IPropertyAccessor...)
RythmEngine.registerPropertyAccessor} will
be called to register these user defined property accessor classes. Default value: null
Method Detail |
---|
public static RythmConfigurationKey[] values()
for (RythmConfigurationKey c : RythmConfigurationKey.values()) System.out.println(c);
public static RythmConfigurationKey valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic String getKey()
protected Object getDefVal(Map<String,?> configuration)
tmp dir
setting depend on the value of mode
setting
configuration
-
public String toString()
getKey()
toString
in class Enum<RythmConfigurationKey>
public <T> T getConfiguration(Map<String,?> configuration)
key
of this setting
instance
T
- configuration
-
public <T> T getDefaultConfiguration()
T
-
public static RythmConfigurationKey valueOfIgnoreCase(String s)
s
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |