[JBoss Seam] - Re: how to terminate @Asynchronous method
by gbc@gmx.de
Look deeper into 18.1.1:
anonymous wrote : The Timer object shown below is the EJB3 timer when you use the EJB3 dispatcher. For the default ScheduledThreadPoolExecutor, the returned object is Future from the JDK. For the Quartz dispatcher, it returns QuartzTriggerHandle, which we will discuss in the next section.
|
So you just need to declare your Method on the Interface to return this special object and implement it that way:
a) A Future object (with default scheduler, java.util.concurent i think):
| public Future odradi(@Expiration
| Date date, @IntervalCron
| Long interval,@FinalExpiration Date kraj) {
| return whatever; // will be ignored
| }
|
b) acoording to this a Timer object for EJB3 (javax.ejb i think)Timers or
c) a QuartzTriggerHandle object
You will receive this object immidiatly and may sace it into Context, a map in an Application scoped manager or whereever. With this Object you are able to stop the timed call (I'm working with quartz and it just works)
Hope this is what helps you out,
Greetz GHad
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4086320#4086320
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4086320
18 years, 10 months
[JBoss Seam] - Conversation related error (UnsupportedOperationException)
by rlao
I hope someone may be able to point me to the right direction to resolve this problem. I am getting the following error
Caused by: java.lang.UnsupportedOperationException
at java.util.Collections$UnmodifiableList.set(Collections.java:1157)
at org.jboss.seam.core.Manager.updateCurrentConversationId(Manager.java:112)
at org.jboss.seam.interceptors.ConversationInterceptor.redirectToExistingConversation(ConversationInterceptor.java:83)
at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:46)
The application normally requires an user to login. After logging in, it takes the user to the Main screen, from there, user can search for items then clicks on an item to launch a Detail screen of that item. There is a conversation established so additional clicking on the Main page for the same item would go to the same Detail page. We want to be able to give the Detail page URL to another person so they can see this page.
I reworked the detail page so it can take parameters from URL and launched it into the correct information. I also assigned a different conversation id with its begin method. Everything works (if the user is already signed on) except when the signon redirect is put in place. When someone gets the link and if he/she is not logged in, it would first re-direct it to a signon page before proceeding to the Detail page. However, after it logs in, it would set the necessary parameters in the Detail Page but never got to the begin method (specified by action). The error I saw was UnsupportedOperationException as stated above. It seems to try to set a conversation id in a list which is not modifiable. Welcome any suggestions.
Thanks
Ralph
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4086319#4086319
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4086319
18 years, 10 months