Execute andwait

S
Seo TraineeSEO Trainee à ApexTgi Pvt. Ltd
Struts Framework 
ExecuteAndWait Interceptor 
Introduction 
Apex T. G. India Pvt. Ltd
1 
execAndWait 
 The ExecuteAndWaitInterceptor is used for running long-lived 
actions in the background while showing the user a 
progress meter(loader image using JavaScript) . 
 This also prevents the HTTP request from timing out when 
the action takes more than 5 or 10 minutes.
1 
execAndWait 
 Using this interceptor is pretty straight forward. 
 Assuming that you are including struts-default.xml, and this 
interceptor is already configured but is not part of any of the 
default stacks then it wont work. 
 Because of the nature of this interceptor, it must be 
the last interceptor in the stack.
1 
execAndWait 
 This interceptor works on a per-session basis. 
 It means, same action name ( DemoAction.class ) cannot be 
run more than once at a time in a given session. On the 
initial request or any subsequent requests (before the action 
has completed), the wait result will be returned. 
 The wait result is responsible for issuing a subsequent 
request back to the action, giving the effect of a self-updating 
progress meter.
1 
execAndWait 
 If no "wait" result is found, Struts will automatically 
generate a wait result on the fly. 
 But this result is written in FreeMarker and cannot run 
unless FreeMarker is installed. 
 If you don't want to use it with FreeMarker then must 
provide a wait page as a result.
1 
execAndWait 
 Whenever the wait result is returned, the action that is 
currently running in the background will be placed on top of 
the stack. 
 This allows you to display progress data, such as a count, in 
the wait page. By making the wait page automatically reload 
the request to the action (which will be short-circuited by 
the interceptor), can give the appearance of an automatic 
progress meter.
1 
execAndWait 
 Whenever the wait result is returned, the action that is 
currently running in the background will be placed on top of 
the stack. 
 This allows you to display progress data, such as a count, in 
the wait page. By making the wait page automatically reload 
the request to the action (which will be short-circuited by 
the interceptor), can give the appearance of an automatic 
progress meter.
1 
execAndWait 
 This interceptor also supports using an initial wait delay. An 
initial delay is a time in milliseconds let the server wait 
before the wait page is shown to the user. 
 During the wait this interceptor will wake every 100 milii 
second to check if the background process is done 
premature, thus if the job for some reason doesn't take to 
long the wait page is not shown to the user.
1 
execAndWait 
 This is useful for e.g. search actions that have a wide span of 
execution time. Using a delay time of 2000 millis we ensure 
the user is presented fast search results immediately and for 
the slow results a wait page is used. 
 Important: Because the action will be running in a separate 
thread, We can't use ActionContext because it is a 
ThreadLocal.
1 
execAndWait 
 The thread kicked off by this interceptor will be named in 
the form actionNameBackgroundProcess. 
 This means if we need to access session data, we need to 
implement SessionAware rather than calling 
ActionContext.getSession().
1 
execAndWait 
 Parameters:threadPriority (optional) - the priority to 
assign the thread. Default is Thread.NORM_PRIORITY. 
 delay (optional) - an initial delay in millis to wait before the 
wait page is shown (returning wait as result code). Default is 
no initial delay. 
 delaySleepInterval (optional) - only used with delay. Used 
for waking up at certain intervals to check if the background 
process is already done. Default is 100 millis.
1 
execAndWait 
<action name=“abc" class="com.abc.DemoAction 
<interceptor-ref name="execAndWait"/> 
<result name="wait">wait.jsp</result> 
<result name="success">success.jsp</result> 
</action>
Thanks 
Stay Connected with us for more chapters on JAVA 
facebook.com/apex.tgi 
twitter.com/ApextgiNoida 
pinterest.com/apextgi
1 sur 13

Recommandé

