Re: Is it possible for an inbound connector to invoke servlet?

wealther <[email protected]> Fri, 5 Dec 2008 14:03:09 +0800
Newsgroups gmane.comp.java.sun.connector,gmane.spam.detected
Message-ID <[email protected]>
------=_Part_41811_16473267.1228456989543
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

i am sorry, i don't know jca too much.
but i think the below code may be a little help to you.
=20
=20
package org.xfree.url;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
public class URLConnectionTest {
 public static void main(String[] args) {
  String urlName =3D "http://www.google.com";
  if (args.length !=3D 0) {
   urlName =3D args[0];
  }
  try {
   URL url =3D new URL(urlName);
   URLConnection con =3D url.openConnection();
   con.setDoInput(true);
   con.setDoOutput(true);
   BufferedReader reader =3D new BufferedReader(new InputStreamReader(
     con.getInputStream()));
   System.out.println(reader.readLine());
  } catch (MalformedURLException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
 }
}
=20
you can get more information at http://java.sun.com/j2se/1.4.2/docs/api/jav=
a/net/URLConnection.html.

Yours sincerely,
QiJun Yang

=E5=9C=A82008-12-04=EF=BC=8C"Simon Aquilina" <[email protected]> =E5=86=99=
=E9=81=93=EF=BC=9A
Hi again,

Since I did not receive any reply I thought to send another email with the =
additional re-search I did. Basically from the diagram on slide five (5) of=
 the presentation 'Java=E2=84=A2 EE Connectors Demystified' by Binod P.G, G=
eorge Tharakan, Sivakumar Thyagarajan it is clear that a custom connector s=
hould be able to invoke a deployed servlet.

Having said that I still cannot understand how this can be done. In the doc=
ument 'J2EE=E2=84=A2 Connector Architecture Specification' there is a whole=
 chapter on how to invoke an EJB (Chapter 13) however I cannot find anythin=
g about Servlet Invokation. I also downloaded the Servlet Specification doc=
ument but cannot really map the two together (probabbly due to my little kn=
owledge about the subject). I have also checked how the Http Connector of T=
omcat works and here I found out that the Tomcat when loaded the Http Conne=
ctor will provide an Adapter in order to invoke Servlets however do not kno=
w if this is also the case for a JEE Application Server, nor do I know if I=
 have to set some extra configuration to have such an object available.

Thanks and Regards,
Simon J. Aquilina


From: [email protected]
To: [email protected]
Subject: Is it possible for an inbound connector to invoke servlet?
Date: Mon, 1 Dec 2008 21:00:10 +0100



Hi,

I am not sure if this is the right place to ask this question. My question =
is related to inbound connectors. From what I can understand an application=
 server will start a Resource Adapter (RA). Then when a Message Driven Bean=
 (MDB) is deployed the related RA are informed. The RA would then create an=
 Endpoint Consumer. When a message is received from an EIS the Endpoint Con=
sumer will call a method from the MDB.=20

Now my plan was to develop something similar to the http protocol. The Ente=
rprise Information System (EIS) makes a request, the request is processed, =
and a response is returned in XML (or format understood by the EIS). Becaus=
e of this similarity I was wondering; Is it possible that an inbound connec=
tor invokes a deployed servlet?=20

Thanks and Regards,
Simon J.








Invite your mail contacts to join your friends list with Windows Live Space=
s. It's easy! Try it!

Discover the new Windows Vista Learn more! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D To unsubscribe, send email to=
 [email protected] and include in the body of the message "signoff CONN=
ECTOR-INTEREST". For general help, send email to [email protected] and =
include in the body of the message "help".

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff CONNECTOR-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".
------=_Part_41811_16473267.1228456989543
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<DIV>i am sorry, i don't know jca too much.</DIV>
<DIV>but i think the below code may be a little help&nbsp;to you.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>package org.xfree.url;</DIV>
<DIV>import java.io.BufferedReader;<BR>import java.io.IOException;<BR>impor=
t java.io.InputStreamReader;<BR>import java.net.MalformedURLException;<BR>i=
mport java.net.URL;<BR>import java.net.URLConnection;</DIV>
<DIV>public class URLConnectionTest {<BR>&nbsp;public static void main(Stri=
ng[] args) {<BR>&nbsp;&nbsp;String urlName =3D "<A href=3D"http://www.googl=
e.com">http://www.google.com</A>";<BR>&nbsp;&nbsp;if (args.length !=3D 0) {=
<BR>&nbsp;&nbsp;&nbsp;urlName =3D args[0];<BR>&nbsp;&nbsp;}</DIV>
<DIV>&nbsp;&nbsp;try {<BR>&nbsp;&nbsp;&nbsp;URL url =3D new URL(urlName);<B=
R>&nbsp;&nbsp;&nbsp;URLConnection con =3D url.openConnection();<BR>&nbsp;&n=
bsp;&nbsp;con.setDoInput(true);<BR>&nbsp;&nbsp;&nbsp;con.setDoOutput(true);=
</DIV>
<DIV>&nbsp;&nbsp;&nbsp;BufferedReader reader =3D new BufferedReader(new Inp=
utStreamReader(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;con.getInputStream()));<BR=
>&nbsp;&nbsp;&nbsp;System.out.println(reader.readLine());</DIV>
<DIV>&nbsp;&nbsp;} catch (MalformedURLException e) {<BR>&nbsp;&nbsp;&nbsp;/=
/ TODO Auto-generated catch block<BR>&nbsp;&nbsp;&nbsp;e.printStackTrace();=
<BR>&nbsp;&nbsp;} catch (IOException e) {<BR>&nbsp;&nbsp;&nbsp;// TODO Auto=
-generated catch block<BR>&nbsp;&nbsp;&nbsp;e.printStackTrace();<BR>&nbsp;&=
nbsp;}<BR>&nbsp;}<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>you can get&nbsp;more information at <A href=3D"http://java.sun.com/j2=
se/1.4.2/docs/api/java/net/URLConnection.html">http://java.sun.com/j2se/1.4=
.2/docs/api/java/net/URLConnection.html</A>.</DIV>
<DIV><BR>Yours sincerely,</DIV>
<DIV>QiJun Yang</DIV>
<DIV></DIV><BR>=E5=9C=A82008-12-04=EF=BC=8C"Simon Aquilina" &lt;sim085@HOTM=
AIL.COM&gt; =E5=86=99=E9=81=93=EF=BC=9A<BR>
<BLOCKQUOTE id=3D"isReplyContent" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0=
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi again,<BR><BR>Since I did not=
 receive any reply I thought to send another email with the additional re-s=
earch I did. Basically from the diagram on slide five (5) of the presentati=
on 'Java=E2=84=A2 EE Connectors Demystified' by Binod P.G, George Tharakan,=
 Sivakumar Thyagarajan it is clear that a custom connector should be able t=
o invoke a deployed servlet.<BR><BR>Having said that I still cannot underst=
and how this can be done. In the document 'J2EE=E2=84=A2 Connector Architec=
ture Specification' there is a whole chapter on how to invoke an EJB (Chapt=
er 13) however I cannot find anything about Servlet Invokation. I also down=
loaded the Servlet Specification document but cannot really map the two tog=
ether (probabbly due to my little knowledge about the subject). I have also=
 checked how the Http Connector of Tomcat works and here I found out that t=
he Tomcat when loaded the Http Connector will provide an Adapter in order t=
o invoke Servlets however do not know if this is also the case for a JEE Ap=
plication Server, nor do I know if I have to set some extra configuration t=
o have such an object available.<BR><BR>Thanks and Regards,<BR>Simon J. Aqu=
ilina<BR><BR>
<HR id=3D"stopSpelling">
From: <A href=3D"mailto:[email protected]">[email protected]</A><BR>To: <=
A href=3D"mailto:[email protected]">[email protected]=
un.com</A><BR>Subject: Is it possible for an inbound connector to invoke se=
rvlet?<BR>Date: Mon, 1 Dec 2008 21:00:10 +0100<BR><BR>
<STYLE>.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}</STYLE>

