Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JBoss/WildFly
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Jeanne Boyarsky
Tim Cooke
Sheriffs:
Liutauras Vilda
paul wheaton
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Carey Brown
Frits Walraven
Bartenders:
Piet Souris
Himai Minh
Forum:
JBoss/WildFly
Implementing Asynchronous Method
Praveen Reddy
Ranch Hand
Posts: 51
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I my Controller class I have a method which needs to be asynchronous can any one please guide me with proper example.
In project i am using Spring framework and
Jboss
server. We should not use threads in my project.
public Map<String, Object> initializeBypassMode( final RequestContext context) { Map<String, Object> model = new HashMap<String, Object>(); ServletExternalContext servletCtx = (ServletExternalContext) context.getExternalContext(); HttpServletRequest request = (HttpServletRequest) servletCtx.getNativeRequest(); // Performs some logic here [b]submitEloqua(request)[/b]; // Submiting below method need this method as Asynchronous method logger.debug("BypassModeController.submittedEloqua" + " Exit.."); return model; } // this method should be Asynchronous method private void submitEloqua(HttpServletRequest request) { try { String SignupForMarketing = "no"; String platformDevice = "laptop"; Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy hh:mm:ss"); String strCurDate = sdf.format(date); HashMap<String, String> formFieldNameValueCollection = new HashMap<String, String>(); formFieldNameValueCollection.put("FormID", "79"); formFieldNameValueCollection.put("EmailAddress", "testemail@testemail.com"); formFieldNameValueCollection.put("Opt-in", SignupForMarketing); formFieldNameValueCollection.put("TimeStamp", strCurDate); formFieldNameValueCollection.put("Platform", platformDevice); EloquaOpetation eloquaOperation = new EloquaOpetation(); // Below method is responsible to call a webservice call which return true or false there is no need to capture data boolean eloquaResult = insertEloquaOperation.insertQuery(entityFormName, entityFormType, formId, formFieldNameValueCollection); } } catch(Exception expection) { logger.info("Exception in submitEloqua: " + expection.getMessage()); } }
Thanks in Advance
Praveen
Kees Jan Koster
JavaMonitor Support
Posts: 251
5
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Uhm, put it on a JMS queue and process it in a message driven bean?
Java-monitor, JVM monitoring made easy
<- right here on Java Ranch
Praveen Reddy
Ranch Hand
Posts: 51
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Kees.
Can you please guide me with some examples as i don't have much knowledge on jboss message queue.
Thanks
Praveen
Kees Jan Koster
JavaMonitor Support
Posts: 251
5
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Google for "JMS Tutorial" and for "JBoss JMS Tutorial". I'm sure you'll find a lot of information.
Java-monitor, JVM monitoring made easy
<- right here on Java Ranch
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Null Pointer on sessionFactory.getCurrentSession
jsp /java i m not able to fine currect solutions
SimpleFormController ReferenceData not working
does not support command class
date comparison in struts
More...