Productionizing spark par
Productionizing sparkProductionizing spark
Productionizing sparkSigmoid
627 vues12 diapositives
Effective java item 80 prefer executors, tasks, and streams to threads par
Effective java   item 80  prefer executors, tasks, and  streams to threadsEffective java   item 80  prefer executors, tasks, and  streams to threads
Effective java item 80 prefer executors, tasks, and streams to threadsIsaac Liao
186 vues15 diapositives
Java threads par
Java threadsJava threads
Java threadsjavaicon
276 vues19 diapositives
Async Web QA par
Async Web QAAsync Web QA
Async Web QAVlad Maniak
175 vues14 diapositives
Retrofit caching V1.9.0 - Android OkClient par
Retrofit caching V1.9.0 - Android OkClientRetrofit caching V1.9.0 - Android OkClient
Retrofit caching V1.9.0 - Android OkClientMathan Raj
496 vues9 diapositives
Puppet At Twitter - Puppet Camp Silicon Valley par
Puppet At Twitter - Puppet Camp Silicon ValleyPuppet At Twitter - Puppet Camp Silicon Valley
Puppet At Twitter - Puppet Camp Silicon ValleyPuppet
1.8K vues36 diapositives

Contenu connexe

Tendances

Asynchronous programming in .net 4.5 with c# par
Asynchronous programming in .net 4.5 with c#Asynchronous programming in .net 4.5 with c#
Asynchronous programming in .net 4.5 with c#Binu Bhasuran
3.9K vues57 diapositives
Java concurrency in practice par
Java concurrency in practiceJava concurrency in practice
Java concurrency in practiceMikalai Alimenkou
12.4K vues53 diapositives
Introduction+To+Java+Concurrency par
Introduction+To+Java+ConcurrencyIntroduction+To+Java+Concurrency
Introduction+To+Java+ConcurrencyKing's College London
625 vues25 diapositives
Command pattern in java par
Command pattern in javaCommand pattern in java
Command pattern in javaRakibAhmed0
147 vues6 diapositives
How to debug systemd problems fedora project par
How to debug systemd problems   fedora projectHow to debug systemd problems   fedora project
How to debug systemd problems fedora projectSusant Sahani
890 vues2 diapositives
Salesforce interview questions on trigger par
Salesforce interview questions on triggerSalesforce interview questions on trigger
Salesforce interview questions on triggerSumit Datta
2K vues3 diapositives

Tendances(12)

Asynchronous programming in .net 4.5 with c# par Binu Bhasuran
Asynchronous programming in .net 4.5 with c#Asynchronous programming in .net 4.5 with c#
Asynchronous programming in .net 4.5 with c#
Binu Bhasuran3.9K vues
Command pattern in java par RakibAhmed0
Command pattern in javaCommand pattern in java
Command pattern in java
RakibAhmed0147 vues
How to debug systemd problems fedora project par Susant Sahani
How to debug systemd problems   fedora projectHow to debug systemd problems   fedora project
How to debug systemd problems fedora project
Susant Sahani890 vues
Salesforce interview questions on trigger par Sumit Datta
Salesforce interview questions on triggerSalesforce interview questions on trigger
Salesforce interview questions on trigger
Sumit Datta2K vues
React js use contexts and useContext hook par Piyush Jamwal
React js use contexts and useContext hookReact js use contexts and useContext hook
React js use contexts and useContext hook
Piyush Jamwal232 vues
salesforce triggers interview questions and answers par bhanuadmob
salesforce triggers interview questions and answerssalesforce triggers interview questions and answers
salesforce triggers interview questions and answers
bhanuadmob288 vues
Martin Anderson - threads v actors par bloodredsun
Martin Anderson - threads v actorsMartin Anderson - threads v actors
Martin Anderson - threads v actors
bloodredsun2.1K vues
Creating custom transformer par Rahul Kumar
Creating custom transformerCreating custom transformer
Creating custom transformer
Rahul Kumar213 vues
Design patterns - Singleton&Command par Kai Aras
Design patterns - Singleton&CommandDesign patterns - Singleton&Command
Design patterns - Singleton&Command
Kai Aras1.9K vues

En vedette

ExecuteAndWait Interceptor par
ExecuteAndWait InterceptorExecuteAndWait Interceptor
ExecuteAndWait InterceptorSeo Trainee
240 vues13 diapositives
Prepositions par
PrepositionsPrepositions
PrepositionsClemente17
188 vues12 diapositives
Networking overview par
Networking overviewNetworking overview
Networking overviewSeo Trainee
181 vues9 diapositives
Nouns par
NounsNouns
NounsClemente17
135 vues6 diapositives
Networking overview par
Networking overviewNetworking overview
Networking overviewSeo Trainee
110 vues9 diapositives
Networking overview part.2 par
Networking overview part.2Networking overview part.2
Networking overview part.2Seo Trainee
147 vues9 diapositives

