Domino Java Agent学习笔记

1.在Java中调用domino对象需要

import lotus.domino.*;

2.Java程序可以是application,domino agent,applet,servlet

3.Notes7.0最高支持jdk1.4.2

4.用到的jar包Notes.jar, NCSO.jar, domtags.jar

5.服务器需要开启CORBA-based remote (IIOP),服务器的http和diiop服务必须开启,可在notes.ini中查看ServerTasks=<any other tasks>,http,diiop

6.Java的堆栈内存不能小于64M,不然在访问nhttp.exe时会出错,如果notes.ini中没设置,默认为64M

7.需要配置服务器文档
1).端口—Internet端口---DIIOP 可以设置domino iiop远程访问的权限
2).Internet协议—DIIOP可以设置多线程
3).安全性---编程限制 可以设置运行java agent的权限

8.更新了服务器iiop配置可以通过tell diiop refresh来更新

9.对于独立的应用程序需要设置

set CLASSPATH=.;c: otesdatadominojavaNCSO.jar;c: otesNotes.jar

1).Notes.jar提供了本地调用domino对象的包
2).NCSO.jar提供了远程调用domino对象的包 和 cso 的包
3).NCSO.jar和NCSO.cab基本一样,就是压缩格式不同

10.运行环境的要求
1).本地application 需要domino server , domino designer or Notes client , Notes.jar in classpath
2).远程application 需要 NCSO , NCSO in classpath
3).Domino agent 需要 Notes.jar in classpath
4).applet 需要 domino server

11.本地访问可以通过NotesThread class public void runNotes()
扩展方法1. Runnable public void run()
扩展方法2. sinitThread()
扩展方法3. stermThread() 静态线程

12.内存管理可以通过NotesThread class 中的 recycle 方法 和多线程

13.java agent 继承 AgentBase class 继承 NotesThread class public void NotesMain()

14.applet 继承 AppletBase 方法有 notesAppletInit() notesAppletStart() 和 notesAppletStop() 要访问domino线程需要NotesThread 可以用 AppletBase.isLocal()判断是本地的还是远程的,通过NotesThread.sinitThread 初始化线程,NotesThread.stermThread 中止线程

15.session类在java中的初始化

1).application local

NotesFactory createSession(),
createSessionWithFullAccess(),
createSession(null, null, String pwd),
createSessionWithFullAccess(String pwd), 
createSession(null, String user, String pwd), or createSession(null, "", "")

2).application remote

createSession(String host, "", "") or createSession(String host, String user, String pwd)

3).agents

AgentBase.getSession()

4).applets

AppletBase.openSession() or openSession(String user, String pwd) and closeSession(Session session)

注: 其中的 user 和 pwd 为id 名称 和 Internet密码

5).SSL

NotesFactory.createSession(String host, String args[], String user, String pwd) and specify "-ORBEnableSSLSecurity" for args(0)

6).Sign-on

createSession(String host, String token), 
createSession(String host, org.omg.SecurityLevel2.Credentials token), createSession(String host, null), or createSession(String host, HttpServletRequest request)

16.Debug 在前端运行代理System.out 和 System.err 信息显示在 Java 控制台
对于本地的定时代理,信息显示在Domino log

17.要把代理信息打印到浏览器上,需要java.io.PrintWriter中的getAgentOutput() PrintWriter object中的println

18.Eclipse远程访问时报错Exception in thread "main"

java.lang.UnsatisfiedLinkError: no nlsxbe in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at lotus.notes.NotesThread.load(Unknown Source)
at lotus.notes.NotesThread.<clinit>(Unknown Source)
at lotus.test.AccessDomino.main(AccessDomino.java:16)

解决方法:在系统变量path中添加notes目录

19.推荐用IOR的方式访问Domino服务器,其它方式可能需要服务器设置为匿名访问,用IOR匿名和不允许匿名都可以, 通过

String Ior=NotesFactory.getIOR("127.0.0.1","admin","password");

首先取到Ior;服务器名根据你的 实际情况填写,用户名和密码是登录internet的用户名和密码,如果是匿名可以不写,创建Session对象

localSession = NotesFactory.createSessionWithIOR(Ior,"admin","password");

然后就可以多数据库进行操作了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,127评论 19 139
  • 小编费力收集:给你想要的面试集合 1.C++或Java中的异常处理机制的简单原理和应用。 当JAVA程序违反了JA...
    八爷君阅读 4,696评论 1 114
  • 1. Java基础部分 基础部分的顺序:基本语法,类相关的语法,内部类的语法,继承相关的语法,异常的语法,线程的语...
    子非鱼_t_阅读 31,805评论 18 399
  • 我在我姨妈家和我姐还有我、连星皓还有姨爸在做饭。 首先我和啦连星皓剥葱剥蒜。我剥蒜、连星皓剥葱。连...
    相怡希123阅读 186评论 1 2
  • 他温暖的用臂保护了我,还有稍显羞涩的脸庞,富有深意的笑,轻柔的“别”,梦醒,从无比遥远的幻想国度游赏一番跌落...
    俗人轮子阅读 366评论 0 0