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


Java NotesThread类代码示例

本文整理汇总了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);
}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:18,代码来源:BaseJNATestClass.java

示例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();
	}
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:21,代码来源:LotusNotesSessionTest.java

示例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();
	}
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:21,代码来源:LotusNotesSessionTest.java

示例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();
	}
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:21,代码来源:LotusNotesSessionTest.java

示例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");
	}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:17,代码来源:StressTest.java

示例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();
	}
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:21,代码来源:LotusNotesSessionTest.java

示例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;
}
 
开发者ID:jesse-gallagher,项目名称:xsp-groovy-shell,代码行数:12,代码来源:DominoGroovyThreadFactory.java

示例8: termNotes

import lotus.domino.NotesThread; //导入依赖的package包/类
@AfterClass
public static void termNotes() {
	if (m_notesInitExtendedCalled) {
		NotesInitUtils.notesTerm();
	}
	NotesThread.stermThread();
}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:8,代码来源:BaseJNATestClass.java

示例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();
}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:15,代码来源:BaseJNATestClass.java

示例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;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:12,代码来源:SessionFactory.java

示例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;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:12,代码来源:SessionFactory.java

示例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;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:11,代码来源:XSPUtils.java

示例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");
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:12,代码来源:StressTest.java

示例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();
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:29,代码来源:FactoryTest.java

示例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");
	}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:10,代码来源:DatabaseTest.java


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