En vedette(16)

ExecuteAndWait Interceptor par Seo Trainee
ExecuteAndWait InterceptorExecuteAndWait Interceptor
ExecuteAndWait Interceptor
Seo Trainee240 vues
Networking overview part.2 par Seo Trainee
Networking overview part.2Networking overview part.2
Networking overview part.2
Seo Trainee147 vues
Opposites- Exploration Presentation par Clemente17
Opposites- Exploration PresentationOpposites- Exploration Presentation
Opposites- Exploration Presentation
Clemente17301 vues
Hair-Pelitos by Sandra Cisneros- Vocabulary par Clemente17
Hair-Pelitos by Sandra Cisneros- VocabularyHair-Pelitos by Sandra Cisneros- Vocabulary
Hair-Pelitos by Sandra Cisneros- Vocabulary
Clemente17416 vues
Te doy mil gracias par Clemente17
Te doy mil graciasTe doy mil gracias
Te doy mil gracias
Clemente17376 vues
determine the extent to which wars in afric are a resultof economic reasons par Ross Phiri
determine the extent to which wars in afric are a resultof economic reasonsdetermine the extent to which wars in afric are a resultof economic reasons
determine the extent to which wars in afric are a resultof economic reasons
Ross Phiri381 vues
The Boy who Cried Wolf par Clemente17
The Boy who Cried WolfThe Boy who Cried Wolf
The Boy who Cried Wolf
Clemente17691 vues

Similaire à Execute andwait

Performance Test Plan - Sample 1 par
Performance Test Plan - Sample 1Performance Test Plan - Sample 1
Performance Test Plan - Sample 1Atul Pant
12.2K vues10 diapositives
What is the difference between struts 1 vs struts 2 par
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2Santosh Singh Paliwal
2.4K vues14 diapositives
Servlets - filter, listeners, wrapper, internationalization par
Servlets -  filter, listeners, wrapper, internationalizationServlets -  filter, listeners, wrapper, internationalization
Servlets - filter, listeners, wrapper, internationalizationsusant sahu
6.2K vues41 diapositives
Tech talk par
Tech talkTech talk
Tech talkPreeti Patwa
291 vues46 diapositives
Sagas Middleware Architecture par
Sagas Middleware ArchitectureSagas Middleware Architecture
Sagas Middleware ArchitectureMateusz Bosek
135 vues22 diapositives
Java util concurrent par
Java util concurrentJava util concurrent
Java util concurrentRoger Xia
2.3K vues62 diapositives

Similaire à Execute andwait(20)

Performance Test Plan - Sample 1 par Atul Pant
Performance Test Plan - Sample 1Performance Test Plan - Sample 1
Performance Test Plan - Sample 1
Atul Pant12.2K vues
Servlets - filter, listeners, wrapper, internationalization par susant sahu
Servlets -  filter, listeners, wrapper, internationalizationServlets -  filter, listeners, wrapper, internationalization
Servlets - filter, listeners, wrapper, internationalization
susant sahu6.2K vues
Sagas Middleware Architecture par Mateusz Bosek
Sagas Middleware ArchitectureSagas Middleware Architecture
Sagas Middleware Architecture
Mateusz Bosek135 vues
Java util concurrent par Roger Xia
Java util concurrentJava util concurrent
Java util concurrent
Roger Xia2.3K vues
Day1_Apache_JMeter_Overview par Sravanthi N
Day1_Apache_JMeter_OverviewDay1_Apache_JMeter_Overview
Day1_Apache_JMeter_Overview
Sravanthi N109 vues
Building resilient applications par Nuno Caneco
Building resilient applicationsBuilding resilient applications
Building resilient applications
Nuno Caneco490 vues
Iasi code camp 12 october 2013 performance testing for web applications with... par Codecamp Romania
Iasi code camp 12 october 2013  performance testing for web applications with...Iasi code camp 12 october 2013  performance testing for web applications with...
Iasi code camp 12 october 2013 performance testing for web applications with...
Codecamp Romania1.1K vues
Waits alerts and switch windows par Ducat
Waits alerts and switch windowsWaits alerts and switch windows
Waits alerts and switch windows
Ducat59 vues
UVM Driver sequencer handshaking par HARINATH REDDY
UVM Driver sequencer handshakingUVM Driver sequencer handshaking
UVM Driver sequencer handshaking
HARINATH REDDY1.2K vues
Automation testing material by Durgasoft,hyderabad par Durga Prasad
Automation testing material by Durgasoft,hyderabadAutomation testing material by Durgasoft,hyderabad
Automation testing material by Durgasoft,hyderabad
Durga Prasad6.9K vues
Automation testing by Durgasoft in Hyderabad par Durga Prasad
Automation testing by Durgasoft in HyderabadAutomation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in Hyderabad
Durga Prasad841 vues

