Compiling and Deploying Service Agents
To show how agents are compiled and deployed for use together with SAGS Personal Agent Server, we will create an agent based on one of the samples shown in the tutorial sections. Start JBuilder and create a new project, called SampleAgent. Click the Finish button.
The service agent will be included in a package, which will be now created. Right-click the
For this sample, write your name as the package name, then click OK.
We will now create the class that will hold our service agent, class contained in this package. For this, right-click on the previously created package, select New and then Class.
To be in agreement with the source code of the tutorial we are going to use, write "Sample10_ServiceAgents" in the Class Name text box, then click OK.
Replace the code that was automatically generated by JBuilder with the one given in the Creating Service Agents: the basics tutorial, then declare the package containing the class at the beginning on the file using the "package" keyword, followed by the package name.
Now compile the project by selecting the "Make Project ... " option from the Project menu.
If all went OK, confirmation that the project was compiled should appear in the lower-left corner, as in the image below.
Now that the agent has been compiled, we need to copy it in the Service Agent folder of the SAGS Personal Agent Server, so that it can be found on the next server restart. Go in the folder where the project was saved and enter the "classes" sub-folder. There you should see another folder with the name of the package (your name).
To see that the compiled agent is indeed here, enter the package folder. You should see a file having the name of the the agent class and the .class extension.
Now it's time to deploy the agent by moving it to the server's agent folder. Open the SAGS Personal Server agent folder by selecting the "Agent Folder" from SAGS Personal Agent Server's program group (Start -> Program Files -> SAGS Personal Agent Server -> Agent Folder). Then copy the package folder here.
Now start the server. If the server was already running, close it and restart it. The agent should be now register with the server. To check that, start the MADS Agent Browser utility and search the word "sample". The result should look like in the image below.