<STYLE>@page
{;}
.ExternalClass P
{margin-bottom:0.21cm;line-height:150%;text-align:justify;}
.ExternalClass P.EC_western
{font-family:&quot;Calibri&quot;, sans-serif;}</STYLE>

<P class=3D"EC_western" align=3D"left">Hi,<BR><BR>I am not sure if this is =
the right place to ask this question. My question is related to inbound con=
nectors. From what I can understand an application server will start a Reso=
urce Adapter (RA). Then when a Message Driven Bean (MDB) is deployed the re=
lated RA are informed. The RA would then create an Endpoint Consumer. When =
a message is received from an EIS the Endpoint Consumer will call a method =
from the MDB. <BR><BR>Now my plan was to develop something similar to the h=
ttp protocol. The Enterprise Information System (EIS) makes a request, the =
request is processed, and a response is returned in XML (or format understo=
od by the EIS). Because of this similarity I was wondering; Is it possible =
that an inbound connector invokes a deployed servlet? <BR><BR>Thanks and Re=
gards,<BR>Simon J.<BR><BR></P><BR><BR><BR><BR>
<HR>
Invite your mail contacts to join your friends list with Windows Live Space=
s. It's easy! <A href=3D"http://spaces.live.com/spacesapi.aspx?wx_action=3D=
create&amp;wx_url=3D/friends.aspx&amp;mkt=3Den-us">Try it!</A><BR>
<HR>
Discover the new Windows Vista <A href=3D"http://search.msn.com/results.asp=
x?q=3Dwindows+vista&amp;mkt=3Den-US&amp;form=3DQBRE" target=3D"_new">Learn =
more!</A> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D To unsubscribe, send email to <A href=3D"mailto:listserv@java.=
sun.com">[email protected]</A> and include in the body of the message "=
signoff CONNECTOR-INTEREST". For general help, send email to <A href=3D"mai=
lto:[email protected]">[email protected]</A> and include in the bod=
y of the message "help". </BLOCKQUOTE><br><!-- footer --><br><hr/>
<a href=3D"http://www.yeah.net">=E7=BD=91=E6=98=93=E5=85=8D=E8=B4=B9=E9=82=
=AE=EF=BC=8C=E5=85=A8=E7=90=83=E6=9C=80=E5=A4=A7=E7=9A=84=E4=B8=AD=E6=96=87=
=E5=85=8D=E8=B4=B9=E9=82=AE=E7=AE=B1</a>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff CONNECTOR-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".

------=_Part_41811_16473267.1228456989543--