Execute andwait

  • 1. Struts Framework ExecuteAndWait Interceptor Introduction Apex T. G. India Pvt. Ltd
  • 2. 1 execAndWait  The ExecuteAndWaitInterceptor is used for running long-lived actions in the background while showing the user a progress meter(loader image using JavaScript) .  This also prevents the HTTP request from timing out when the action takes more than 5 or 10 minutes.
  • 3. 1 execAndWait  Using this interceptor is pretty straight forward.  Assuming that you are including struts-default.xml, and this interceptor is already configured but is not part of any of the default stacks then it wont work.  Because of the nature of this interceptor, it must be the last interceptor in the stack.
  • 4. 1 execAndWait  This interceptor works on a per-session basis.  It means, same action name ( DemoAction.class ) cannot be run more than once at a time in a given session. On the initial request or any subsequent requests (before the action has completed), the wait result will be returned.  The wait result is responsible for issuing a subsequent request back to the action, giving the effect of a self-updating progress meter.
  • 5. 1 execAndWait  If no "wait" result is found, Struts will automatically generate a wait result on the fly.  But this result is written in FreeMarker and cannot run unless FreeMarker is installed.  If you don't want to use it with FreeMarker then must provide a wait page as a result.
  • 6. 1 execAndWait  Whenever the wait result is returned, the action that is currently running in the background will be placed on top of the stack.  This allows you to display progress data, such as a count, in the wait page. By making the wait page automatically reload the request to the action (which will be short-circuited by the interceptor), can give the appearance of an automatic progress meter.
  • 7. 1 execAndWait  Whenever the wait result is returned, the action that is currently running in the background will be placed on top of the stack.  This allows you to display progress data, such as a count, in the wait page. By making the wait page automatically reload the request to the action (which will be short-circuited by the interceptor), can give the appearance of an automatic progress meter.
  • 8. 1 execAndWait  This interceptor also supports using an initial wait delay. An initial delay is a time in milliseconds let the server wait before the wait page is shown to the user.  During the wait this interceptor will wake every 100 milii second to check if the background process is done premature, thus if the job for some reason doesn't take to long the wait page is not shown to the user.
  • 9. 1 execAndWait  This is useful for e.g. search actions that have a wide span of execution time. Using a delay time of 2000 millis we ensure the user is presented fast search results immediately and for the slow results a wait page is used.  Important: Because the action will be running in a separate thread, We can't use ActionContext because it is a ThreadLocal.
  • 10. 1 execAndWait  The thread kicked off by this interceptor will be named in the form actionNameBackgroundProcess.  This means if we need to access session data, we need to implement SessionAware rather than calling ActionContext.getSession().
  • 11. 1 execAndWait  Parameters:threadPriority (optional) - the priority to assign the thread. Default is Thread.NORM_PRIORITY.  delay (optional) - an initial delay in millis to wait before the wait page is shown (returning wait as result code). Default is no initial delay.  delaySleepInterval (optional) - only used with delay. Used for waking up at certain intervals to check if the background process is already done. Default is 100 millis.
  • 12. 1 execAndWait <action name=“abc" class="com.abc.DemoAction <interceptor-ref name="execAndWait"/> <result name="wait">wait.jsp</result> <result name="success">success.jsp</result> </action>
  • 13. Thanks Stay Connected with us for more chapters on JAVA facebook.com/apex.tgi twitter.com/ApextgiNoida pinterest.com/apextgi