The next step in the process is to develop the server side of the application that will allow clients to read and update the Checking and Savings Account objects.
Bojangles implements the server side of the application as a Netscape servlet. Each Bojangles Netscape servlet starts an ORB that connects to a single hardcoded activation space. The ORB then handles client requests for objects registered in the associated activation space.
In the case of this tutorial, the AccountsServlet below allows clients access to the activation space denoted by the directory netscape\server\plugins\java\applets\accountsActivationSpace.
import COM.ibm.jaws.mofw.*; import COM.ibm.corba.CORBA; import COM.ibm.corba.ORB; import COM.ibm.corba.ServerORBlet; public class AccountsServlet extends netscape.server.applet.ServerApplet { public void run() throws Exception { try { String args[] = new String[3]; args[0] = "../../plugins/java/applets/accountsActivationSpace"; args[1] = null; args[2] = null; ORB orb = CORBA.ORB_init(args, "AccountsServletORB"); orb.run(getClientSocket()); } catch (Throwable e) { e.printStackTrace(); throw new Error(e.getMessage()); } } }
The parts of the servlet denoted in red are the only components that are specific to this tutorial.
Note that the AccountsServlet is not part of a package. This is because it must be located in the Netscape servlets directory, and thus cannot be contained in a typical package directory structure.
The activation space is specified as ../../plugins/java/applets/accountsActivationSpace because the servlet's working directory is always netscape/server/config/logs.