changing TcpServerEndpoint to HttpServerEndpoint
Patrick Dowler <[email protected]>
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Organization | National Research Council Canada |
| Message-ID | <[email protected]> |
I have an application (deployed via webstart) that communicates with my server
via RMI (jeri). The server is deployed in tomcat as a servlet (a URL to get
the exported proxy) and a JSP page to dynamically generate the JNLP to
launch. I currently use TcpServerEndpoint to export, as follows:
this.exporter = new BasicJeriExporter(
TcpServerEndpoint.getInstance(host, port), new BasicILFactory() );
this.impl = new FooImpl(....);
FooService proxy = (FooService) exporter.export(impl);
ByteArrayOutputStream bs = new ByteArrayOutputStream();
ObjectOutputStream ostream = new ObjectOutputStream(bs);
ostream.writeObject(proxy);
ostream.flush();
ostream.close();
proxyBytes = bs.toByteArray();
Later, when the app is launched, it opens http://$host/path/to/getProxy which
just writes proxyBytes to the output stream, and the client turns that back
into an object and casts it to FooService.
All that works fine, except that I currently use port 9000 and some users run
into trouble because some paranoid (IMO) network admin blocks outgoing tcp
connections on all ports by default, only opening the ones they know about.
So, I would like to use HttpServerEndpoint and pass all the packets on port
80, except apache runs on 80. Apache passes some http requests on to tomcat
(using mod_rewrite proxying) but I cannot see how to setup the
HttpServerEndpoint. Can it have a path in the http header? ivoke a servlet?
doPost method passes bytes to jeri? Am I crazy? I really just want RMI and
use jeri so I do not need an rmi registry.
Ideas?
--
Patrick Dowler
Tel/Tél: (250) 363-6914 | fax/télécopieur: (250) 363-0045
Canadian Astronomy Data Centre | Centre canadien de donnees astronomiques
National Research Council Canada | Conseil national de recherches Canada
Government of Canada | Gouvernement du Canada
5071 West Saanich Road | 5071, chemin West Saanich
Victoria, BC | Victoria (C.-B.)
--------------------------------------------------------------------------
Getting Started: http://www.jini.org/wiki/Category:Getting_Started
Community Web Site: http://jini.org
jini-users Archive: http://archives.java.sun.com/archives/jini-users.html
Unsubscribing: email "signoff JINI-USERS" to [email protected]