Re: Is it possible for an inbound connector to invoke servlet?
wealther <[email protected]> Wed, 10 Dec 2008 10:35:22 +0800
| Newsgroups | gmane.comp.java.sun.connector,gmane.spam.detected |
|---|---|
| Message-ID | <14029917.100571228876522910.JavaMail.coremail@bj163app129.163.com> |
------=_Part_27447_4614644.1228876522909 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Simon J. Aquilina, It is very happy to talk with you. I think it is inpossible for the EIS to access the J2EE components(such as = a web component) through RA without MDB, because the inbound contracts is b= ased on MDB. It is asif the interactions between EIS and J2EE component is = asynchronous. You can find this information at http://java.sun.com/javaee/= 5/docs/tutorial/doc/bncjy.html . Please see the part inbound contracts.=20 "To enable external systems to connect to a Java EE application server, the= Connector architecture extends the capabilities of message-driven beans to= handle messages from any message provider." =20 I don't know if i am right, but anyway talking with you makes me happy and = benefit. good luck. =20 Best Regards, QiJun Yang =E5=9C=A82008-12-10=EF=BC=8C"Simon Aquilina" <[email protected]> =E5=86=99= =E9=81=93=EF=BC=9A Hi QiJun Yang, Thank you again for your reply. I have checked the j2ee tutorial as you sug= gested. If I use this method then I would implement that code within the Me= ssage Driven Bean (MDB) endpoint.=20 However I see only one problem with the above design. Like that my Resource= Adapter (RA) would call the MDB and the MDB would then call the Servlet. H= owever in the Java EE 5 Tutorial, Chapter 35, About Resource Adapters (http= ://java.sun.com/javaee/5/docs/tutorial/doc/bncjy.html) there is a diagram w= hich seems to indicate that the RA should be able to call the Web Component= s directly. Aren't servlets also Web Components? If yes then should't the R= A be able to invoke a servlet directly by using the MessageEndpointFactory,= with the difference that the Message Endpoint in this case would be the wa= nted servlet rather then an MDB. I do not know if my line of thought is cle= ar enough. If not please do not hesitate to tell me and I will try to rephr= ase :) I will also take your suggestion and ask the question about an Adapter on t= he apache forum to see what they say as well. Again thank you very much for= your interest and replies :) they are really apreciated. Best Regards, Simon J. Aquilina Date: Fri, 5 Dec 2008 14:03:09 +0800 From: [email protected] Subject: Re: Is it possible for an inbound connector to invoke servlet? To: [email protected] 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".=20 =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 =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 t= he body of the message "signoff CONNECTOR-INTEREST". For general help, send= email to [email protected] and include in the body of the message "hel= p". Invite your mail contacts to join your friends list with Windows Live Space= s. It's easy! Try it! =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_27447_4614644.1228876522909 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <DIV>Hi Simon J. Aquilina,</DIV> <DIV>It is very happy to talk with you.</DIV> <DIV>I think it is inpossible for the EIS to access the J2EE components(suc= h as a web component) through RA without MDB, because the inbound contracts= is based on MDB. It is asif the interactions between EIS and&nbs= p;J2EE component is asynchronous. You can find this information = at <A href=3D"http://java.sun.com/javaee/5/docs/tutorial/doc/bncjy.html">ht= tp://java.sun.com/javaee/5/docs/tutorial/doc/bncjy.html</A> . Please see th= e part inbound contracts. </DIV> <DIV>"To enable external systems to connect to a Java EE application server= , the Connector architecture extends the capabilities of message-driven bea= ns to handle messages from any message provider."</DIV> <DIV> </DIV> <DIV>I don't know if i am right, but anyway talking with you makes me happy= and benefit. good luck.</DIV> <DIV> </DIV> <DIV> Best Regards,</DIV> <DIV>QiJun Yang</DIV> <DIV></DIV><BR>=E5=9C=A82008-12-10=EF=BC=8C"Simon Aquilina" <sim085@HOTM= AIL.COM> =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 QiJun Yang,<BR><BR>Thank you = again for your reply. I have checked the j2ee tutorial as you suggested. If= I use this method then I would implement that code within the Message Driv= en Bean (MDB) endpoint. <BR><BR>However I see only one problem with the abo= ve design. Like that my Resource Adapter (RA) would call the MDB and the MD= B would then call the Servlet. However in the Java EE 5 Tutorial, Chapter 3= 5, About Resource Adapters (http://java.sun.com/javaee/5/docs/tutorial/doc/= bncjy.html) there is a diagram which seems to indicate that the RA should b= e able to call the Web Components directly. Aren't servlets also Web Compon= ents? If yes then should't the RA be able to invoke a servlet directly by u= sing the MessageEndpointFactory, with the difference that the Message Endpo= int in this case would be the wanted servlet rather then an MDB. I do not k= now if my line of thought is clear enough. If not please do not hesitate to= tell me and I will try to rephrase :)<BR><BR>I will also take your suggest= ion and ask the question about an Adapter on the apache forum to see what t= hey say as well. Again thank you very much for your interest and replies :)= they are really apreciated.<BR><BR>Best Regards,<BR>Simon J. Aquilina<BR><= BR> <HR id=3D"stopSpelling"> Date: Fri, 5 Dec 2008 14:03:09 +0800<BR>From: <A href=3D"mailto:wealther@16= 3.COM">[email protected]</A><BR>Subject: Re: Is it possible for an inbound c= onnector to invoke servlet?<BR>To: <A href=3D"mailto:CONNECTOR-INTEREST@JAV= A.SUN.COM">[email protected]</A><BR><BR> <DIV>i am sorry, i don't know jca too much.</DIV> <DIV>but i think the below code may be a little help to you.</DIV> <DIV> </DIV> <DIV> </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> public static void main(Stri= ng[] args) {<BR> String urlName =3D "<A href=3D"http://www.googl= e.com/">http://www.google.com</A>";<BR> if (args.length !=3D 0) = {<BR> urlName =3D args[0];<BR> }</DIV> <DIV> try {<BR> URL url =3D new URL(urlName);<B= R> URLConnection con =3D url.openConnection();<BR> &n= bsp; con.setDoInput(true);<BR> con.setDoOutput(true);= </DIV> <DIV> BufferedReader reader =3D new BufferedReader(new Inp= utStreamReader(<BR> con.getInputStream()));<BR= > System.out.println(reader.readLine());</DIV> <DIV> } catch (MalformedURLException e) {<BR> /= / TODO Auto-generated catch block<BR> e.printStackTrace();= <BR> } catch (IOException e) {<BR> // TODO Auto= -generated catch block<BR> e.printStackTrace();<BR> &= nbsp;}<BR> }<BR>}</DIV> <DIV> </DIV> <DIV>you can get 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" <<A href=3D"= mailto:[email protected]">[email protected]</A>> =E5=86=99=E9=81=93=EF= =BC=9A<BR> <BLOCKQUOTE id=3D"EC_isReplyContent" style=3D"PADDING-LEFT: 1ex; BORDER-LEF= T: rgb(204,204,204) 1px solid">Hi again,<BR><BR>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, George Tharakan, Sivakumar = Thyagarajan it is clear that a custom connector should be able to invoke a = deployed servlet.<BR><BR>Having said that I still cannot understand how thi= s can be done. In the document 'J2EE=E2=84=A2 Connector Architecture Specif= ication' there is a whole chapter on how to invoke an EJB (Chapter 13) howe= ver I cannot find anything about Servlet Invokation. I also downloaded the = Servlet Specification document but cannot really map the two together (prob= abbly due to my little knowledge about the subject). I have also checked ho= w the Http Connector of Tomcat works and here I found out that the Tomcat w= hen loaded the Http Connector will provide an Adapter in order to invoke Se= rvlets however do not know if this is also the case for a JEE Application S= erver, nor do I know if I have to set some extra configuration to have such= an object available.<BR><BR>Thanks and Regards,<BR>Simon J. Aquilina<BR><B= R> <HR id=3D"EC_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:"Calibri", sans-serif;} </STYLE> <P class=3D"EC_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 = connectors. From what I can understand an application server will start a R= esource Adapter (RA). Then when a Message Driven Bean (MDB) is deployed the= related RA are informed. The RA would then create an Endpoint Consumer. Wh= en a message is received from an EIS the Endpoint Consumer will call a meth= od from the MDB. <BR><BR>Now my plan was to develop something similar to th= e http protocol. The Enterprise Information System (EIS) makes a request, t= he request is processed, and a response is returned in XML (or format under= stood by the EIS). Because of this similarity I was wondering; Is it possib= le that an inbound connector invokes a deployed servlet? <BR><BR>Thanks and= Regards,<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&wx_url=3D/friends.aspx&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&mkt=3Den-US&form=3DQBRE">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 un= subscribe, send email to <A href=3D"mailto:[email protected]">listserv@= java.sun.com</A> and include in the body of the message "signoff CONNECTOR-= INTEREST". For general help, send email to <A href=3D"mailto:listserv@java.= sun.com">[email protected]</A> and include in the body of the message "= help". </BLOCKQUOTE><BR><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 <A= href=3D"mailto:[email protected]">[email protected]</A> and includ= e in the body of the message "signoff CONNECTOR-INTEREST". For general help= , send email to <A href=3D"mailto:[email protected]">[email protected].= com</A> and include in the body of the message "help".<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&wx_url=3D/friends.aspx&mkt=3Den-us" target=3D"_new">Try it!<= /A> </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_27447_4614644.1228876522909--