Note: Do not use NCSOW.jar in the classpath for executing remote (IIOP) calls in a WebSphere
®
environment. NCSOW.jar is no longer kitted as it was starting with Release 5.0.4. You can continue to run
programs that use NCSOW.jar on R5 servers, but not on Release 6 servers. The NCSO archives work with
both R5 and Release 6 servers.
Calling the lotus.domino package
The following guidelines apply to Java programs calling into the lotus.domino package:
v An application or servlet that makes local calls uses the NotesThread class, which extends
java.lang.Thread. You can extend NotesThread, implement the Runnable interface, or use the static
NotesThread methods sinitThread() and stermThread(). If you extend NotesThread, the entry point to
the functional code must be public void runNotes(). If you implement Runnable, the entry point must
be public void run(). If you use the static NotesThread methods, be sure to call stermThread exactly
one time for each call to sinitThread. An application that makes remote calls does not use the
NotesThread class. See the examples for clarification.
Each thread of an application making local calls must initialize a NotesThread object. This includes
AWT threads that access the Domino Objects. Listener threads must use the static methods because
they cannot inherit from NotesThread.
Memory management is a consideration for long running programs and programs that create a large
number of objects. See the recycle method and ″Multithreading issues″ under the NotesThread class.
v An agent extends the AgentBase class, which extends the NotesThread class. The class that contains the
agent code must be public. The entry point to the functional code must be public void NotesMain().
See the examples for clarification.
v An applet extends AppletBase and puts its functional code in the methods notesAppletInit(),
notesAppletStart(), and notesAppletStop(). You do not have to distinguish between local and remote
access in the main code. AppletBase makes local calls if the applet is running through the Notes client
and remote calls if it is running through a browser. Remote calls go to the Domino server on the
computer that loaded the applet.
If an applet creates a thread containing Domino calls, the thread code must use NotesThread for local
Domino calls but not remote (IIOP) calls. Use AppletBase.isLocal() to determine the environment. Use
NotesThread.sinitThread for initialization and NotesThread.stermThread for termination. Thread
creation includes handling AWT events.
See the examples for clarification.
For applets stored in a Domino database, ″Applet uses Notes CORBA classes″ under Java Applet - Java
Applet Properties must be checked.
v The Session class is the root of the Domino back-end object containment hierarchy. For applications
making local calls, use the method NotesFactory createSession(), createSessionWithFullAccess(),
createSession(null, null, String pwd), createSessionWithFullAccess(String pwd), createSession(null,
String user, String pwd), or createSession(null, ″″, ″″) to create a Session object. For applications making
remote calls, use the method createSession(String host, ″″, ″″) or createSession(String host, String user,
String pwd). For agents, use the method AgentBase.getSession(). For applets, use the method
AppletBase.openSession() or openSession(String user, String pwd) and closeSession(Session session).
See the examples for clarification.
The user and pwd parameters of NotesFactory.createSession and AppletBase.openSession must be a
user name and Internet password in the Domino Directory on the server being accessed. If a name and
password are not specified, anonymous access must be permitted by the server.
For Single Sign-on to a Domino or WebSphere server, use createSession(String host, String token),
createSession(String host, org.omg.SecurityLevel2.Credentials token), createSession(String host, null), or
createSession(String host, HttpServletRequest request).
Note: Single Sign-on is new with Release 5.0.5.
To enable SSL (Secure Sockets Layer), use NotesFactory.createSession(String host, String args[], String
user, String pwd) and specify ″-ORBEnableSSLSecurity″ for args(0).
Chapter 1. Java Classes Coding Guidelines 3