本文整理了Java中org.apache.velocity.runtime.RuntimeSingleton.getRuntimeInstance
方法的一些代码示例,展示了RuntimeSingleton.getRuntimeInstance
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RuntimeSingleton.getRuntimeInstance
方法的具体详情如下:
包路径:org.apache.velocity.runtime.RuntimeSingleton
类名称:RuntimeSingleton
方法名:getRuntimeInstance
暂无
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.velocity
/**
* <p>
* Set the an ApplicationAttribue, which is an Object
* set by the application which is accessable from
* any component of the system that gets a RuntimeServices.
* This allows communication between the application
* environment and custom pluggable components of the
* Velocity engine, such as loaders and loggers.
* </p>
*
* <p>
* Note that there is no enfocement or rules for the key
* used - it is up to the application developer. However, to
* help make the intermixing of components possible, using
* the target Class name (e.g. com.foo.bar ) as the key
* might help avoid collision.
* </p>
*
* @param key object 'name' under which the object is stored
* @param value object to store under this key
*/
public static void setApplicationAttribute( Object key, Object value )
{
RuntimeSingleton.getRuntimeInstance().setApplicationAttribute( key, value);
}
代码示例来源:origin: org.apache.velocity/com.springsource.org.apache.velocity
/**
* <p>
* Set the an ApplicationAttribue, which is an Object
* set by the application which is accessable from
* any component of the system that gets a RuntimeServices.
* This allows communication between the application
* environment and custom pluggable components of the
* Velocity engine, such as loaders and loggers.
* </p>
*
* <p>
* Note that there is no enfocement or rules for the key
* used - it is up to the application developer. However, to
* help make the intermixing of components possible, using
* the target Class name (e.g. com.foo.bar ) as the key
* might help avoid collision.
* </p>
*
* @param key object 'name' under which the object is stored
* @param value object to store under this key
*/
public static void setApplicationAttribute( Object key, Object value )
{
RuntimeSingleton.getRuntimeInstance().setApplicationAttribute( key, value);
}
代码示例来源:origin: velocity/velocity-dep
/**
* <p>
* Set the an ApplicationAttribue, which is an Object
* set by the application which is accessable from
* any component of the system that gets a RuntimeServices.
* This allows communication between the application
* environment and custom pluggable components of the
* Velocity engine, such as loaders and loggers.
* </p>
*
* <p>
* Note that there is no enfocement or rules for the key
* used - it is up to the application developer. However, to
* help make the intermixing of components possible, using
* the target Class name (e.g. com.foo.bar ) as the key
* might help avoid collision.
* </p>
*
* @param key object 'name' under which the object is stored
* @param value object to store under this key
*/
public static void setApplicationAttribute( Object key, Object value )
{
RuntimeSingleton.getRuntimeInstance().setApplicationAttribute( key, value);
}
代码示例来源:origin: net.sf.taverna.t2.activities/interaction-activity
@SuppressWarnings("deprecation")
public static void checkVelocity() {
if (velocityInitialized) {
return;
}
Velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, "string");
Velocity.setProperty("resource.loader.class",
"org.apache.velocity.runtime.resource.loader.StringResourceLoader");
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
"org.apache.velocity.runtime.log.Log4JLogChute");
Velocity.setProperty("runtime.log.logsystem.log4j.logger",
"net.sf.taverna.t2.activities.interaction.velocity.InteractionVelocity");
Velocity.init();
RuntimeSingleton.getRuntimeInstance().addDirective(
new RequireDirective());
RuntimeSingleton.getRuntimeInstance().addDirective(
new ProduceDirective());
RuntimeSingleton.getRuntimeInstance().addDirective(
new NotifyDirective());
velocityInitialized = true;
loadTemplates();
interactionTemplate = Velocity.getTemplate(INTERACTION_TEMPLATE_NAME);
if (interactionTemplate == null) {
logger.error("Could not open interaction template "
+ INTERACTION_TEMPLATE_NAME);
}
}
内容来源于网络,如有侵权,请联系作者删除!