当前位置: 首页>>代码示例>>Java>>正文


Java NotesContext.getCurrentUnchecked方法代码示例

本文整理汇总了Java中com.ibm.domino.xsp.module.nsf.NotesContext.getCurrentUnchecked方法的典型用法代码示例。如果您正苦于以下问题:Java NotesContext.getCurrentUnchecked方法的具体用法?Java NotesContext.getCurrentUnchecked怎么用?Java NotesContext.getCurrentUnchecked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ibm.domino.xsp.module.nsf.NotesContext的用法示例。


在下文中一共展示了NotesContext.getCurrentUnchecked方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createEngine

import com.ibm.domino.xsp.module.nsf.NotesContext; //导入方法依赖的package包/类
public ServiceEngine createEngine(HttpServletRequest request, HttpServletResponse response) throws ServletException {
    String pathInfo = request.getPathInfo();
    ServiceFactory e = findServiceFactory(pathInfo);
    if(e!=null) {
        ServiceEngine engine = e.createEngine(request, response);
        if(engine instanceof RestDominoService) {
            NotesContext c = NotesContext.getCurrentUnchecked();
            if(c!=null) {
                RestDominoService ds = (RestDominoService)engine;
                ds.setDefaultSession(c.getCurrentSession());
                ds.setDefaultDatabase(c.getCurrentDatabase());
            }
        }
        return engine;
    }
    
    throw new ServletException(StringUtil.format("Unknown service {0}",pathInfo)); // $NLX-DefaultServiceFactory.Unknownservice0-1$
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:19,代码来源:DefaultServiceFactory.java

示例2: ThreadContext

import com.ibm.domino.xsp.module.nsf.NotesContext; //导入方法依赖的package包/类
public ThreadContext(final String username, final String servername, final String dpath) {
	this.username = username;
	this.servername = servername;
	this.dbpath = dpath;
	NotesContext current = NotesContext.getCurrentUnchecked();
	if (current == null) {
		this.module = null;	// Ummmm... bad things are about to happen...
	} else {
		this.module = NotesContext.getCurrent().getModule();
	}
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:12,代码来源:BackgroundRunnable.java

示例3: wrapSession

import com.ibm.domino.xsp.module.nsf.NotesContext; //导入方法依赖的package包/类
protected Session wrapSession(final lotus.domino.Session raw, final boolean selfCreated) {
	Session sess = Factory.getWrapperFactory().fromLotus(raw, Session.SCHEMA, null);
	sess.setNoRecycle(!selfCreated);

	boolean allFix = true;
	AutoMime autoMime = AutoMime.WRAP_32K;
	boolean mimeFriendly = true;
	if (NotesContext.getCurrentUnchecked() != null) {
		allFix = ODAPlatform.isAppAllFix(null);
		autoMime = ODAPlatform.getAppAutoMime(null);
		mimeFriendly = ODAPlatform.isAppMimeFriendly(null);
	}

	if (allFix) {
		for (Fixes fix : Fixes.values()) {
			if (fix.isKhan()) {
				sess.setFixEnable(fix, true);
			}
		}
	}
	sess.setAutoMime(autoMime);

	if (mimeFriendly) {
		sess.setConvertMIME(false);
	}
	if (selfCreated && currentApiPath_ != null) {
		Database db = sess.getCurrentDatabase();
		if (db == null) {
			db = sess.getDatabase(currentApiPath_);
			setCurrentDatabase(sess, db);
		}
	}

	return sess;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:36,代码来源:AbstractXPageSessionFactory.java

示例4: XotsModuleTasklet

import com.ibm.domino.xsp.module.nsf.NotesContext; //导入方法依赖的package包/类
public XotsModuleTasklet(final String moduleName, final String className, final Object... args) {
	super();
	this.moduleName = moduleName;
	this.className = className;
	this.args = args;
	if (NotesContext.getCurrentUnchecked() == null) {
		// perform a check if there is NO open context.
		// if there is an open context, we cannot switch the module.
		// maybe we can do this in a separate thread
		NSFComponentModule module = loadModule();
		NotesContext ctx = new NotesContext(module);
		NotesContext.initThread(ctx);
		try {
			Factory.initThread(ODAPlatform.getAppThreadConfig(module.getNotesApplication()));
			try {
				ClassLoader mcl = module.getModuleClassLoader();
				ClassLoader oldCl = switchClassLoader(mcl);
				Factory.setClassLoader(mcl);
				try {
					Class<?> clazz = mcl.loadClass(className);
					findConstructor(clazz, args); // try if we can find the constructor
				} catch (ClassNotFoundException e) {
					throw new IllegalArgumentException("Could not load class " + className + " in module " + moduleName, e);
				} finally {
					switchClassLoader(oldCl);
				}
			} finally {
				Factory.termThread();
			}
		} finally {
			NotesContext.termThread();
		}
	}
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:35,代码来源:XotsDominoExecutor.java

示例5: getCurrentDatabase

import com.ibm.domino.xsp.module.nsf.NotesContext; //导入方法依赖的package包/类
public static Database getCurrentDatabase() {
	// WARN: The API bellow can change so do not use it directly!
	NotesContext nc = NotesContext.getCurrentUnchecked();
	return nc!=null ? nc.getCurrentDatabase() : null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:6,代码来源:ExtLibUtil.java

示例6: getCurrentSession

import com.ibm.domino.xsp.module.nsf.NotesContext; //导入方法依赖的package包/类
public static Session getCurrentSession() {
	// WARN: The API bellow can change so do not use it directly!
	NotesContext nc = NotesContext.getCurrentUnchecked();
	return nc!=null ? nc.getCurrentSession() : null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:6,代码来源:ExtLibUtil.java

示例7: getCurrentSessionAsSigner

import com.ibm.domino.xsp.module.nsf.NotesContext; //导入方法依赖的package包/类
public static Session getCurrentSessionAsSigner() {
	// WARN: The API bellow can change so do not use it directly!
	NotesContext nc = NotesContext.getCurrentUnchecked();
	return nc!=null ? nc.getSessionAsSigner() : null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:6,代码来源:ExtLibUtil.java

示例8: getCurrentSessionAsSignerWithFullAccess

import com.ibm.domino.xsp.module.nsf.NotesContext; //导入方法依赖的package包/类
public static Session getCurrentSessionAsSignerWithFullAccess() {
	// WARN: The API bellow can change so do not use it directly!
	NotesContext nc = NotesContext.getCurrentUnchecked();
	return nc!=null ? nc.getSessionAsSignerFullAdmin() : null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:6,代码来源:ExtLibUtil.java

示例9: getSessionAsSigner

import com.ibm.domino.xsp.module.nsf.NotesContext; //导入方法依赖的package包/类
public static Session getSessionAsSigner() {
	NotesContext nc = NotesContext.getCurrentUnchecked();
	return (null != nc) ? nc.getSessionAsSignerFullAdmin() : null;
}
 
开发者ID:majkilde,项目名称:LogFileReader,代码行数:5,代码来源:NotesObjects.java

示例10: getCurrentModule

import com.ibm.domino.xsp.module.nsf.NotesContext; //导入方法依赖的package包/类
protected NSFComponentModule getCurrentModule() {
	NotesContext ctx = NotesContext.getCurrentUnchecked();
	if (ctx == null)
		return null;
	return ctx.getModule();
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:7,代码来源:XotsDominoExecutor.java


注:本文中的com.ibm.domino.xsp.module.nsf.NotesContext.getCurrentUnchecked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。