Ok, one application for the servlet/thread scenario. You can use your servlet for init of the non-HTTP server on any free port on your system. The servlet serves as main entry point whose only purpose is to return the port number of your non-HTTP thread. The servlet url is constant, the non-Http server port number must not be constant.
Scenario: 1.Your non-HTTP server my be a CORBA-Server which listens on a special url an hosts several server objects. 2.Then you can ask each CORBA server object to give it's IOR as string by invoking object_to_string method (is this current corba anymore????). 3.Build a name -> string-IOR mapping in your servlet (use application scope object) 4.A client uses the servlet as naming service by sending the name of the target object as request parameter and expecting the string-IOR as response. 5.After receiving the string-IOR the client-server communictaion is done via CORBA. 6.Problem with this scenario is the class distribution of stubs an skeletons used by CORBA. You can circumvent the problem with a url-classloader, but then you might get into trouble with security issues. Peter Huber souravm wrote: > Hi Peter, > > Thanks for your reply. > > Here I elaborate my doubt a little more. > Say I have a Java Class which implements a non-HTTP server. > a)I can use this class in a thread and make a non-HTTP server listening > to a particular port. > b)The same thing I can do by creating a thread from the init method of a > Servlet as it is shown in example 10-8 of Java Servlet Programmimng book > of Jason Hunter. > I want to know is there any specific advantage if I initiate the > non-HTTP server as it is in case b) ? > > Regards, > Sourav > > -----Original Message----- > From: Peter Huber [mailto:[EMAIL PROTECTED]] > Sent: Friday, November 02, 2001 4:50 PM > To: [EMAIL PROTECTED] > Subject: Re: Servlet to Servlet communication > > From programmers point of view: > > James Wilson wrote: > > > I have to senerios in mind -- what do you > > guys think? > > > > Case 1: > > You have a servlet engine on box A and > > a servlet engine on box B. Then you create > > a HTTP POST/GET connection from box A to box B. > > You must provide de/marshalling of requests/responses on your own with > all > implications. > => You have to create your own framwork apart from your intended > functionality. > > => More work compared to case 2 > > > > > > > Case 2: > > You have a servlet engine on box A and > > a RMI server on box B. Then you communicate > > from the box A to the RMI server via RMI. > > > > You simply define a interface, and then program your client/server > functionality against this interface > Because de/marshalling stubs and skeletons are tool generated, you only > program > functionality. > => Less work compared to case 1 > > BTW: You may use soap as third alternative. But soap was designed for > web > services and that should be kept in mind. > > Peter Huber > (IT Consultant) > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > Gauss Interprise Consulting AG > Gesch�ftsstelle M�nchen > Witneystr.1 > D-82008 Unterhaching > Telefon: +49-89-66561 - 128 > Fax: +49-89-66561 - 199 > e-mail: mailto:[EMAIL PROTECTED] > Germany Web: http://www.gi-consulting.de > > ________________________________________________________________________ > ___ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the > body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html -- Peter Huber (IT Consultant) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Gauss Interprise Consulting AG Gesch�ftsstelle M�nchen Witneystr.1 D-82008 Unterhaching Telefon: +49-89-66561 - 128 Fax: +49-89-66561 - 199 e-mail: mailto:[EMAIL PROTECTED] Germany Web: http://www.gi-consulting.de ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
