本文整理汇总了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$
}
示例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();
}
}
示例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;
}
示例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();
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}