本文整理汇总了Java中lotus.domino.NotesThread类的典型用法代码示例。如果您正苦于以下问题:Java NotesThread类的具体用法?Java NotesThread怎么用?Java NotesThread使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotesThread类属于lotus.domino包,在下文中一共展示了NotesThread类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initNotes
import lotus.domino.NotesThread; //导入依赖的package包/类
@BeforeClass
public static void initNotes() {
NotesNativeAPI.initialize();
String notesProgramDir = System.getenv("Notes_ExecDirectory");
String notesIniPath = System.getenv("NotesINI");
if (notesProgramDir!=null && notesProgramDir.length()>0 && notesIniPath!=null && notesIniPath.length()>0) {
NotesInitUtils.notesInitExtended(new String[] {
notesProgramDir,
"="+notesIniPath
});
m_notesInitExtendedCalled = true;
}
NotesThread.sinitThread();
Native.setProtected(true);
}
示例2: testSessionClosingIt
import lotus.domino.NotesThread; //导入依赖的package包/类
@Test
public void testSessionClosingIt() {
String password = Credentials.getPassword();
assertFalse("Password can be an empty string", password.equals(""));
for (int i = 0; i < 10; i++) {
NotesThread.sinitThread();
Session session = River.getSession(River.LOTUS_DOMINO,
(String) null, (String) null, Credentials.getPassword());
assertTrue("Notes Session could not be retrieved at the iteration " + i, session.isOpen());
assertFalse("There's a problem with the Session at the iteration " + i + ". I can't retrieve the current user name.",
session.getUserName().equals(""));
session.close();
NotesThread.stermThread();
}
}
示例3: testSessionClosingFromRiverFactory
import lotus.domino.NotesThread; //导入依赖的package包/类
@Test
public void testSessionClosingFromRiverFactory() {
String password = Credentials.getPassword();
assertFalse("Password can be an empty string", password.equals(""));
for (int i = 0; i < 10; i++) {
NotesThread.sinitThread();
Session session = River.getSession(River.ORG_OPENNTF_DOMINO,
(String) null, (String) null, Credentials.getPassword());
assertTrue("Notes Session could not be retrieved at the iteration " + i, session.isOpen());
assertFalse("There's a problem with the Session at the iteration " + i + ". I can't retrieve the current user name.",
session.getUserName().equals(""));
River.closeSession(River.ORG_OPENNTF_DOMINO);
NotesThread.stermThread();
}
}
示例4: testSessionClosingIt
import lotus.domino.NotesThread; //导入依赖的package包/类
@Test
public void testSessionClosingIt() {
String password = Credentials.getPassword();
assertFalse("Password can be an empty string", password.equals(""));
for (int i = 0; i < 10; i++) {
NotesThread.sinitThread();
Session session = River.getSession(River.ORG_OPENNTF_DOMINO,
(String) null, (String) null, Credentials.getPassword());
assertTrue("Notes Session could not be retrieved at the iteration " + i, session.isOpen());
assertFalse("There's a problem with the Session at the iteration " + i + ". I can't retrieve the current user name.",
session.getUserName().equals(""));
session.close();
NotesThread.stermThread();
}
}
示例5: before
import lotus.domino.NotesThread; //导入依赖的package包/类
@BeforeClass
public static void before() {
NotesThread.sinitThread();
// new LoggerHelper(log)
// .setUseParentHandlers(false)
// .clearHandlers()
// .addConsoleHandler()
// .addFileHandler("D:\\stress-test.txt")
// .setLevel(Level.INFO);
maxDocumentsForStressTest = 100;
log.setUseParentHandlers(false);
log.fine("Starting test");
}
示例6: testSessionClosingFromRiverFactory
import lotus.domino.NotesThread; //导入依赖的package包/类
@Test
public void testSessionClosingFromRiverFactory() {
String password = Credentials.getPassword();
assertFalse("Password can be an empty string", password.equals(""));
for (int i = 0; i < 10; i++) {
NotesThread.sinitThread();
Session session = River.getSession(River.LOTUS_DOMINO,
(String) null, (String) null, Credentials.getPassword());
assertTrue("Notes Session could not be retrieved at the iteration " + i, session.isOpen());
assertFalse("There's a problem with the Session at the iteration " + i + ". I can't retrieve the current user name.",
session.getUserName().equals(""));
River.closeSession(River.LOTUS_DOMINO);
NotesThread.stermThread();
}
}
示例7: newThread
import lotus.domino.NotesThread; //导入依赖的package包/类
@Override
public Thread newThread(Runnable runnable, ServerSession session) {
if(ApplicationListener.log.isInfoEnabled()) {
ApplicationListener.log.info("{0}: Spawning thread for server session {1}", GroovyShellLibrary.LIBRARY_ID, session);
}
NotesThread result = new NotesThread(runnable);
//result.setContextClassLoader(classLoader);
ClassLoader cl = new DelegatingClassLoader(ApplicationListener.class.getClassLoader());
result.setContextClassLoader(cl);
return result;
}
示例8: termNotes
import lotus.domino.NotesThread; //导入依赖的package包/类
@AfterClass
public static void termNotes() {
if (m_notesInitExtendedCalled) {
NotesInitUtils.notesTerm();
}
NotesThread.stermThread();
}
示例9: initNotes
import lotus.domino.NotesThread; //导入依赖的package包/类
@BeforeClass
public static void initNotes() {
String notesProgramDir = System.getenv("Notes_ExecDirectory");
String notesIniPath = System.getenv("NotesINI");
if (notesProgramDir!=null && notesProgramDir.length()>0 && notesIniPath!=null && notesIniPath.length()>0) {
NotesInitUtils.notesInitExtended(new String[] {
notesProgramDir,
"="+notesIniPath
});
m_notesInitExtendedCalled = true;
}
NotesThread.sinitThread();
}
示例10: openTrusted
import lotus.domino.NotesThread; //导入依赖的package包/类
public static Session openTrusted(){
Session s = null;
try {
NotesThread.sinitThread();
s = NotesFactory.createTrustedSession();
logger.log(Level.FINE,"opened trusted session for " + s.getEffectiveUserName());
} catch (NotesException e) {
logger.log(Level.SEVERE,null,e);
}
return s;
}
示例11: openSession
import lotus.domino.NotesThread; //导入依赖的package包/类
public static Session openSession(String username, String password){
Session s = null;
try {
NotesThread.sinitThread();
s = NotesFactory.createSession((String) null, username, password);
logger.log(Level.FINE,"opened session for " + s.getUserName());
} catch (NotesException e) {
logger.log(Level.SEVERE,null,e);
}
return s;
}
示例12: createTrustedSession
import lotus.domino.NotesThread; //导入依赖的package包/类
public static Session createTrustedSession(){
NotesThread.sinitThread();
Session s=null;
try {
s = NotesFactory.createTrustedSession();
} catch (NotesException e) {
logger.log(Level.SEVERE,null, e);
}
return s;
}
示例13: before
import lotus.domino.NotesThread; //导入依赖的package包/类
@BeforeClass
public static void before() {
NotesThread.sinitThread();
testDepth = 2;
new LoggerHelper(log).clearHandlers().addConsoleHandler().setLevel(Level.OFF);
log.setUseParentHandlers(false);
log.fine("Starting test");
}
示例14: main
import lotus.domino.NotesThread; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void main(String[] args) {
NotesThread.sinitThread();
Session<org.openntf.domino.Base<?>> session = (Session<org.openntf.domino.Base<?>>) River.getSession(River.ORG_OPENNTF_DOMINO,
(String) null, (String) null, Credentials.getPassword()).getWrapperObject();
Database<org.openntf.domino.Database> database = (Database<org.openntf.domino.Database>) session.getDatabase("", "massive.nsf");
DocumentIterator<org.openntf.domino.Base<?>,org.openntf.domino.Document> it = (DocumentIterator<Base<?>, org.openntf.domino.Document>) database.getAllDocuments();
int i = 0;
while(it.hasNext()) {
Document<org.openntf.domino.Document> doc = it.next();
String counter = doc.getFieldAsString("counter");
if (++i % 250 == 0) {
System.out.println("=" + counter);
}
if (i > 5000) break;
}
System.out.println("Done");
River.closeSession(River.ORG_OPENNTF_DOMINO);
NotesThread.stermThread();
}
示例15: before
import lotus.domino.NotesThread; //导入依赖的package包/类
@BeforeClass
public static void before() {
NotesThread.sinitThread();
// River.setLevel(River.LOG_CORE, Level.FINE);
// River.setLevel(River.LOG_WRAPPER, Level.SEVERE);
// River.LOG_CORE.fine("Starting test");
}