RavenclawDev: java galaxy server
Svetlana Stenchikova
sveta at cs.sunysb.edu
Tue Sep 26 17:17:01 EDT 2006
Hi, I am writing a java backend server (using Jason as a sample java
server)
So, as I understand, to write a java server I just need to
1. extend galaxy.server.Server
2. start the MainServer from main() of my program
3. set the class name mainServer.setServerClassName("java_be");
4. declare public GFrame serverOp<name of operation>(GFrame f) for
all commands that my server accepts.
Thomas, in Jason there is also a functions: requestInitSession() which
is called from startConversation()
This is necessary for Jason because it is an initiator of a message,
right? The backend server will be a receiver of the messages.
So, now I have a question of how to send a message from the dialog manager
to the backend server.
In RoomLine it is done from an execute agent using a launch_query:
DEFINE_EXECUTE_AGENT( CDBGetEvents,
CALL("gal_be.launch_query query=get_events <event_query
results>eventlistresult error>backend_error")
)
If my server name is java_be (specified in mainServer.setServerClassName)
And I have defined a method
public GFrame serverOpTest(GFrame f) {
System.err.println("Java backend was called!!!");
return (GFrame) null;
}
Now, if I call from the Dialog manager Execute agent:
DEFINE_EXECUTE_AGENT( CDBGetEvents,
CALL("java_be.Test ")
)
The ServerOpTest() should get executed, is this correct?
I want to make sure that my java backend server receives a call.
The ServerOpTest() method prints to standard error. I got nothing in the
window where the server was started. Does the stderr output go somewhere
else from the backend server? My DM output has:
[COR at 16:51:16.934] Executing dialog agent /RavenCalendar/TestCallBackend
...
[TMS at 16:51:16.935] Preparing external server call...
[TMS at 16:51:16.935] Calling galaxy server java_be.Test.
[TMD at 16:51:16.936] Calling galaxy server java_be.Test. Call frame dumped
below.
{
query test_query
}
[TMS at 16:51:16.939] Galaxy server call complete.
[TMD at 16:51:16.939] Galaxy server call results dumped below.
[ERR at 16:51:16.939] Cannot parse result from java_be.Test. Does not start
with {
<file c:\documents and settings\sveta\my
documents\work\calendar\ravencalendar\l
ibraries\ravenclaw\dmcore\agents\coreagents\trafficmanageragent.cpp, line
171>.
Since I got no output in the java_be server window, I am not sure if my
server was actually accessed.
Could you please make any suggestions on how to proceed?
Thank you
**************************************************
my main() is:
public static void main(String[] args) throws
java.io.FileNotFoundException, java.io.IOException, java.lang.Exception {
MainServer mainServer = new MainServer("java_be", args);
mainServer.setServerClassName("GoogleConnect");
try {
mainServer.start();
} catch(Exception e) {
System.err.println(e.toString());
}
}
---------------------------------------------------------
Svetlana Stenchikova, Ph.D. Candidate
Computer Science Department, Stony Brook University
http://cs.sunysb.edu/~sveta
sveta at cs.sunysb.edu
---------------------------------------------------------
More information about the Ravenclaw-developers
mailing list