<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5392514751439056484</id><updated>2012-01-01T08:52:38.502-08:00</updated><title type='text'>Technology Discussion</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sougatabh.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sougatabh.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sougata Bhattacharya</name><uri>https://profiles.google.com/109135287352492336016</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5392514751439056484.post-4557589391320588013</id><published>2010-07-01T03:01:00.000-07:00</published><updated>2010-07-01T03:17:20.753-07:00</updated><title type='text'>JSF Life Cycle</title><content type='html'>&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Read lot of article on JSF life cycle and trying to compile a composed one, hope this would help &lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;developers to have a better understanding on JSF.&lt;/span&gt; &lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_bf1DMoAuNCs/TCxpgTK-9kI/AAAAAAAAAvE/aCb1diN7N0E/s1600/lifecycle.GIF"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 465px; height: 211px;" src="http://2.bp.blogspot.com/_bf1DMoAuNCs/TCxpgTK-9kI/AAAAAAAAAvE/aCb1diN7N0E/s320/lifecycle.GIF" alt="" id="BLOGGER_PHOTO_ID_5488878049480865346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;br /&gt;This is JSF Life cycle digram&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;&lt;br /&gt;&lt;br /&gt;Phase 1: Restore View:&lt;/b&gt;Before getting into this we should understand these&lt;/span&gt;&lt;span style="font-size:85%;"&gt;·&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;i&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Initial request&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;i&gt;: A user requests the page for the first time.&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;i&gt;&lt;b&gt;Postback&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;i&gt;: A user submits the form contained on a page that was previously loaded into the browser as a result of executing an initial request.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;br /&gt;When a request for a JavaServer Faces page is made, such as when a link or a button is clicked, the JavaServer Faces implementation begins the restore view phase.In this phase of JSF lifecycle --a request comes through the FacesServlet the Controller of JSF. The controller examines the request and extracts the view ID, which is determined by the name of the JSP page.The JSF framework controller uses the view ID to look up the components for thecurrent view. If the view doesn't already exist, the JSF controller creates it. If theview already exists, the JSF controller uses it. The view contains all the GUI components builds the view of the Faces page and wires the event handlers and validators to thecomponents. The view is saved in a FacesContext object.&lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;The FacesContext &lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;object contains all the state information JSF needs to manage the GUI component's state for the current request in the current session. The FacesContext stores the view in its viewRoot property; viewRoot contains all the JSF components for the current view ID.In the case of an &lt;i&gt;initial view &lt;/i&gt;(the first time a page is loaded), JSF creates an empty iew. The empty view will be populated as the user causes events to occur. From an initial view, JSF advances directly to the render response phase.In the case of a &lt;i&gt;postback &lt;/i&gt;the view corresponding to the page already exists, so it needs only to be restored. In this case, JSF uses the existing view's state information to reconstruct its state. The &lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;next phase after a postback is apply request values&lt;b&gt;&lt;br /&gt;&lt;br /&gt;Phase 2: Apply Request Values&lt;/b&gt;&lt;br /&gt;The purpose of the &lt;i&gt;apply request values &lt;/i&gt;phase is for each component to retrieve its current state. The components must first be retrieved or created from theFacesContext object, followed by their values. Component values are typicallyretrieved from the request parameters, although they can also be retrieved fromcookies or headers.If a component's immediate event handling property is &lt;i&gt;not &lt;/i&gt;set to true, the values are just converted. So if the field is bound to an Integer property, the value is &lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;converted to an Integer. If the value conversion fails, an error message is generated and queued in the FacesContext, where it will be displayed during the render response phase, along with any validation errors.If a component's immediate event handling property &lt;i&gt;is &lt;/i&gt;set to true, the values are converted to the proper type and validated. The converted value is then stored in the component. If the value conversion or value validation fails, an error message is generated and queued in the FacesContext, where it will be displayed during the render response phase, along with any other validation errors.&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;b&gt;Phase 3: Process Validation&lt;br /&gt;&lt;/b&gt;The first event handling of the lifecycle takes place after the apply request valuesphase. At this stage, each component will have its values validated against theapplication's validation rules. The validation rules can be pre-defined (shipped with JSF Framework) or defined by the developer. Values entered by the user are compared to the validation rules. If an entered value is invalid, an error message is added toFacesContext, and the component is marked invalid. If a component is marked invalid, JSF advances to the render response phase, which will display the current view with the &lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;validation error messages. If there are no validation errors, JSF advances to the update model values phase.&lt;b&gt;&lt;br /&gt;&lt;br /&gt;Phase 4: Update Model Values&lt;br /&gt;&lt;/b&gt;In this phase updates the actual values of the server-side model -- namely, by updating the properties of applications backing beans (also called  managed beans). Only bean properties that are bound to a component's value will be updated. Notice that this phase happens after validation, so you can be sure that the values copied to your bean's properties are valid (at least at the form-field level; they may still be invalid at the business-rule level).&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;b&gt;Phase 5: Invoke Application&lt;br /&gt;&lt;/b&gt;In this phase the JSF controller invokes the application to handle Form submissions. The component values will have been converted, validated, and applied to the model objects, so this can be now used them to execute the application's business logic.At this phase, developer also get to specify the next logical view for a given sequence or number of possible sequences. You do this by defining a specific outcome for a successful form submission and returning that outcome. For example: &lt;i&gt;on successful outcome, move the user to the next page&lt;/i&gt;. For this navigation to work, you will have to create a mapping to the &lt;i&gt;successful outcome &lt;/i&gt;as a navigation rule in the faces-config.xml file. Once &lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;the navigation occurs, you move to the final phase of the lifecycle.&lt;b&gt;&lt;br /&gt;&lt;br /&gt;Phase 6: Render Response&lt;/b&gt;&lt;br /&gt;Finally, &lt;b&gt;Render Response&lt;/b&gt; brings several inverse behaviors together in one process:&lt;/span&gt;&lt;span style="font-size:85%;"&gt;· &lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Values are transferred back to the UI components from the bean. Including any modifications that may have been made by the bean itself or by the controller.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;The UI components save their state not just their values, but other attributes having to do with the presentation itself. This can happen serverside, but by default state is written into the HTML as hidden input fields and thus returns to the JSF implementation with the next request.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;· If the request is a postback and errors were encountered during the apply request values phase, process validations phase, or update mode&lt;/span&gt;&lt;span style="font-size:85%;"&gt;l values phase, the original page is rendered during this phase. If the pages contain &lt;/span&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;message or messages tags, any queued error messages are displayed on the page.&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_bf1DMoAuNCs/TCxqrnqyHYI/AAAAAAAAAvM/1GxpQ0SFUfU/s1600/lifecycle2.GIF"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 497px; height: 211px;" src="http://3.bp.blogspot.com/_bf1DMoAuNCs/TCxqrnqyHYI/AAAAAAAAAvM/1GxpQ0SFUfU/s320/lifecycle2.GIF" alt="" id="BLOGGER_PHOTO_ID_5488879343473139074" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5392514751439056484-4557589391320588013?l=sougatabh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sougatabh.blogspot.com/feeds/4557589391320588013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5392514751439056484&amp;postID=4557589391320588013' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/4557589391320588013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/4557589391320588013'/><link rel='alternate' type='text/html' href='http://sougatabh.blogspot.com/2010/07/jsf-life-cycle-read-lot-of-article-on.html' title='JSF Life Cycle'/><author><name>Sougata Bhattacharya</name><uri>https://profiles.google.com/109135287352492336016</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_bf1DMoAuNCs/TCxpgTK-9kI/AAAAAAAAAvE/aCb1diN7N0E/s72-c/lifecycle.GIF' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5392514751439056484.post-7584109102566945409</id><published>2010-06-02T23:11:00.000-07:00</published><updated>2010-06-03T00:11:44.889-07:00</updated><title type='text'>Spring Autowiring</title><content type='html'>&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Spring Auto Wiring is &lt;/span&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt; dependencies through introspection of the bean  classes so that you do not have to explicitly specify the bean  properties or constructor arguments. Bean properties can be autowired  either by property names or matching types. Constructor arguments can be  autowired by matching types. You can even specify the autodetect &lt;code&gt;autowiring&lt;/code&gt;  mode, which lets Spring choose an appropriate mechanism.&lt;br /&gt;&lt;/span&gt;&lt;ul  style="font-family:verdana;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt; no&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt; byName&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;  byType&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt; constructor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;  autodirect      &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt; Consider the below Examples&lt;br /&gt;&lt;/span&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Spring can scan its  configuration file at runtime, looking for a class the same type as a  property found on your main object. Once found, it creates an instance  of that type and then injects that instance into the object's property.  It has been a subject for debate as to whether it is a good idea to let  Spring assume this responsibility. The traditional approach has been to  wire beans manually, using the &lt;i&gt;ref&lt;/i&gt; keyword in a configuration  file:&lt;/span&gt;&lt;/p&gt;  &lt;pre  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;bean id="empDao" class="EmpDao"&gt;&lt;br /&gt;&lt;br /&gt;&lt;bean id="empManager" class="EmpManager"&gt;&lt;br /&gt;&lt;property name="empDao" ref="empDao"&gt;&lt;br /&gt;&lt;/property&gt;&lt;br /&gt;&lt;/bean&gt;&lt;/bean&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Here, a bean of the 'EmpDao' type is injected into a bean of the  'EmpManager' type, assuming there is a property and setter method in the  EmpManager class:&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;public class EmpManager {&lt;br /&gt;&lt;br /&gt;private EmpDao empDao;&lt;br /&gt;&lt;br /&gt;public EmpDao getEmpDao() {&lt;br /&gt;   return empDao;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setEmpDao(EmpDao empDao) {&lt;br /&gt;   this.empDao = empDao;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;By using @Autowired, you can eliminate the additional XML in your  configuration file that specifies the relationship between two objects.  Also, you no longer need methods to set the property in the owning  class. Just include a private or protected variable and Spring will do  the rest. Here's the modified XML:&lt;/span&gt;&lt;/p&gt;  &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;context:annotation-config&gt;&lt;/context:annotation-config&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;bean id="empManager" class="EmpManager"&gt;&lt;/bean&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt; &lt;bean id="empDao" class="EmpDao"&gt; &lt;/bean&gt;&lt;/span&gt;&lt;/span&gt;  &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;And the code...&lt;/span&gt;&lt;/p&gt;  &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;import org.springframework.beans.factory.annotation.Autowired; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;public class EmpManager {     &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;@Autowired    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;private EmpDao empDao;  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;} &lt;/span&gt;&lt;/span&gt;  &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;@Autowired is not just for property injection, but also can be  used in methods and constructors. You can potentially &lt;span class="LiT-ad" title="IT"&gt;reduce&lt;/span&gt; a great deal of XML and code  with this technique. Having said this, autowiring can cause problems in  more complex object models. When using @Autowired, if one and only one  of the type you are looking for cannot be found, an error occurs. This  is an improvement over traditional autowiring which will, by default,  fail &lt;/span&gt;&lt;i&gt;silently&lt;/i&gt; when an exact match cannot be found.  Luckily, with @Autowired, you can add a 'Qualifier' attribute to  identify by type &lt;i&gt;and&lt;/i&gt; name when two objects are of the same type:&lt;/span&gt;&lt;/p&gt;  &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;@Autowired&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;@Qualifier("empDao") &lt;/span&gt;&lt;/span&gt;  &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;As you would expect, @Autowired is not a cure-all and it might not  make sense for every situation. It is easy to fall back on traditional  configuration when @Autowired does not fit. However, @Autowired is a  nice option for developers building Spring applications.&lt;/span&gt;&lt;/p&gt;&lt;pre  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Spring can be configured to autowire dependencies using introspection of the bean classes. This&lt;br /&gt;saves you from having to explicitly specify the bean properties and from specifying the constructor&lt;br /&gt;arguments. In theory, this sounds great. It saves you from some potential typing, it reduces the&lt;br /&gt;size and clutter of your XML Spring configuration files, and it reduces the chance that you'll miss&lt;br /&gt;something in the configuration. This makes for a great demo on how easy it is to use Spring and&lt;br /&gt;get up and running quickly.&lt;br /&gt;&lt;br /&gt;But while it's great for a demo on a small project, it's far less useful on a real-world application.&lt;br /&gt;Without having the bean configurations laid-out explicitly, the maintainability of your project&lt;br /&gt;Save yourself the trouble ahead of time. It takes a little longer to get things up and running,&lt;br /&gt;but in the long-term you'll be much better off if you turn off the autowiring capability in the Spring&lt;br /&gt;gets worse; the bigger your project gets, the harder it is to maintain.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5392514751439056484-7584109102566945409?l=sougatabh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sougatabh.blogspot.com/feeds/7584109102566945409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5392514751439056484&amp;postID=7584109102566945409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/7584109102566945409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/7584109102566945409'/><link rel='alternate' type='text/html' href='http://sougatabh.blogspot.com/2010/06/spring-auto-wiring-is-dependencies.html' title='Spring Autowiring'/><author><name>Sougata Bhattacharya</name><uri>https://profiles.google.com/109135287352492336016</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5392514751439056484.post-1145690586642637099</id><published>2010-01-27T12:46:00.000-08:00</published><updated>2010-01-27T13:13:37.613-08:00</updated><title type='text'>Guide To Eh-Cache</title><content type='html'>&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;EH Cache:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Ehcache is a widely used java distributed cache for general purpose caching, Java EE and light-weight containers.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;It features memory and disk stores, replicate by copy and invalidate, listeners, cache loaders, cache extensions, cache exception handlers, a gzip caching servlet filter, RESTful &amp;amp; SOAP APIs, an implementation of JSR107&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;Feature:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Fast.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Simple: &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Minimal dependency: The only dependency for core use is the JCACHE API.&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Scalable: &lt;/span&gt;&lt;/b&gt;&lt;a name="Provides_Memory_and_Disk_stores_for_scal"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;1.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;Provides Memory and Disk stores for scalabilty into gigabytes&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-weight: bold; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;2. &lt;/span&gt;&lt;/span&gt;&lt;a style="font-weight: normal;" name="Scalable_to_hundreds_of_caches"&gt;&lt;/a&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;Scalable to hundreds of caches&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;span style="font-family: verdana;font-size:85%;" &gt;3. Tuned for high concurrent load on large multi-cpu servers&lt;br /&gt;4. Multiple CacheManagers per virtual machine&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;Ehcache 1.2 introduced multiple CacheManagers per virtual machine. This enables completely difference ehcache.xml configurations to be applied.&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;Flexible:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;1.&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;a name="Supports_Object_or_Serializable_caching"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt; Supports Object or Serializable caching&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;Non-serializable Objects can use all parts of Ehcache except for DiskStore and replication&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;2.&lt;/span&gt;&lt;/span&gt;&lt;a name="Support_cache-wide_or_Element-based_expi"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt; Support cache-wide or Element-based expiry policies&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;Time to lives and time to idles are settable per cache. In addition, from ehcache-1.2.1, overrides to these can be set per Element.&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;#&lt;/span&gt;&lt;/span&gt;&lt;a name="Provides_LRU_LFU_and_FIFO_cache_eviction"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Provides LRU, LFU and FIFO cache eviction policies&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;a name="Provides_Memory_and_Disk_stores"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;#Provides Memory and Disk stores&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Ehcache, like most of the cache solutions, provides high performance memory and disk stores.&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Distributed&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;Ehcache 1.2 introduced a full-featured, fine-grained distributed caching mechanism for clusters, supporting multiple replication mechanisms through plugins&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Persistent disk store which stores data between VM restarts&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;With Ehcache 1.1 in 2004, Ehcache was the first open source Java cache to introduce persistent storage of cache data on disk on shutdown. The cached data is then accessible the next time the application runs.&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Flush to disk on demand&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;With Ehcache 1.2, the flushing of entries to disk can be executed with a &lt;/span&gt;&lt;span style="font-size:85%;"&gt;cache.flush()&lt;/span&gt;&lt;span style="font-size:85%;"&gt; method whenever required, making it easier to use ehcache&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 12pt 0pt 3pt; font-family: verdana;"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Listeners&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;a name="CacheManager_listeners"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;CacheManager listeners&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Register Cache Manager listeners through the &lt;/span&gt;&lt;span style="font-size:85%;"&gt;CacheManagerEventListener&lt;/span&gt;&lt;span style="font-size:85%;"&gt; interface with the following event methods:&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt 5pt 36pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;        &lt;span style="font-size:85%;"&gt;notifyCacheAdded()&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt 5pt 36pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;        &lt;span style="font-size:85%;"&gt;notifyCacheRemoved()&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;a name="Cache_event_listeners"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Cache event listeners&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Register Cache Event Listeners through the &lt;/span&gt;&lt;span style="font-size:85%;"&gt;CacheEventListener&lt;/span&gt;&lt;span style="font-size:85%;"&gt; interfaces, which provides a lot of flexibility for post-processing of cache events. The methods are:&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt 5pt 36pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;        &lt;span style="font-size:85%;"&gt;notifyElementRemoved&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt 5pt 36pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;        &lt;span style="font-size:85%;"&gt;notifyElementPut&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt 5pt 36pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;        &lt;span style="font-size:85%;"&gt;notifyElementUpdated&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt 5pt 36pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;        &lt;span style="font-size:85%;"&gt;notifyElementExpired&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;h3 style="margin: 12pt 0pt 3pt; font-family: verdana;"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;JMX Enabled&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Ehcache is JMX enabled. You can monitor and manage the following MBeans:&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt 5pt 36pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;        &lt;span style="font-size:85%;"&gt;CacheManager&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt 5pt 36pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;        &lt;span style="font-size:85%;"&gt;Cache&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt 5pt 36pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;        &lt;span style="font-size:85%;"&gt;CacheConfiguration&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt 5pt 36pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;        &lt;span style="font-size:85%;"&gt;CacheStatistics&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h3 style="margin: 12pt 0pt 3pt; font-family: verdana;"&gt;&lt;a name="Cache_Server"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Cache Server&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Ehcache now comes with a Cache Server, available as a WAR for most web containers, or as a standalone server. The Cache Server has two apis: RESTful resource oriented, and SOAP. Both support clients in any programming language.&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;a name="RESTful_cache_server"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;RESTful cache server&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;The Ehcache implementation strictly follows the RESTful resource-oriented architecture style&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;a name="SOAP_cache_server"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;SOAP cache server&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;The Ehcache RESTFul Web Services API exposes the singleton CacheManager, which typically has been configured in ehcache.xml or an IoC container. Multiple CacheManagers are not supported.&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;#Code Samples:&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;All usages of Ehcache start with the creation of a CacheManager.&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;a name="Singleton_versus_Instance"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Singleton versus Instance&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;As of ehcache-1.2, Ehcache CacheManagers can be created as either singletons (use the create factory method) or instances (use new).&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Create a singleton CacheManager using defaults, then list caches.This method creates a cache manager or return if already provides the CacheManager if already exists. The CacheManager is created for each config file.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;CacheManager.create();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;String[] cacheNames = CacheManager.getInstance().getCacheNames();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Create a CacheManager instance using defaults, then list caches.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt; CacheManager manager = new CacheManager();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt; String[] cacheNames = manager.getCacheNames();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Create two CacheManagers, each with a different configuration, and list the caches in each.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt; CacheManager manager1 = new CacheManager("src/config/ehcache1.xml");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt; CacheManager manager2 = new CacheManager("src/config/ehcache2.xml");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt; String[] cacheNamesForManager1 = manager1.getCacheNames();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt; String[] cacheNamesForManager2 = manager2.getCacheNames();&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;#&lt;/span&gt;&lt;/span&gt;&lt;a name="Performing_CRUD_operations"&gt;&lt;/a&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Performing CRUD operations&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Put an element into a cache&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Cache cache = manager.getCache("sampleCache1");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Element element = new Element("key1", "value1");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;cache.put(element);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Update an element in a cache. Even though &lt;/span&gt;&lt;span style="font-size:85%;"&gt;cache.put()&lt;/span&gt;&lt;span style="font-size:85%;"&gt; is used, Ehcache knows there is an existing element, and considers the put an update for the purpose of notifying cache listeners.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Cache cache = manager.getCache("sampleCache1");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;cache.put(new Element("key1", "value1"));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;//This updates the entry for "key1"&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;cache.put(new Element("key1", "value2"));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Get a Serializable value from an element in a cache with a key of "key1".&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Cache cache = manager.getCache("sampleCache1");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Element element = cache.get("key1");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Serializable value = element.getValue();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Get a NonSerializable value from an element in a cache with a key of "key1".&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Cache cache = manager.getCache("sampleCache1");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Element element = cache.get("key1");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Object value = element.getObjectValue();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Remove an element from a cache with a key of "key1".&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Cache cache = manager.getCache("sampleCache1");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;cache.remove("key1");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;Another way to create cache depending on cache size and time to live&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;CacheManager cacheManager = CacheManager.create();&lt;br /&gt;Cache theCache = new Cache(NAMEOFCACHE,theCacheSize,false,false,theCacheTimeToLive&lt;br /&gt;thecacheTimeToLive);&lt;br /&gt;cacheManager.addCache(theCache);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 5pt 0pt; font-family: verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5392514751439056484-1145690586642637099?l=sougatabh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sougatabh.blogspot.com/feeds/1145690586642637099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5392514751439056484&amp;postID=1145690586642637099' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/1145690586642637099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/1145690586642637099'/><link rel='alternate' type='text/html' href='http://sougatabh.blogspot.com/2010/01/guide-to-eh-cache.html' title='Guide To Eh-Cache'/><author><name>Sougata Bhattacharya</name><uri>https://profiles.google.com/109135287352492336016</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5392514751439056484.post-5235652952104066726</id><published>2010-01-26T16:56:00.000-08:00</published><updated>2010-01-26T17:11:48.360-08:00</updated><title type='text'>Inversion Of ControL</title><content type='html'>&lt;p&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;The basic concept of the Inversion of Control pattern (dependency injection) is that programmers don’t need to create your objects but describe how they should be created. Don’t directly connect your components and services together in code but describe which services are needed by which components in a configuration file. A container (in the case of the Spring framework, the IOC container) is responsible for all this. In a IOC scenario, the container creates all the objects, connects them together by setting the necessary properties, and determines when methods will be invoked. The implementation pattern types for IOC used by SpringFramework are as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 12px; "&gt;Dependencies can be assigned through setter methods&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 12px; "&gt;Dependencies are provided as constructor parameters&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:Tahoma;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 12px;"&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;An example would make the things clear.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;Inversion of Control, not surprisingly, is all about inverting the control. Or, how one object uses another object. Suppose class “User” wants to use class “Used”. Traditionally, you would create and use an instance of class “Used” within class “User”, like in the following example: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;Class User {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;private Used used;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;public User() {&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;used = new Used();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma;"&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family: Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;public void doSomething(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;used.someMethod();&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma;"&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;The problems in creating dependency between two objects using this traditional approach:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma;mso-fareast-font-family:Tahoma; mso-bidi-font-family:Tahoma"&gt;&lt;span style="mso-list:Ignore"&gt;&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;The creation of object “Used” relies upon the availability of a default constructor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma;mso-fareast-font-family:Tahoma; mso-bidi-font-family:Tahoma"&gt;&lt;span style="mso-list:Ignore"&gt;&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;Any change in the constructor implementation of class “Used” will necessitate achange in the implementation of class “User”.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma;mso-fareast-font-family:Tahoma; mso-bidi-font-family:Tahoma"&gt;&lt;span style="mso-list:Ignore"&gt;&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;Suppose class “User” wants to use class “Another” instead of class “Used”. Then class “User” needs to change. What happens if class “Used” and class “Another” are two separate implementations of same service and the application will need to switch over from one implementation to the other?&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;All three of the problems in the code example are due the strong coupling of class “User” and class “Used”. Class “User” first needs to know that it must use an instance of class “Used” and then it needs to know how to construct an instance of class “Used”. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;The solution to this problem is to eliminate the dependency from class “User”. What follows is a modified class “User”, where strong coupling is removed: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family: Tahoma"&gt;Class User {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;private Used used;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;public User(Used used) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;this.used = used;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;public void doSomething(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;used.someMethod();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma;"&gt;This example accepts an instance of class “Used” via the constructor. This relieves class “User” from knowing how to instantiate class “Used”. Now, in order to use class “User”, the caller class of “User” must also instantiate class “Used” and pass it into class “User”. In this context, the caller class is also acting as an assembler of object “User” and object “Used”. Object “User” does not explicitly look for “Used”, but “Used” is supplied to it. This is the Inversion of Control. The control of class “Used” is taken out of class “User” and placed in the Assembler class.&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma;"&gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma;"&gt;Instead of passing the reference of another object through the constructor, use Java Bean properties to set the same. The next code example shows a modified class “User”, which uses a bean property-based IoC.   Class User {   private Used used;      public User(){   }    public setUsed(Used used) {        this.used = used;   }    public void doSomething(){            used.someMethod();   }  The fundamental idea behind IoC is to completely decouple objects from explicit dependency. In IoC, one object exposes its dependency to other objects through a defined contract in terms of a constructor or bean property. &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma;"&gt; &lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This example accepts an instance of class “Used” via the constructor. This relieves class “User” from knowing how to instantiate class “Used”. Now, in order to use class “User”, the caller class of “User” must also instantiate class “Used” and pass it into class “User”. In this context, the caller class is also acting as an assembler of object “User” and object “Used”. Object “User” does not explicitly look for “Used”, but “Used” is supplied to it. This is the Inversion of Control. The control of class “Used” is taken out of class “User” and placed in the Assembler class.  There is another way to decouple the objects: dependency lookup. This is implemented as a Service Locator pattern. In dependency lookup, the dependent object explicitly performs a look-up for the required Service objects. By doing so, the Service Locator can return various versions and flavours of the required Service objects. Thus, the dependent object does not need to use any explicit reference to any implementation of the Service object. However, the dependent object still needs to know about the Service Locator component. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Tightening a Few Bolts&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;In the last two code examples, it's best if “Used” is an interface as opposed to a concrete class. This provides you with the complete flexibility to inject any implementation of the interface “Used”. If “Used” is a concrete class, then you're tied to a particular implementation of a service object. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Comparing the Two Methods&lt;/b&gt;&lt;/div&gt;&lt;div&gt;So far, we have seen two methods of passing the dependency to the object: one through constructors and the other through appropriate setter methods. As usual, both methods have their pros and cons.  Here's the advantages of using the constructor-based IoC:  &lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;• You can hide (or encapsulate) all your fields without having to expose them through setter methods. This is important because if you don't want something to change, youneed to make sure you haven't provided it any way to change. • A constructor with a specific number of parameters gives you a clear indication of what it means to create an object. &lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;On the other hand, the disadvantages with constructor-based IoC are: &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;• If you've got too many parameters to be passed inside the constructor, it starts looking messy. • The order of parameters becomes important. • If, at the time of creating the object, you are not sure about the dependencies the object will take up, you may not be able to inject the dependency through a constructor. • Constructors can suffer from classic inheritance problems when super class constructors do change or a sub-class is added. Although, this is more of a problem in the OO domain, it is significant enough here to effect the success of IOC. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The dependency lookup concept works fine, but only if all the application modules are developed under the same hood and you have a thorough knowledge of every API of every component used in the application. If you're developing a component for a third party, you're probably not going to know anything about the kind of service locator component that third party will use. Hence, this model might fail to work. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h3&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;Examples of IOC in Real-life&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;J2EE containers use IoC to a great extent. The reason for this is clear—containers do not know beforehand about which dependencies between modules are deployed. Somehow, they have to resolve these dependencies at runtime. The containers use both constructor- and setter-based IoC methods discussed above. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;&lt;span style="font-size:9.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5392514751439056484-5235652952104066726?l=sougatabh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sougatabh.blogspot.com/feeds/5235652952104066726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5392514751439056484&amp;postID=5235652952104066726' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/5235652952104066726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/5235652952104066726'/><link rel='alternate' type='text/html' href='http://sougatabh.blogspot.com/2010/01/inversion-of-control.html' title='Inversion Of ControL'/><author><name>Sougata Bhattacharya</name><uri>https://profiles.google.com/109135287352492336016</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5392514751439056484.post-50644362802308586</id><published>2010-01-14T08:13:00.001-08:00</published><updated>2010-01-14T08:36:25.324-08:00</updated><title type='text'>RichFaces</title><content type='html'>&lt;span style=";font-family:verdana;font-size:85%;"  &gt;&lt;span style="font-weight: bold;"&gt;Rich faces  By Example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Downloading the RichFaces&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The latest release of RichFaces components is available for download at &lt;a href="http://www.jboss.org/richfaces/download/stable.html"&gt;JBoss RichFaces Downloads area&lt;/a&gt; at JBoss community. Binary files (uploaded there in *.bin.zip or *.bin.tar.gz archives) contains compiled, ready-to-use version of RichFaces with set of basic skins.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Creating Richfaces project:&lt;/span&gt;&lt;br /&gt;Create a Dynamic web project in eclipse. I used eclipse GANYMEDE for development.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Adding RichFaces libraries into the project&lt;/span&gt;&lt;br /&gt;Go to the folder with unzipped earlier RichFaces binary files and open lib folder. This folder contains three *.jar files with API, UI and implementation libraries. Copy that "jars" from lib folder to WEB-INF/lib folder&lt;br /&gt;These are&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;richfaces-api-3.3.2.SR1.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;richfaces-impl-3.3.2.SR1.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;richfaces-ui-3.3.2.SR1.jar&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Additional lib files:&lt;/span&gt;&lt;br /&gt;Can be found from if you download RichFaces Examples (new photo album application) from &lt;a href="http://www.jboss.org/richfaces/download/stable.html"&gt;here&lt;/a&gt;. Go to the WEB-INF/lib&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;common-annotations.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;commons-beanutils.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;commons-collections.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;commons-digester.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;commons-logging.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;el-ri.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;jsf-api.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;jsf-facelets.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;jsf-impl.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;jstl.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;standard.jar&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Registering RichFaces in web.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;&amp;lt;context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-name&amp;gt;com.sun.faces.verifyObjects&amp;lt;/param-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-name&amp;gt;com.sun.faces.validateXml&amp;lt;/param-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-name&amp;gt;javax.faces.DEFAULT_SUFFIX&amp;lt;/param-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-value&amp;gt;.xhtml&amp;lt;/param-value&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-name&amp;gt;facelets.DEVELOPMENT&amp;lt;/param-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-value&amp;gt;false&amp;lt;/param-value&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-name&amp;gt;facelets.SKIP_COMMENTS&amp;lt;/param-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-name&amp;gt;org.richfaces.SKIN&amp;lt;/param-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-value&amp;gt;blueSky&amp;lt;/param-value&amp;gt;&amp;lt;!-- param-value&amp;gt;classic&amp;lt;/param-value&amp;gt; --&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-name&amp;gt;org.ajax4jsf.VIEW_HANDLERS&amp;lt;/param-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;param-value&amp;gt;com.sun.facelets.FaceletViewHandler&amp;lt;/param-value&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/context-param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;filter&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;display-name&amp;gt;RichFaces Filter&amp;lt;/display-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;filter-name&amp;gt;richfaces&amp;lt;/filter-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;filter-class&amp;gt;org.ajax4jsf.Filter&amp;lt;/filter-class&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/filter&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;filter-mapping&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;filter-name&amp;gt;richfaces&amp;lt;/filter-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;servlet-name&amp;gt;Faces Servlet&amp;lt;/servlet-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;dispatcher&amp;gt;REQUEST&amp;lt;/dispatcher&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;dispatcher&amp;gt;FORWARD&amp;lt;/dispatcher&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;dispatcher&amp;gt;INCLUDE&amp;lt;/dispatcher&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/filter-mapping&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;servlet&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;servlet-name&amp;gt;Faces Servlet&amp;lt;/servlet-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;servlet-class&amp;gt;javax.faces.webapp.FacesServlet&amp;lt;/servlet-class&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;load-on-startup&amp;gt;1&amp;lt;/load-on-startup&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/servlet&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;servlet-mapping&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;servlet-name&amp;gt;Faces Servlet&amp;lt;/servlet-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;url-pattern&amp;gt;*.jsf&amp;lt;/url-pattern&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;   &amp;lt;/servlet-mapping&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1.Signin.xhtml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;&amp;lt;?xml version='1.0' encoding='UTF-8' ?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     xmlns:ui="http://java.sun.com/jsf/facelets"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     xmlns:f="http://java.sun.com/jsf/core"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     xmlns:h="http://java.sun.com/jsf/html"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     xmlns:a4j="http://richfaces.org/a4j"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     xmlns:rich="http://richfaces.org/rich" &amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;           &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;           &amp;lt;f:view&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                 &amp;lt;a4j:form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                       &amp;lt;rich:panel header="User Details" style="width: 315px"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                           &amp;lt;h:panelGrid columns="2"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                             &amp;lt;h:outputText value="User Name: " /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                             &amp;lt;h:inputText value="#{userBackingBean.userName}" &amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                                   &amp;lt;f:validateLength minimum="1" maximum="30" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                             &amp;lt;/h:inputText&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                           &amp;lt;h:outputText value="Password: " /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                             &amp;lt;h:inputText value="#{userBackingBean.password}" &amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                                   &amp;lt;f:validateLength minimum="1" maximum="30" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                             &amp;lt;/h:inputText&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;&amp;lt;a4j:commandButton value="Submit" action="#{userBackingBean.signIn}"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;                           &amp;lt;/h:panelGrid&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;&amp;lt;/rich:panel&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;&amp;lt;/a4j:form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;           &amp;lt;/f:view&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;     &amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 51);"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;UserBackingBean&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;package com.vapps.backingbeans;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;public class UserBackingBean {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   public UserBackingBean(){&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   private String userName;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   public String getUserName() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       return userName;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   private String password;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   public void setUserName(String userName) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       this.userName = userName;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   public String getPassword() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       return password;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   public void setPassword(String password) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       this.password = password;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   public String signIn()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       User user = new User();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       user.setUserName(this.getUserName());&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       user.setPassword(this.getPassword());&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       User foundUser = getUserService().find(user);//getUserService() has be defined&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       System.out.println("The User is found = "+foundUser);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       if(foundUser != null){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;           System.out.println("Inside the loop");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;           return "updateprofile";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;       return "";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Welcome.xhtml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;&amp;lt;?xml version='1.0' encoding='UTF-8' ?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     xmlns:ui="http://java.sun.com/jsf/facelets"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     xmlns:f="http://java.sun.com/jsf/core"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     xmlns:h="http://java.sun.com/jsf/html"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     xmlns:a4j="http://richfaces.org/a4j"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     xmlns:rich="http://richfaces.org/rich" &amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     &amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;           &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     &amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     &amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;           &amp;lt;f:view&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                &amp;lt;a4j:form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                   &amp;lt;!--  Welcome Message --&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                   &amp;lt;h:panelGrid columns="2"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                             Welcome &amp;lt;h:outputText value="#{userBackingBean.userName} " /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                    &amp;lt;/h:panelGrid&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                    &amp;lt;!--  Welcome Message --&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                 &amp;lt;/a4j:form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;           &amp;lt;/f:view&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     &amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;WEB-INF/faces-config.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;&amp;lt;faces-config version="1.2"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                   xmlns="http://java.sun.com/xml/ns/javaee"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                   xmlns:xi="http://www.w3.org/2001/XInclude"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;                   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;&amp;lt;navigation-rule&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;          &amp;lt;navigation-case&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;           &amp;lt;from-outcome&amp;gt;updateprofile&amp;lt;/from-outcome&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;           &amp;lt;to-view-id&amp;gt;/welcome.xhtml&amp;lt;/to-view-id&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;         &amp;lt;/navigation-case&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;       &amp;lt;/navigation-rule&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;  &amp;lt;managed-bean&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     &amp;lt;description&amp;gt;UsernName Bean&amp;lt;/description&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     &amp;lt;managed-bean-name&amp;gt;userBackingBean&amp;lt;/managed-bean-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     &amp;lt;managed-bean-class&amp;gt;com.vapps.backingbeans.UserBackingBean&amp;lt;/managed-bean-class&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;     &amp;lt;managed-bean-scope&amp;gt;request&amp;lt;/managed-bean-scope&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;  &amp;lt;/managed-bean&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 0);"&gt;&amp;lt;/faces-config&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;For more information visit http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5392514751439056484-50644362802308586?l=sougatabh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sougatabh.blogspot.com/feeds/50644362802308586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5392514751439056484&amp;postID=50644362802308586' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/50644362802308586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/50644362802308586'/><link rel='alternate' type='text/html' href='http://sougatabh.blogspot.com/2010/01/richfaces.html' title='RichFaces'/><author><name>Sougata Bhattacharya</name><uri>https://profiles.google.com/109135287352492336016</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5392514751439056484.post-2517393877778679015</id><published>2010-01-04T02:03:00.000-08:00</published><updated>2010-01-04T04:17:05.200-08:00</updated><title type='text'>Overview of AOP</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;u&gt;&lt;span lang="EN-IE" style="font-size:10.0pt;font-family: Tahoma;mso-ansi-language:EN-IE"&gt;Introduction: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black"&gt;Aspect-oriented programming is one of those ideas that seems new but has actually been around for quite a while. Many people contributed to the body of knowledge available today, and many can lay claim to being a founder. The person most commonly associated with AOP is Gregor Kiczales, currently at the &lt;st1:place st="on"&gt;&lt;st1:placetype st="on"&gt;University&lt;/st1:placetype&gt;  of &lt;st1:placename st="on"&gt;British Columbia&lt;/st1:placename&gt;&lt;/st1:place&gt;, where he works on software modularity research. From 1984 to 1999, Kiczales worked on AOP at the Xerox Palo Alto Research Center (PARC) and was a leader in developing implementations of it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;Object Oriented Programming:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;span style="text-decoration:none"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Object-oriented programming (OOP) has become the mainstream programming paradigm where real world problems are decomposed into objects that abstract behavior and data in a single unit.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;OOP encourages software re-use by providing design and language constructs for modularity, encapsulation, inheritance, and polymorphism. Although OOP has met great success in modeling and implementing complex software systems, it has its problems. Practical experience with large projects has shown that programmers may face some problems with maintaining their code because it becomes increasingly difficult to cleanly separate concerns into modules. An attempt to do a minor change in the program design may require several updates to a large number of unrelated modules.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-top:2.4pt;margin-right:0cm;margin-bottom:6.0pt;margin-left: 0cm;line-height:15.6pt"&gt;&lt;u&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:#00003F"&gt;Aspect Oriented Programming:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/h3&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;AOP is a technology for separating crosscutting concerns into single units called aspects. An aspect is a modular unit of crosscutting implementation. It encapsulates behaviours that affect multiple classes into reusable modules. With AOP, we start by implementing our project using our OO language (for example, Java), and then we deal separately with crosscutting concerns in our code by implementing aspects. Finally, both the code and aspects are combined into a final executable form using an aspect weaver. As a result, a single aspect can contribute to the implementation of a number of methods, modules, or objects, increasing both reusability and maintainability of the code.. You should note that the original code doesn't need to know about any functionality the aspect has added; it needs only to be recompiled without the aspect to regain the original functionality.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;In that way, AOP complements object-oriented programming, not replacing it, by facilitating another type of modularity that pulls together the widespread implementation of a crosscutting concern into a single unit. These units are termed aspects, hence the name aspect oriented programming.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Cross Cutting&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;An example of crosscutting concerns is "logging," which is frequently used in distributed applications to aid debugging by tracing method calls. Suppose we do logging at both the beginning and the end of each method body. This will result in crosscutting all classes that have at least one method. Other typical crosscutting concerns include context-sensitive error handling, performance optimization, and design patterns.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:#222222"&gt;Crosscutting concerns may exist in some programs, especially large ones. However, in some situations, redesign of the system might transform a crosscutting into an object. AOP assumes that crosscutting concerns may exist in programs and can't be re-factored out of the design in all situations.&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;When to Use AOP:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;These are the common scenarios where AOP is used&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;line-height:13.5pt;mso-list: l4 level1 lfo4;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;ü&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Logging&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;line-height:13.5pt;mso-list: l4 level1 lfo4;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;ü&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Transaction management&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;line-height:13.5pt;mso-list: l4 level1 lfo4;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;ü&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Security&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;line-height:13.5pt;mso-list: l4 level1 lfo4;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;ü&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Auditing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;line-height:13.5pt;mso-list: l4 level1 lfo4;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;ü&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Locking&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;line-height:13.5pt;mso-list: l4 level1 lfo4;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;ü&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Event handling&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3&gt;&lt;u&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;AOP Concept:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;Before we delve too deeply into AOP, let's introduce some standard terminology to help us understand the concepts.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo3; tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;mso-fareast-font-family:Tahoma;mso-bidi-font-family:Tahoma; color:#222222"&gt;&lt;span style="mso-list:Ignore"&gt;1.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:#222222"&gt;Join Point: &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:#222222"&gt;A well defined point during the execution of your application. Additional logic can be inserted at JoinPoint's &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:18.0pt;text-indent:18.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:#222222"&gt;Example: Method invocation, class initialization, Object initialization&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo3; tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;mso-fareast-font-family:Tahoma;mso-bidi-font-family:Tahoma; color:#222222"&gt;&lt;span style="mso-list:Ignore"&gt;2.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:#222222"&gt;Advice&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:#222222"&gt;: This is the additional code that you want to apply to your existing model&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:#222222"&gt;Example: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l5 level1 lfo5; tab-stops:list 72.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family: Wingdings;color:#222222"&gt;&lt;span style="mso-list:Ignore"&gt;ü&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:#222222"&gt;before advice, which executes before joinpoint&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l5 level1 lfo5; tab-stops:list 72.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family: Wingdings;color:#222222"&gt;&lt;span style="mso-list:Ignore"&gt;ü&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:#222222"&gt;after advice, which executes after joinpoint&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l5 level1 lfo5; tab-stops:list 72.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family: Wingdings;color:#222222"&gt;&lt;span style="mso-list:Ignore"&gt;ü&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:#222222"&gt;around advice, which executes around joinpoint&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo3; tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;mso-fareast-font-family:Tahoma;mso-bidi-font-family:Tahoma; color:#222222"&gt;&lt;span style="mso-list:Ignore"&gt;3.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:#222222"&gt;Point-cut&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:#222222"&gt;: A collection of joinpoints that you use to define when advice should be executed. By creating pointcuts, you gain fine-grained control over how you apply advice to the components&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent:36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:#222222"&gt;Example: A collection of method Invocation in a class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo3; tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;mso-fareast-font-family:Tahoma;mso-bidi-font-family:Tahoma; color:#222222"&gt;&lt;span style="mso-list:Ignore"&gt;4.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:#222222"&gt;Aspect&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:#222222"&gt;: The combination of the point-cut and the advice is termed an aspect. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo3; tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;mso-fareast-font-family:Tahoma;mso-bidi-font-family:Tahoma; color:#222222"&gt;&lt;span style="mso-list:Ignore"&gt;5.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:#222222"&gt;Weaving&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:#222222"&gt;: Process of actually inserting aspects into the application code at the appropriate point. There are two types of Weaving, 1. Compile time weaving&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;2. Runtime weaving.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo3; tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;mso-fareast-font-family:Tahoma;mso-bidi-font-family:Tahoma; color:#222222"&gt;&lt;span style="mso-list:Ignore"&gt;6.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:#222222"&gt;Target&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:#222222"&gt;: An object whose execution flow is modified by some AOP process. They are sometimes called advised object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l3 level1 lfo3; tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;mso-fareast-font-family:Tahoma;mso-bidi-font-family:Tahoma; color:#222222"&gt;&lt;span style="mso-list:Ignore"&gt;7.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:#222222"&gt;Introduction&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:#222222"&gt;: Process by which you can modify the structure of an object by introducing additional methods or fields to it.You use the Introduction to make any object implement a specific interface without needing the object's class to implement that interface explicitly&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;There are many other facets of AOP, such as introductions (where interfaces/methods/fields can be added to existing classes), that hold tremendous potential for developers, but I'll stick with some of simpler facets in this article. When you are familiar with the concepts presented here, I would recommend that you continue to investigate AOP and see how the other facets may be of use to you in your development environment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;Example&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;public class SavingsAccount{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public long depositMoney(long amount){&lt;span style="mso-tab-count:1"&gt;          &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;newAmount = moneyinAccount+ amount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;currentAmount = newAmount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return currentAmount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public long withdrawMoney(long amount){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;if (withdrawalAmount &lt;= currentAmount){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;currentAmount = currentAmount – amount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return currentAmount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;}&lt;span style="mso-tab-count:1"&gt;       &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;This is a simple example of Saving account service, we can use this service by calling SavingsAccount.depositMoney() or SavingsAccount.withdrawMoney().&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;Now lets we want to use bit security in this example, say only Bank Admin can withdraw or deposit money.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;In typical OO scenario the code would look like this,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;public class SavingsAccount{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public long depositMoney(long amount){&lt;span style="mso-tab-count:1"&gt;          &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;User user = getSession().getUser();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;if(user.getRole.equals(“Admin”)){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;span style="mso-tab-count:1"&gt;    &lt;/span&gt;newAmount = moneyinAccount+ amount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;currentAmount = newAmount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;span style="mso-tab-count:1"&gt;    &lt;/span&gt;return currentAmount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public long withdrawMoney(long amount){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;User user = getSession().getUser();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-tab-count:2"&gt;                        &lt;/span&gt;if(user.getRole.equals(“Admin”)){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;if (withdrawalAmount &lt;= currentAmount){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;span style="mso-tab-count:1"&gt;    &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;currentAmount = currentAmount – amount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;span style="mso-tab-count:1"&gt;    &lt;/span&gt;return currentAmount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;span style="mso-tab-count:1"&gt;       &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;Now lets assume we need to use logging and transaction Management facility in the code,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;public class SavingsAccount{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public long depositAmount(long amount){&lt;span style="mso-tab-count:2"&gt;                     &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;logger.info("Start of deposit method");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;Transaction trasaction&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;= getContext().getTransaction();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;transaction.begin();&lt;span style="mso-tab-count:2"&gt;                        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;try{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;User user = getContext().getUser();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;           &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;if (user.getRole().equals("Admin"){&lt;span style="mso-tab-count:2"&gt;                      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;newAmount = existingAccount + amount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;currentAmount = newAmount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;transaction.commit();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}catch(Exception exception){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;transaction.rollback();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;logger.info("End of deposit method");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return currentAmount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public long withdrawAmont(long amount){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;logger.info("Start of withdraw method");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;Transaction trasaction = getContext().getTransaction();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;transaction.begin();&lt;span style="mso-tab-count:2"&gt;                        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;try{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;User user = getContext().getUser();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;if (user.getRole().equals("Admin"){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;if (withdrawalAmount &lt;= currentAmount){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;currentAmount = currentAmount – amount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;             &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;transaction.commit();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}catch(Exception exception){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;transaction.rollback();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;logger.info("End of withdraw method");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return currentAmount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;span style="mso-tab-count:1"&gt;       &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;Analysis of the Code: &lt;/span&gt;&lt;/u&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:#222222"&gt;The above code has so many disadvantages, &lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;The very first thing is that as soon as new requirements are coming it is forcing the methods and the logic to change a lot which is against the&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Software Design. &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;And mode over my SavingsAccount class should no how responsible for Transaction Management or Security Management.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;u&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;Solution Of AOP:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Here comes the AOP.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Let us re-visit the Class Structure and the Implementation to reveal the facts. The&lt;span class="apple-converted-space"&gt; Savings&lt;/span&gt;Account&lt;span class="apple-converted-space"&gt; &lt;/span&gt;class provides services for depositing and withdrawing the amount. But when you look into the implementation of these services, you can find that apart from the normal business logic, it is doing so many other stuffs like&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Logging&lt;/i&gt;&lt;/b&gt;,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;User Checking&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;and&lt;b&gt;&lt;i&gt;Transaction Management&lt;/i&gt;&lt;/b&gt;. See the pseudo-code below that explains this.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;code&gt;&lt;span style="font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public void depositAmount(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Transaction Management&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Logging&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Checking for the Privileged User&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Actual Deposit Logic comes here &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public void withdrawAmount(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Transaction Management&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Logging&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Checking for the Privileged User&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Actual Withdraw Logic comes here &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:2"&gt;                        &lt;/span&gt;&lt;span style="mso-tab-count: 2"&gt;                        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;From the above pseudo-code, it is clear that&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Logging&lt;/i&gt;&lt;/b&gt;,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Transaction Management&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;and&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Security Checking&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;which are never part of the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Deposit&lt;span class="apple-converted-space"&gt; &lt;/span&gt;or withdraw&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;the Service&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;functionality are made to embed in the implementation for completeness. Specifically, AOP calls this kind of logic that&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;cross-cuts&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;or overlaps the existing business logic as&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Concerns&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;or&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Cross-Cutting Concerns&lt;/i&gt;&lt;/b&gt;. The main idea of AOP is to isolate the cross-cutting&lt;span class="apple-converted-space"&gt; &lt;/span&gt;concerns&lt;span class="apple-converted-space"&gt; &lt;/span&gt;from the application code thereby modularizing them as a different entity. It doesn't mean that because the cross-cutting code has been externalized from the actual implementation, the implementation now doesn't get the required add-on functionalities. There are ways to specify some kind of relation between the original business code and the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Concerns&lt;span class="apple-converted-space"&gt; &lt;/span&gt;through some techniques .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Using the AOP concepts here,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;1. &lt;u&gt;Aspect&lt;/u&gt;: An&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Aspect&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;is a functionality or a feature that&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;cross-cuts over&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;objects. The addition of the functionality makes the code to&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Unit Test&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;difficult because of its dependencies and the availability of the various components it is referring. For example, in the below example,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Logging&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;and&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Transaction Management&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;are the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;aspects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;code&gt;&lt;span style="font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public void businessOperation(BusinessData data){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Logging&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;logger.info("Business Method Called");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Transaction Management Begin&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;transaction.begin();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Do the original business operation here&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;transaction.end();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;2. &lt;u&gt;JoinPoint:&lt;/u&gt;&lt;b&gt;&lt;i&gt; Join Points&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;defines the various&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Execution Points&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;where an&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Aspect&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;can be applied. For example, consider the following piece of code,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-converted-space"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;public void someBusinessOperation(BusinessData data){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;//Method Start -&gt; Possible aspect code here like logging.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;try{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// Original Business Logic here.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}catch(Exception exception){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// Exception -&gt; Aspect code here when some exception is raised.&lt;span style="mso-tab-count:1"&gt;       &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}finally{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// Finally -&gt; Even possible to have aspect code at this point too.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Method End -&gt; Aspect code here in the end of a method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;&lt;span style="mso-tab-count:3"&gt;                                    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;In the above code, we can see that it is possible to determine the various points in the execution of the program like &lt;b&gt;&lt;i&gt;Start of the Method&lt;/i&gt;&lt;/b&gt;,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;End of the Method&lt;/i&gt;&lt;/b&gt;, the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Exception Block&lt;/i&gt;&lt;/b&gt;, the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Finally Block&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;where a particular piece of&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Aspect &lt;/i&gt;&lt;/b&gt;can be made to execute. Such&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Possible Execution Points&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;in the Application code for embedding&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Aspects&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;are called &lt;b&gt;&lt;i&gt;Join Points&lt;/i&gt;&lt;/b&gt;. It is not necessary that an&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Aspect&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;should be applied to all the possible&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Join Points&lt;/i&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;3.&lt;u&gt;PointCut:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;As mentioned earlier,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Join Points&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;refer to the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Logical Points&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;wherein a particular&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Aspect&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;or a&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Set of&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Aspects&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;can be applied. A&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Pointcut&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;or a&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Pointcut Definition&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;will exactly tell on which&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Join Points&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Aspects&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;will be applied. To make&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;the understanding&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;of this term clearer, consider the following piece of code,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;code&gt;&lt;span style="font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;aspect LoggingAspect {}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;aspect TransactionManagementAspect {}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Assume that the above two declarations declare something of type Aspect. Now consider the following piece of code,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public void someMethod(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;//Method Start&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;try{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// Some Business Logic Code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}catch(Exception exception){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// Exception handler Code&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}finally{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// Finally Handler Code for cleaning resources.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// Method End&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;In the above sample code, the possible execution points, i.e.&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Join Points&lt;/i&gt;&lt;/b&gt;, are the start of the method, end of the method, exception block and the finally block. These are the possible points wherein any of the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;aspects,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Logging Aspect&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;or&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Transaction Management Aspect&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;can be applied. Now consider the following&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Point Cut&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;definition,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;code&gt;&lt;span style="font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;pointcut method_start_end_pointcut(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// This point cut applies the aspects, logging and transaction, before the &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// beginning and the end of the method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;pointcut catch_and_finally_pointcut(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// This point cut applies the aspects, logging and transaction, in the catch &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;// block (whenever an exception raises) and the finally block.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;As clearly defined, it is possible to define a&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Point Cut&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;that binds the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Aspect&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;to a particular&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Join Point&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;or some&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Set of Join Points&lt;/i&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;4.&lt;u&gt;Advice&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Now that we are clear with the terms like&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Aspects&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Point Cuts&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;and&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Join Points&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;, let us look into what actually&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Advice &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;is. To put simple, Advice is the code that implements the&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Aspect&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;. In general, an&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Aspect&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;defines the functionality in a more abstract manner. But, it is this&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Advice&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;that provides a&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Concrete code Implementation&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;for the&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Aspect&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black"&gt;4) Creating Advices in Spring&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;As mentioned previously,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Advice&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;refers to the actual&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;implementation&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;code for an&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Aspect&lt;/i&gt;&lt;/b&gt;. Other Aspect Oriented &lt;span class="ilad"&gt;Programming Languages&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;also provide support for&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Field Aspect&lt;/i&gt;&lt;/b&gt;, i.e. intercepting a field before its value gets affected. But Spring provides support only&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Method Aspect&lt;/i&gt;&lt;/b&gt;. The following are the different types of aspects available in Spring.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul type="disc"&gt;  &lt;li class="MsoNormal" style="color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;mso-list:l1 level1 lfo6;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;Before&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal" style="color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;mso-list:l1 level1 lfo6;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;After Advice&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal" style="color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;mso-list:l1 level1 lfo6;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;Throws&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal" style="color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;mso-list:l1 level1 lfo6;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;Around Advice&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;4.1) Before Advice&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Before&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;is used to intercept before&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;the method&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;execution&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;starts. In AOP, Before&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;Advice&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;is represented in the form of&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;org.springframework.aop.BeforeAdvice&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;. For example, a System should make security check on users before allowing them to accessing resources. In such a case, we can have a Before&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;that contains code which implements the User&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;Authentication&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Logic.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Consider the following piece of Code,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Authentication.java&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;code&gt;&lt;span style="font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public class Authentication extends BeforeAdvice{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public void before(Method method, Object[] args, Object target) throws Throwable{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;if (args[0] instanceof User){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;User user = (User)args[0];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;// Authenticate if he/she is the right user.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:2"&gt;                               &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;The above class extends&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;BeforeAdvice&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;, thereby telling that&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black"&gt;before()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;method will be called before the&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;execution&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;of the method&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;call.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;4.2) After Advice&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;After&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;will be useful if some logic has to be executed before&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Returning&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;the Control&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;within a method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;execution. This&lt;span class="apple-converted-space"&gt; &lt;/span&gt;advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;is represented by the interface&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;org.springframework.aop.AfterReturningAdvice&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;. For example, it is common in Application to Delete the Session Data and the various information pertaining to a user, after he has logged out from the Application. These are ideal candidates for&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;After&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;/i&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;CleanUpOperation.java&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;code&gt;&lt;span style="font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public class CleanUpOperation implements AfterReturningAdvice {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public void afterReturning(Object returnValue, Method method, Object[] args, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;Object target) throws Throwable{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// Clean up session and user information.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Note that,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;afterReturning()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;will be method that will be called once&lt;span class="apple-converted-space"&gt; &lt;/span&gt;the method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;returns normal&lt;span class="apple-converted-space"&gt; &lt;/span&gt;execution. If some exception happens in&lt;span class="apple-converted-space"&gt; &lt;/span&gt;the method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;execution&lt;span class="apple-converted-space"&gt; &lt;/span&gt;the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;afterReturning()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;method will never be called.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;4.3) Throws Advice&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;When some kind of exception happens during the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;execution&lt;span class="apple-converted-space"&gt; &lt;/span&gt;of a method, then to handle the exception properly,&lt;b&gt;&lt;i&gt;Throws&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;can be used through the means of&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;org.springframework.aop.ThrowsAdvice&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;. Note that this interface is a&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;marker interface&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;meaning that it doesn't have any method within it.&lt;span class="apple-converted-space"&gt; &lt;/span&gt;The method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;signature inside the&lt;b&gt;&lt;i&gt;Throws&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;can take any of the following form,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public class DeleteFile implements ThrowsAdvice{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public void afterThrowing(Method method, Object[] args, Object target, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;IOException exception){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;String targetFileName = (String)args[2];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// Code to delete the target file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;&lt;span style="mso-tab-count:3"&gt;                                    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Note that the above method will be called when an Exception, that too of type&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;IOException&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;is thrown by the File Copy Program.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;4.4) Around Advice&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;This&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;is very different from the other types of&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;that we have seen before, because of the fact that, this Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;provides finer control whether the target method has to be called or not. Considering the above advices, the return type of&lt;span class="apple-converted-space"&gt; &lt;/span&gt;the method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;signature is always&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;void&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;meaning that, the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;itself cannot change the return arguments of&lt;span class="apple-converted-space"&gt; &lt;/span&gt;the method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;call. But&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Around&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;can even change the return type, thereby returning a brand new object of other type if needed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public class ValidateArguments implements MethodInterceptor {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public Object invoke(MethodInvocation invocation) throws Throwable {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;Object arguments [] = invocation.getArguments()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;if ((arguments[0] instanceof Parent) &amp;amp;&amp;amp; (arguments[1] instanceof Child) ){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;Object returnValue = invocation.proceed();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;return returnValue;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;throw new Exception ("Arguments are of wrong type");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:2"&gt;                               &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;h2 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black"&gt;5) Creating Point Cuts in Spring&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;Point Cuts&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;define where exactly the Advices have to be applied in various&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Join Points&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;. Generally they act as&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Filters &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;for the application of various Advices into the real implementation. Spring defines two types of&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Point Cuts&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; ,&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Static&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;and the&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Dynamic Point Cuts&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;. The following&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="ilad"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;section&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;covers only about the Static Point Cuts as Dynamic Point Cuts are rarely used&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;The class filter&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public class MyClassFilter implements ClassFilter{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public boolean matches(Class classObject){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;String className = classObject.getName();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// Check whether the class objects should be advised based on their name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;if (shouldBeAdviced(className) ){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;return true;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:2"&gt;                               &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;The method filter&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;class MyMethodMatcher implements MethodMatcher{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public boolean matches(Method m, Class targetClass){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;String methodName = m.getName();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;if (methodName.startsWith("get")){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;return true;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public boolean isRuntime(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public boolean matches(Method m, Class target, Object[] args);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// This method wont be called in our case. So, just return false.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;class MyMethodMatcher implements MethodMatcher{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public boolean matches(Method m, Class targetClass){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;String methodName = m.getName();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;if (methodName.startsWith("get")){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;return true;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public boolean isRuntime(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public boolean matches(Method m, Class target, Object[] args);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;// This method wont be called in our case. So, just return false.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="apple-style-span"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Suppose we wish that only the methods&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;getMethod1()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;and&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;getMethod2()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;should be given&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Advice&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;by some aspect. In that case, we can have the following&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Configuration file&lt;span class="apple-converted-space"&gt; &lt;/span&gt;that achieves this,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-tab-count: 4"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;bean id="getMethodsAdvisor" &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;property name="mappedName"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;value&gt;get*&lt;/value&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;/property&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;/bean&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;The Expression&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;get*&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;tells that all&lt;span class="apple-converted-space"&gt; &lt;/span&gt;method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;names starting with the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;name&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;get&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;will be given&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Advices&lt;/i&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;The sample Application&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;a) Introduction&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Let is illustrate the various types of Advices (&lt;b&gt;&lt;i&gt;Before&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;Advice&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;After Advice&lt;/i&gt;&lt;/b&gt;,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Throws&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;and&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Around Advice&lt;/i&gt;&lt;/b&gt;) that we saw before in this&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;sample Application&lt;/span&gt;. For this&lt;span class="apple-converted-space"&gt; &lt;/span&gt;sample application&lt;span class="apple-converted-space"&gt; &lt;/span&gt;let us define TaxCalculator Service which provides logic for calculating tax. The various classes involved in Application along with the Advices in the subsequent sections.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;b) TaxCalculator.java&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;This is the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;interface&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;definition&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;for the TaxCalculator Service. The&lt;span class="apple-converted-space"&gt; &lt;/span&gt;interface&lt;span class="apple-converted-space"&gt; &lt;/span&gt;name is&lt;span class="apple-converted-space"&gt; &lt;/span&gt;TaxCalculator&lt;span class="apple-converted-space"&gt; &lt;/span&gt;and it has one single&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;method&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;called &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;calculateTax()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;taking two&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;arguments&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;both of type long.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span lang="PT" style="font-size:10.0pt;font-family:Tahoma;color:black; mso-ansi-language:PT"&gt;TaxCalculator.&lt;span class="ilad"&gt;java&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span lang="PT" style="font-size:10.0pt;font-family:Tahoma;color:black;mso-ansi-language: PT"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="ilad"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="ilad"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;package&lt;/span&gt;&lt;/span&gt;&lt;span class="ilad"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma"&gt; com.vapps.util;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="ilad"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="ilad"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public interface TaxCalculator {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="ilad"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="ilad"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public double calculateTax(long salary);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="ilad"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="ilad"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;c) TaxCaculatorImpl.java&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;The&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="ilad"&gt;implementation&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;class for the TaxCalculator Service. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span lang="PT" style="font-size:10.0pt;font-family:Tahoma;color:black; mso-ansi-language:PT"&gt;TaxCalculator.java&lt;/span&gt;&lt;/b&gt;&lt;span lang="PT" style="font-size:10.0pt;font-family:Tahoma;color:black;mso-ansi-language:PT"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;&lt;span style="mso-tab-count: 4"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;font-weight:normal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;package com.vapps.util.impl;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;public class TaxCalculatorImpl implements TaxCalcultor {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public double&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;calculateTax(long salary){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;if(salary&lt;160000){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;&lt;span style="mso-tab-count:2"&gt;                        &lt;/span&gt;return 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;}else{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;&lt;span style="mso-tab-count:2"&gt;                        &lt;/span&gt;return (salary*30/100);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;&lt;span style="mso-tab-count:1"&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;font-weight:normal"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;d) Before Advice Implementation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;This is the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Before&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;for the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;TaxCalculator &lt;/i&gt;&lt;/b&gt;Implmentation class. This class implements the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;before()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;in the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;MethodBeforeAdvice&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;interface&lt;span class="apple-converted-space"&gt; &lt;/span&gt;by simply outputting a message telling that this&lt;span class="apple-converted-space"&gt; &lt;/span&gt;advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;is called.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;LogBeforeCallAdvice.java&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;package com.vapps.util;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;import java.lang.reflect.Method;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;import org.springframework.aop.MethodBeforeAdvice;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public class LogBeforeCallAdvice implements MethodBeforeAdvice{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public void before(Method method, Object[] args, Object target) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;System.out.println("Entering the method");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;e) After Advice Implementation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;The After&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Call&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;implements the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;AfterReturningAdvice&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;interface&lt;span class="apple-converted-space"&gt; &lt;/span&gt;providing&lt;span class="apple-converted-space"&gt; &lt;/span&gt;implementation&lt;span class="apple-converted-space"&gt; &lt;/span&gt;for the&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;afterReturning()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;method. Like the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Before&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;implementation, this&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;also outputs a simple message to the console.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;LogAfterReturningAdvice.java&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;package com.vapps.util;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;import java.lang.reflect.Method;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;import org.springframework.aop.AfterReturningAdvice;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public class LogAfterReturningAdvice implements AfterReturningAdvice{&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public void afterReturning(Object returnValue, Method method, Object[] args, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;Object target) throws Throwable {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;System.out.println("Exiting the Method");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;f) Throws Advice Implementation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;This&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;will be called when some kind of&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;Exception&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;is caught during the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;invocation. We have added a simple logic to simlate the exception when the user inputs are 0 and 0.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;LogAfterThrowsAdvice.java&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;package com.vapps.util;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;import java.lang.reflect.Method;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;import org.springframework.aop.ThrowsAdvice;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public class LogAfterThrowsAdvice implements ThrowsAdvice{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public void afterThrowing(Method method, Object[] args, Object target, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;Exception exception){&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;System.out.println("Serious error occurred " + method.getName());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;h) Around Advice Implementation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;This&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;takes the entire control during the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Execution&lt;/i&gt;&lt;/b&gt;. It decides whether the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;add()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;should be called or not based on the user inputs. Note that, only if the user inputs are not 0 and 0, then the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;add()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;will be called through&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;MethodInvocation.proceed()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;LogAroundAdvice.java&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;package com.vapps.util;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;import org.aopalliance.intercept.*;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public class LogAroundAdvice implements MethodInterceptor{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public Object invoke(MethodInvocation methodInvocation) throws Throwable {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;Object arguments[] = methodInvocation.getArguments();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;int number1 = ((Integer)arguments[0]).intValue();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;if (number1 &lt;=0 ){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;throw new Exception("Salary Cann’t be zero/negative");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;return methodInvocation.proceed();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:2"&gt;                        &lt;/span&gt;&lt;span style="mso-tab-count: 2"&gt;                        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;i) Configuration File&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;The Configuration File has 3 sections. One section is the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Bean&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Definition&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Section&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;which is the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;definition&lt;span class="apple-converted-space"&gt; &lt;/span&gt;set for all the 4 advices which we saw before. All the advices are given identifiers like&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;'beforeCall'&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;'afterCall'&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;,&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;'throwCall'&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;and&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;'aroundCall'&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;. Then contains the Bean&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Definition&lt;span class="apple-converted-space"&gt; &lt;/span&gt;for the Add&lt;span class="apple-converted-space"&gt; &lt;/span&gt;implementation&lt;span class="apple-converted-space"&gt; &lt;/span&gt;class which is giving the identifier&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;'adderImpl'&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;The next interesting section is how to&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;bind these advices to the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;implementation&lt;span class="apple-converted-space"&gt; &lt;/span&gt;code&lt;/i&gt;&lt;/b&gt;. For this, we have to depend on&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;ProxyFactory Bean&lt;/i&gt;&lt;/b&gt;. This Bean is used to create Proxy objects for the Add&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Implementation&lt;span class="apple-converted-space"&gt; &lt;/span&gt;class along with the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;span class="apple-converted-space"&gt; &lt;/span&gt;implementation. Note that the property&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;'proxyInterfaces'&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;contains the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Interface&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Name for which the proxy class has to ge generated. In our case, it is going to be the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;Adder&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;interface. The&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;'interceptorNames'&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;property takes a list of Advices to be applied to the dynamically generated proxy class. We have given all the 4 advices to this property. Finally the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;implementation&lt;span class="apple-converted-space"&gt; &lt;/span&gt;class for the Adder service is given in the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;'target'&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;property.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;aop-test.xml&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;beans xmlns="http://www.springframework.org/schema/beans"&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;xsi:schemaLocation="http://www.springframework.org/schema/beans &lt;span style="color:black"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;!-- Advices --&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;bean id = "beforeCall"&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;class = " com.vapps.util.LogBeforeCallAdvice" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;bean id = "afterCall"&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;class = " com.vapps.util.LogAfterReturningAdvice" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;bean id = "throwCall"&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;class = " com.vapps.util.LogAfterThrowsAdvice" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;bean id = "aroundCall"&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;class = " com.vapps.util.LogAroundAdvice" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;!-- Implementation Class --&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;bean id = "taxImpl"&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;class = " com.vapps.util.impl.AdderImpl" /&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;!-- Proxy Implementation Class --&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;bean id = "tax"&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;class = "org.springframework.aop.framework.ProxyFactoryBean"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;property name = "taxInterface"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;&lt;value&gt; com.vapps.util.TaxCalculator&lt;/value&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;/property&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;property name = "interceptorNames"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;&lt;list&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;&lt;value&gt;beforeCall&lt;/value&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;         &lt;/span&gt;&lt;value&gt;afterCall&lt;/value&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;&lt;value&gt;throwCall&lt;/value&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;&lt;value&gt;aroundCall&lt;/value&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;&lt;/list&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;/property&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;property name = "target"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;&lt;ref bean = "taxImpl"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;/property&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;/bean&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;/beans&gt;&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="margin:0cm;margin-bottom:.0001pt"&gt;&lt;span style="font-size:10.0pt; font-family:Tahoma;color:black;font-weight:normal"&gt;j) Test Class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Following is the test class for the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;Adder&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;Service. The code loads the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Bean&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Definition&lt;span class="apple-converted-space"&gt; &lt;/span&gt;File&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;by depending on the&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;BeanFactory&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;class. Watch carefully in the output for the various&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Advices&lt;/i&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;getting called. Also, we have made to activate the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Simulated Exception&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;by passing&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;0&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;and&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;0&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;as&lt;span class="apple-converted-space"&gt; &lt;/span&gt;arguments&lt;span class="apple-converted-space"&gt; &lt;/span&gt;to the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10.0pt;font-family:Tahoma;color:black"&gt;add()&lt;/span&gt;&lt;/code&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family: Tahoma;color:black"&gt;method&lt;span class="apple-converted-space"&gt; &lt;/span&gt;call thereby making use of the&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;Throws&lt;span class="apple-converted-space"&gt; &lt;/span&gt;Advice&lt;/i&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span lang="PT" style="font-size:10.0pt;font-family:Tahoma;color:black; mso-ansi-language:PT"&gt;TaxCalculatorTest.java&lt;/span&gt;&lt;/b&gt;&lt;span lang="PT" style="font-size:10.0pt;font-family:Tahoma;color:black;mso-ansi-language:PT"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;package com.vapps.util.test;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;import org.springframework.beans.factory.BeanFactory;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;import org.springframework.beans.factory.xml.XmlBeanFactory;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;import org.springframework.core.io.*;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;public class TaxCalculatorTest {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;public static void main(String args[]){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;Resource resource = new FileSystemResource("./src/aop-test.xml");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;       &lt;/span&gt;BeanFactory factory = new XmlBeanFactory(resource);&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;TaxCalculator taxCalculator = (TaxCalculator)factory.getBean("tax");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;int result = taxCalculator.calculateTax(10000000);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;System.out.println("Result = " + result);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;}&lt;span style="color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre style="background:#EFEFEF"&gt;&lt;span style="font-family:Tahoma;color:black"&gt;&lt;span style="mso-tab-count:4"&gt;                                                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt;&lt;span style="text-decoration:none"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma;color:#222222"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-top:2.4pt;margin-right:0cm;margin-bottom:6.0pt;margin-left: 0cm;line-height:15.6pt"&gt;&lt;u&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:#00003F"&gt;Aspect Oriented Programming and Java:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/h3&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;AOP is a concept, so it is not bound to a specific programming language. In fact, it can help with the shortcomings of all languages (not only OO languages) that use single, hierarchical decomposition. AOP has been implemented in different languages (for example, C++, Smalltalk, C#, C, and Java).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Of course, the language that gains a great interest of the research community is the Java language. The following is a list of tools that support AOP with Java:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top:0cm;margin-right:12.0pt;margin-bottom: 0cm;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;line-height: 13.5pt;mso-list:l0 level1 lfo2;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Symbol;mso-fareast-font-family:Symbol; mso-bidi-font-family:Symbol;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;·&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;a href="http://eclipse.org/aspectj" target="new"&gt;&lt;span style="color:#0021B5;text-decoration:none;text-underline:none"&gt;AspectJ&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top:0cm;margin-right:12.0pt;margin-bottom: 0cm;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;line-height: 13.5pt;mso-list:l0 level1 lfo2;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Symbol;mso-fareast-font-family:Symbol; mso-bidi-font-family:Symbol;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;·&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;a href="http://aspectwerkz.codehaus.org/index.html" target="new"&gt;&lt;span style="color:#0021B5;text-decoration:none;text-underline:none"&gt;AspectWerkz&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top:0cm;margin-right:12.0pt;margin-bottom: 0cm;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;line-height: 13.5pt;mso-list:l0 level1 lfo2;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Symbol;mso-fareast-font-family:Symbol; mso-bidi-font-family:Symbol;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;·&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;a href="http://www.research.ibm.com/hyperspace/HyperJ/HyperJ.htm" target="new"&gt;&lt;span style="color:#0021B5;text-decoration:none;text-underline:none"&gt;Hyper/J&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top:0cm;margin-right:12.0pt;margin-bottom: 0cm;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;line-height: 13.5pt;mso-list:l0 level1 lfo2;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Symbol;mso-fareast-font-family:Symbol; mso-bidi-font-family:Symbol;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;·&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;a href="http://jac.aopsys.com/" target="new"&gt;&lt;span style="color:#0021B5;text-decoration:none;text-underline:none"&gt;JAC&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top:0cm;margin-right:12.0pt;margin-bottom: 0cm;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;line-height: 13.5pt;mso-list:l0 level1 lfo2;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Symbol;mso-fareast-font-family:Symbol; mso-bidi-font-family:Symbol;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;·&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;a href="http://javalab.cs.uni-bonn.de/research/jmangler" target="new"&gt;&lt;span style="color:#0021B5;text-decoration:none;text-underline:none"&gt;JMangler&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top:0cm;margin-right:12.0pt;margin-bottom: 0cm;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;line-height: 13.5pt;mso-list:l0 level1 lfo2;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Symbol;mso-fareast-font-family:Symbol; mso-bidi-font-family:Symbol;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;·&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;a href="http://staff.aist.go.jp/y-ichisugi/mj/" target="new"&gt;&lt;span style="color:#0021B5;text-decoration:none;text-underline:none"&gt;MixJuice&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top:0cm;margin-right:12.0pt;margin-bottom: 0cm;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;line-height: 13.5pt;mso-list:l0 level1 lfo2;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Symbol;mso-fareast-font-family:Symbol; mso-bidi-font-family:Symbol;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;·&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;a href="http://www.inf.ethz.ch/department/IS/iks/project_home_pages/prose/" target="new"&gt;&lt;span style="color:#0021B5;text-decoration:none;text-underline:none"&gt;PROSE&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top:0cm;margin-right:12.0pt;margin-bottom: 0cm;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;line-height: 13.5pt;mso-list:l0 level1 lfo2;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Symbol;mso-fareast-font-family:Symbol; mso-bidi-font-family:Symbol;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;·&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;a href="http://www.cs.washington.edu/homes/jonal/archjava/" target="new"&gt;&lt;span style="color:#0021B5;text-decoration:none;text-underline:none"&gt;ArchJava&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top:0cm;margin-right:12.0pt;margin-bottom: 0cm;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-18.0pt;line-height: 13.5pt;mso-list:l0 level1 lfo2;tab-stops:list 36.0pt"&gt;&lt;span style="font-size:10.0pt;font-family:Symbol;mso-fareast-font-family:Symbol; mso-bidi-font-family:Symbol;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;·&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;Spring&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;AspectJ, created at Xerox PARC, was proposed as an extension of the Java language for AOP. The rest of this article is related to AspectJ terminology.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-top:0cm;margin-right:0cm;margin-bottom:18.0pt;margin-left: 0cm;line-height:13.5pt"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma; color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;Source: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;a href="http://developers.com/"&gt;http://developers.com&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;a href="http://ibm.com/"&gt;http://ibm.com&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;a href="http://onjava.com/"&gt;http://onjava.com&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:Tahoma"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5392514751439056484-2517393877778679015?l=sougatabh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sougatabh.blogspot.com/feeds/2517393877778679015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5392514751439056484&amp;postID=2517393877778679015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/2517393877778679015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/2517393877778679015'/><link rel='alternate' type='text/html' href='http://sougatabh.blogspot.com/2010/01/overview-of-aop.html' title='Overview of AOP'/><author><name>Sougata Bhattacharya</name><uri>https://profiles.google.com/109135287352492336016</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5392514751439056484.post-4134560452138807188</id><published>2008-11-15T10:17:00.000-08:00</published><updated>2008-11-15T20:26:23.886-08:00</updated><title type='text'>User Guide to Java Server Faces</title><content type='html'>&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;span style="font-family:verdana;"&gt;Introduction:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;JavaServer Faces technology provides a custom renderer and a JSP custom tag library for rendering to an HTML client, allowing developers of Java Platform, Enterprise Edition (Java EE) applications to use JavaServer Faces technology in their applications.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;This is flexible, leverage existing, standard UI and web-tier concept without forcing developer to particular mark-up language,protocol, or client device.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;JavaServer Faces architecture also clearly defines a separation between application logic and presentation while making it easy to connect the presentation layer to the application code.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;font-family:verdana;font-size:100%;"  &gt;Why JSF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;JSF is standard comes with part of J2EE 1.5&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;It exposes component and event based programming model.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Huge vendor and industry support&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;JSF Architecture&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_bf1DMoAuNCs/SR-goe-G43I/AAAAAAAAAQw/Lz0pFEA3f5E/s1600-h/jsfarc.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 214px;" src="http://1.bp.blogspot.com/_bf1DMoAuNCs/SR-goe-G43I/AAAAAAAAAQw/Lz0pFEA3f5E/s320/jsfarc.JPG" alt="" id="BLOGGER_PHOTO_ID_5269106706415543154" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;One of the key advantages of JSF is that it is both a Java Web user-interface standard as well as a framework that follows the Model-View-Controller(MVC) design pattern. This makes JSF applications much more manageable because the user-interface code (View) is cleanly separated from the application data and logic (Model). To prepare the JSF context, which provides application data access to the pages, and to guard against unauthorized or improper access of the pages, all user interactions with the application are handled by a front-end "Faces" servlet (Controller).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;span style="font-family:verdana;"&gt;JSF Lifecycle&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_bf1DMoAuNCs/SR-g01rhxhI/AAAAAAAAAQ4/dco8OIU79Vo/s1600-h/jsf-lifecycle.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 178px;" src="http://2.bp.blogspot.com/_bf1DMoAuNCs/SR-g01rhxhI/AAAAAAAAAQ4/dco8OIU79Vo/s320/jsf-lifecycle.gif" alt="" id="BLOGGER_PHOTO_ID_5269106918670059026" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;The above six phase discussion.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Restore View:&lt;/span&gt;&lt;br /&gt;The restore view phase will either create a fresh view or restore an existing view, if one exists earlier. JSF stores all views and their component states within an object called the FacesContext. When the FacesServlet controller receives a request it examines the view id to determine if there is an existing copy of the view in storage. The FacesContext object contains all the state information JSF needs to manage the GUI component’s state for the current request in the current session. The FacesContext stores the view in its viewRoot property; viewRoot contains all the JSF components for the current view ID and the components state. Once the view has been created, or retrieved, JSF advances directly to the render response phase.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Apply Request Values&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The purpose of the apply request values phase is for each component to retrieve its current state. During this phase the JSF runtime performs the job of processing name-value pairs from the incoming request. JSF assigns the request values to the components by calling the decode() method on each component in the view hierarchy. The decode() method process’ the request value and assigns it to the local value attribute of the component. If there are any errors during the value assignment an error message is generated and queued in the FacesContext object, where it will be displayed during the render response phase. If a component’s immediate attribute is set to true, then conversion, validation and events associated with the component are processed in this time.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Process Validation:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Validation occurs when the JSF runtime calls processValidator() method of each component, in the component hierarchy. The process validation first initiate if there is any data conversion required for validating component value against application validation rules. If validation failed error message is generated and queued in FacesContext object.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Update Model Values:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;JSF runtime initiates the updateModel() method of each UI component. Here property of managed bean has been update with each UI component new value&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Invoke Application:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;During this phase any action handler or event listener is called for each UI component. In this phase any db call happens. In this phase page navigation also can happen. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;font-size:85%;"  &gt;Render Response&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The final phase of JSF lifecycle displays the view of all UI components in their current updated state. The render response phase also saves the current state of the view in the FacesContext object for subsequent view request or sever-side operations.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;font-family:verdana;font-size:100%;"  &gt;Application Configuration &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;An XML file (Usually named as faces-config.xml) configured to all the configuration for &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;navigation rules, converters, validators, render kits&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;Backing Bean&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The model of MVC is a Server-side objects associated with UI components used in the page. Here we define UI component properties each of which bound to a component value or components instance. In the backing bean we define methods which is associated with a component, which include validation, event listener and navigation processing.&lt;br /&gt;&lt;span style="font-size:100%;"&gt; &lt;span style="font-weight: bold;"&gt;Important Classes&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;UIViewRoot&lt;br /&gt;This is the UIComponent represents the root of UIComponent tree.&lt;br /&gt;FacesContext&lt;br /&gt;This contains all of the per-request state information related to the processing of a single&lt;br /&gt;JavaServer Faces request, and the rendering of the corresponding response.&lt;br /&gt;PhaseListener&lt;br /&gt;An interface implemented by objects that wish to be notified at the beginning and ending of processing for each standard phaseof the request processing lifecycle. We can have our own PhaseListener to handle request handling. (e.g Ajax request handling)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;FAQ:&lt;/span&gt;&lt;br /&gt;1.    Is JSF part of J2EE&lt;br /&gt;   Ans:JSF 1.0 was not, but 1.2 is a part of J2EE 5, and JSF 2.0 is part of J2EE 6.&lt;br /&gt;&lt;br /&gt;2.    Is JSF replacement of Struts&lt;br /&gt;Ans . Struts provide a MVC out of the box framework. Where as Since JSF focused on user interface component and view component and it has MVC too.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5392514751439056484-4134560452138807188?l=sougatabh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sougatabh.blogspot.com/feeds/4134560452138807188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5392514751439056484&amp;postID=4134560452138807188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/4134560452138807188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/4134560452138807188'/><link rel='alternate' type='text/html' href='http://sougatabh.blogspot.com/2008/11/user-guide-to-java-server-faces.html' title='User Guide to Java Server Faces'/><author><name>Sougata Bhattacharya</name><uri>https://profiles.google.com/109135287352492336016</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_bf1DMoAuNCs/SR-goe-G43I/AAAAAAAAAQw/Lz0pFEA3f5E/s72-c/jsfarc.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5392514751439056484.post-885507940472174911</id><published>2008-09-13T11:07:00.000-07:00</published><updated>2010-01-04T02:02:57.458-08:00</updated><title type='text'>Tech Talks</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;Hi Guys,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;Welcome Guys to my blog. This blog is mostly based on my study I have done from various internet sources and some of the real time project I have been working with.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;Would like to get some interesting notes from you too.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Thanks&lt;br /&gt;Sougata&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5392514751439056484-885507940472174911?l=sougatabh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sougatabh.blogspot.com/feeds/885507940472174911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5392514751439056484&amp;postID=885507940472174911' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/885507940472174911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5392514751439056484/posts/default/885507940472174911'/><link rel='alternate' type='text/html' href='http://sougatabh.blogspot.com/2008/09/tech-talks.html' title='Tech Talks'/><author><name>Sougata Bhattacharya</name><uri>https://profiles.google.com/109135287352492336016</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
