Server Entity Module


A Server Entity Module is a Java class that is made to execute some command, logic, database access or any other server-side process. It is only used for non-visual classes. Server Entity Modules are similar to Enterprise Java Session Beans but allow you to more easily build a process that will work with the BulletProof Enterprise Management Server.

Choose this type if you wish to take advantage of the extended features of the Enterprise Management Server such as Job logging and access to the Server internals. The main difference between an Entity and a Session is that the Entity module remains active on the server for other processes to interact with it. If you do not require the process to remain active you should create a Server Session Module.

The Application Builder will create a new module for you using an Entity template. This new module consists of declarations of global variables for accessing a database (jaggSQL), the handle to the current job for doing such things are writing to the job log (thisJob) and a handle to the Server Manager (manager) for doing such things as getting handles to other jobs, submitting jobs or retrieving other information about the server.

The module also has a single constructor declared that can be used when starting this module on the server. The server will pass the handle to the manager and job using the parameters of the constructor. Do not remove these parameters from the constructor if you wish to access these global handles.

If you look at the source for the constructor you will see that it has comments telling you where to place calls to the methods you create. It also has a try-catch construct which will catch any exceptions and write them to the job log using the logException method of the thisJob handle. You can also write to the job log using the appendJobLog(String) method of the thisJob variable. Notice that it also has a while loop that will continually loop with a 10 second delay until the Enterprise Server shuts down. You can change the delay, modify the conditions under which this process terminates and insert calls to methods that will happen at the delay interval.

By creating your own accessor methods and by using the light weight RMI that is provided by the JDPRMIConnection class you can create client and server apps that can communicate with this module when it is running on the server. For examples of Entity modules see the examples in the Applications\Examples\_ServerSide directory.