本文整理汇总了Java中lucee.runtime.Component.containsKey方法的典型用法代码示例。如果您正苦于以下问题:Java Component.containsKey方法的具体用法?Java Component.containsKey怎么用?Java Component.containsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lucee.runtime.Component
的用法示例。
在下文中一共展示了Component.containsKey方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: call
import lucee.runtime.Component; //导入方法依赖的package包/类
public Object call(String cfcPath,String id,String functionName,Struct arguments, boolean cfcPeristent, Object defaultValue) throws PageException {
String requestURI=toRequestURI(cfcPath);
PageContext oldPC = ThreadLocalPageContext.get();
PageContextImpl pc=createPageContext(requestURI,id,functionName,arguments,cfcPeristent);
try {
ThreadLocalPageContext.register(pc);
Component cfc=getCFC(pc,requestURI);
if(cfc.containsKey(functionName)){
pc.execute(requestURI, true,false);
// Result
return pc.variablesScope().get(AMF_FORWARD,null);
}
}
finally{
CFMLFactory f = config.getFactory();
f.releasePageContext(pc);
ThreadLocalPageContext.register(oldPC);
}
return defaultValue;
}
示例2: setPropeties
import lucee.runtime.Component; //导入方法依赖的package包/类
public static void setPropeties(PageContext pc, Component cfc, Struct properties, boolean ignoreNotExisting) throws PageException {
if(properties==null) return;
// argumentCollection
if(properties.size()==1 && properties.containsKey(KeyConstants._argumentCollection) && !cfc.containsKey(KeyConstants._setArgumentCollection)) {
properties=Caster.toStruct(properties.get(KeyConstants._argumentCollection));
}
Iterator<Entry<Key, Object>> it = properties.entryIterator();
Entry<Key, Object> e;
while(it.hasNext()){
e = it.next();
if(ignoreNotExisting) {
try {
cfc.call(pc, "set"+e.getKey().getString(), new Object[]{e.getValue()});
}
catch(Throwable t){
ExceptionUtil.rethrowIfNecessary(t);
}
}
else {
cfc.call(pc, "set"+e.getKey().getString(), new Object[]{e.getValue()});
}
}
}
示例3: onApplicationEnd
import lucee.runtime.Component; //导入方法依赖的package包/类
@Override
public void onApplicationEnd(CFMLFactory factory, String applicationName) throws PageException {
Component app = apps.get(applicationName);
if(app==null || !app.containsKey(ON_APPLICATION_END)) return;
PageContextImpl pc=(PageContextImpl) ThreadLocalPageContext.get();
boolean createPc=pc==null;
try {
if(createPc)pc = createPageContext(factory,app,applicationName,null,ON_APPLICATION_END,true,-1);
call(app,pc, ON_APPLICATION_END, new Object[]{pc.applicationScope()},true);
}
finally {
if(createPc && pc!=null){
factory.releaseLuceePageContext(pc,createPc);
}
}
}
示例4: onSessionEnd
import lucee.runtime.Component; //导入方法依赖的package包/类
@Override
public void onSessionEnd(CFMLFactory factory, String applicationName, String cfid) throws PageException {
Component app = apps.get(applicationName);
if(app==null || !app.containsKey(ON_SESSION_END)) return;
PageContextImpl pc=null;
try {
pc = createPageContext(factory,app,applicationName,cfid,ON_SESSION_END,true,-1);
call(app,pc, ON_SESSION_END, new Object[]{pc.sessionScope(false),pc.applicationScope()},true);
}
finally {
if(pc!=null){
factory.releaseLuceePageContext(pc,true);
}
}
}
示例5: onError
import lucee.runtime.Component; //导入方法依赖的package包/类
@Override
public void onError(PageContext pc, PageException pe) {
Component app = apps.get(pc.getApplicationContext().getName());
if(app!=null && app.containsKey(ON_ERROR) && !Abort.isSilentAbort(pe)) {
try {
String eventName="";
if(pe instanceof ModernAppListenerException) eventName= ((ModernAppListenerException)pe).getEventName();
if(eventName==null)eventName="";
call(app,pc, ON_ERROR, new Object[]{pe.getCatchBlock(pc),eventName},true);
return;
}
catch(PageException _pe) {
pe=_pe;
}
}
pc.handlePageException(pe);
}
示例6: setPropeties
import lucee.runtime.Component; //导入方法依赖的package包/类
public static void setPropeties(PageContext pc, Component c, Struct properties, boolean ignoreNotExisting) throws PageException {
if(properties==null) return;
// argumentCollection
if(properties.size()==1 && properties.containsKey(KeyConstants._argumentCollection) && !c.containsKey(KeyConstants._setArgumentCollection)) {
properties=Caster.toStruct(properties.get(KeyConstants._argumentCollection));
}
Iterator<Entry<Key, Object>> it = properties.entryIterator();
Entry<Key, Object> e;
while(it.hasNext()){
e = it.next();
if(ignoreNotExisting) {
try {
c.call(pc, "set"+e.getKey().getString(), new Object[]{e.getValue()});
}
catch(Throwable t) {ExceptionUtil.rethrowIfNecessary(t);}
}
else {
c.call(pc, "set"+e.getKey().getString(), new Object[]{e.getValue()});
}
}
}
示例7: call
import lucee.runtime.Component; //导入方法依赖的package包/类
public Object call(String cfcPath,String id,String functionName,Struct arguments, boolean cfcPeristent, Object defaultValue) throws PageException {
String requestURI=toRequestURI(cfcPath);
PageContext oldPC = ThreadLocalPageContext.get();
PageContextImpl pc=null;
try {
pc=createPageContext(requestURI,id,functionName,arguments,cfcPeristent,true);
String ext = ResourceUtil.getExtension(cfcPath, null);
ConfigWeb config=(ConfigWeb) ThreadLocalPageContext.getConfig();
int dialect = ext==null?CFMLEngine.DIALECT_CFML: config.getFactory().toDialect(ext);
//ThreadLocalPageContext.register(pc);
Component cfc=getCFC(pc,requestURI);
if(cfc.containsKey(functionName)){
if(dialect==CFMLEngine.DIALECT_LUCEE)
pc.execute(requestURI, true,false);
else
pc.executeCFML(requestURI, true,false);
// Result
return pc.variablesScope().get(AMF_FORWARD,null);
}
}
finally{
CFMLFactory f = config.getFactory();
f.releaseLuceePageContext(pc,true);
ThreadLocalPageContext.register(oldPC);
}
return defaultValue;
}