[JBoss Seam] - Re: The scope of Seam-managed Hibernate Session
by littlesuns
Thank you for your answer,Gavin.
if I hava a Seam component ActionA like that:
| @Scope(ScopeTypw.CONVERSATION)
| public class ActionA{
|
| //seam-managed hibernate session
| @In(create=true)
| private Session s;
|
| }
|
when we invoke a method of ActionA,there will be a Session s injected,but the managed Session has its own scope as a component,what I want to know is not when the Session inject,I want to know when the injected Session will be destryed,because the Session is controled by Seam and the Scope of Conversation is not a "Exact" concept,BTW,the managed session is a Converstaion Scope,it is mean that we will (or could) have many exist Sessions if every Action inject a hibernate Session,am I right?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978084#3978084
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978084
19 years, 8 months
[JBoss Seam] - Re: Seam Remoting und JMS Topic subscription questions.
by appendix
Hi, thanks for your reply!
I've tried to follow your hint, but somehow it seems that I cannot access the token after subscription to be able to write it to an input field.
The xhtml page is defined as following:
| <script type="text/javascript">
| //<![CDATA[
| Seam.Remoting.setDebug(true);
|
| function connect() {
| for (var i = 0; i < Seam.Remoting.subscriptionRegistry.length; i++){
| Seam.Remoting.log(Seam.Remoting.subscriptionRegistry.topic);
| }
| Seam.Remoting.subscribe("taskListTopic", channelMessageCallback);
| }
|
| Seam.Remoting.setPollTimeout(10);
| Seam.Remoting.setPollInterval(3);
| connect();
|
| function channelMessageCallback(message) {
| Seam.Remoting.log("msg.rcvd");
| window.location.href=window.location.href;
| }
| // ]]>
| </script>
| <!-- /Seam Remoting -->
|
| <f:view>
| <h2><h:outputText value="#{msgs['home.Title']}" /></h2>
| <!-- here follows the view [.. snipped .. ] -->
| </f:view>
|
| <script type="text/javascript">
| //<![CDATA[
| Seam.Remoting.log("Script at the bottom of page...");
|
| function fillTokenField(){
| Seam.Remoting.log("filling input field with token");
| var tokenField = document.getElementById('token');
| tokenField.value="somethg";
| Seam.Remoting.log(tokenField.value);
| for (var i = 0; i < Seam.Remoting.subscriptionRegistry.length; i++){
| Seam.Remoting.log(i+": "+Seam.Remoting.subscriptionRegistry.topic+": "+Seam.Remoting.subscriptionRegistry.token);
| }
| tokenField.value = Seam.Remoting.subscriptionRegistry[0].token;
| Seam.Remoting.log(tokenField.value);
| }
|
| fillTokenField();
| // ]]>
| </script>
|
After the page has been called, Seam log shows the following content:
| Fri Oct 13 2006 08:09:54 GMT+0200: Request packet:
| <envelope><body><subscribe topic="taskListTopic"/></body></envelope>
|
| Fri Oct 13 2006 08:09:54 GMT+0200: Script at the bottom of page...
|
| Fri Oct 13 2006 08:09:54 GMT+0200: filling input field with token
|
| Fri Oct 13 2006 08:09:54 GMT+0200: somethg
|
| Fri Oct 13 2006 08:09:54 GMT+0200: 0: taskListTopic: undefined
|
| Fri Oct 13 2006 08:09:54 GMT+0200: undefined
|
| Fri Oct 13 2006 08:09:54 GMT+0200: Response packet:
| <envelope><body><subscription topic="taskListTopic" token="ba340565-eeba-483f-9d10-9171e8fac57d"/></body></envelope>
|
| Fri Oct 13 2006 08:09:54 GMT+0200: Request packet:
| <envelope><body><poll token="ba340565-eeba-483f-9d10-9171e8fac57d" timeout="10"/></body></envelope>
|
The last two lines of the log are the first polling performed. But as seen, at the point where the subscription list is written to the log, the token for the current subscription is 'undefined'.
When is the token initialized?
Am I missing something obvious?
And just to make sure, I got you right, after I've written the token to an input field, I need to make sure this token is pushed into the subscriptionRegistry again after the page has reloaded.
After that I start the polling process with Seam.Remoting.poll(), right?
Thank you again,
Kurt
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978083#3978083
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978083
19 years, 8 months