tag:blogger.com,1999:blog-10849871755610480592024-02-20T16:52:56.121-08:00Technology SpeakAnonymoushttp://www.blogger.com/profile/08995975401793637016noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-1084987175561048059.post-31752356896677615052014-01-13T03:34:00.001-08:002014-01-13T03:37:30.932-08:00OAuth Simplified<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">OAuth 2.0 is an authorization protocol which applications
can use for accessing each other data. A more common scenario which you all
have seen is to login into a website using your Facebook or Google account. In
this article we will understand OAuth 2.0 protocol which is release in Oct 2012.
It is much simpler than its previous version 1.0, as 1.0 involve certificate
which is removed from 2.0. OAuth protocol will have following participants<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br />
<ol style="text-align: left;">
<li><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">Resource
Owner</span></li>
<li><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">Resource
Server</span></li>
<li><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">Client
Application</span></li>
<li><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">Authorization
Server</span></li>
</ol>
</div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">The
resource owner can be a user or application which has data that can be share
with other application. For example an user on Facebook or Google can be
consider as Resource Owner and his profile/account data can be consider as
resource.</span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">The
Resource Server is the application which stores resource like Facebook and
Google can be consider as Resource Server. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">The
client application is the application which request for accessing resources. Lastly
Authorization server is the server for authorizing (credential validation logic)
a client application to access resource hosted by Resource Server. Usually Resource
servers itself host logic for credential validation but OAuth specification has
specified it as a separate component. It’s up to our use case where to
implement authorizing logic.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">Now we have understanding of OAuth components we will see
how OAuth works.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">Before a Client application can request a resource access,
it needs to register itself with Authorization server. This is one time task in
which Authorization Server provides a client ID and client secret. Client will
also specify a URI on which Authorization server will redirect when
authorization is successful. This credential will recognize client in future
communication with authorization server. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">Client application needs to provide a link or button asking
user to log in using Authorization server like Facebook or Google. Clicking on
button will redirect resource owner to Authorization server and owner will get validate
by providing credentials. This URI is referred as Authorization Endpoints in
OAuth 2.0 specification. An Authorization server will then ask User/resource
owner to grant access to client application for accessing resource. Once User accepts
it, Authorization server will redirect user to client application URI. This is
the same URI client has registered with Authorization server at the time of registration.
This URI is reference as Redirect endpoint in OAuth 2.0 specification. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">In OAuth 2.0 specification there can be 4 types of Authorization
Grant<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br />
<ol style="text-align: left;">
<li><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">Authorization
Code</span></li>
<li><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">Implicit</span></li>
<li><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">Resource
Owner and password</span></li>
<li><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">Client
credentials</span></li>
</ol>
</div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">In </span><b style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;">Authorization code</b><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 115%;"> when user accepts the
authorization grant to client application, it will redirect to client
application URI along with an Authorization code in response. Client
application will then request Access Token URI on Authorization Server with
Client ID, Client Secret and Authorization Code as request parameters and will
get access token in response. Client application will then use Access Token with
further communication. The Access token can be expired after a period and
client application will again need to request an access token. Access token URI
is referenced as Token endpoint in OAuth specification.</span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">The <b>Implicit Authorization grant</b> is similar
to authorization code except instead of returning an Authorization code,
Authorization server will return access token itself which can then be used for
further communication.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">In <b>Resource owner password</b> Authorization
grant user provides its Authorization server credentials to client application.
For example a user enters Facebook or Google account credentials on client
application. Client application would then use username and password for
further communicating with Facebook or Google. This type of Authorization grant
will be used in highly trusted client application.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">The
Client credentials authorization code works when client application need to
access resource which are not related to any specific resource owner.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">For Further
details on request and response structure please refer <a href="http://tools.ietf.org/html/rfc6749">http://tools.ietf.org/html/rfc6749</a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;">If you are
on Java side then you can use Apache Oltu or Spring security as OAuth provider
for your application. Please visit below for more details.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;"><a href="http://oltu.apache.org/download.html">http://oltu.apache.org/download.html</a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif; font-size: 10.0pt; line-height: 115%;"><a href="http://docs.spring.io/spring-security/oauth/">http://docs.spring.io/spring-security/oauth/</a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/08995975401793637016noreply@blogger.com0tag:blogger.com,1999:blog-1084987175561048059.post-28699156556866579672013-12-27T05:21:00.001-08:002013-12-27T05:21:15.527-08:00Dive into WSDL<div dir="ltr" style="text-align: left;" trbidi="on">
<div align="center" class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Cambria","serif";">Everybody who is
working with web service knows about WSDL document. WSDL stands for web service
descriptive language and is used for describing a web service in language &
implementation independent way. When I say language independent, means it is an
xml document. WSDL document provides a detail description about a web service,
about operation supported by web service, input and output parameter of an
operation. With number of web service framework available, writing a web
service is merely placing some annotations on business java class. Framework
like CXF and others application server provides utility to generate a WSDL
document using Java code and vice versa. With the use of utility we normally
didn’t have to deal with different elements of WSDL document. But knowing about
WSDL elements detail will help us to debug our application effectively.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Cambria","serif";"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Cambria","serif";">I have created a
sample web service project. You can access complete project from Git repository
<a href="https://github.com/vcjain/webservice.git">https://github.com/vcjain/webservice.git</a>
and can refer to employee.wsdl document.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Cambria","serif";"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Cambria","serif";">A WSDL document
has below top elements and they include other elements in turn.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
</div>
<ol style="text-align: left;">
<li><span style="font-family: Cambria, serif;">Definitions</span></li>
<li><span style="font-family: Cambria, serif;">Types</span></li>
<li><span style="font-family: Cambria, serif;">Message</span></li>
<li><span style="font-family: Cambria, serif;">Port Type</span></li>
<li><span style="font-family: Cambria, serif;">Binding</span></li>
<li><span style="font-family: Cambria, serif;">Service</span></li>
</ol>
<br />
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Cambria","serif";">The
<definitions> element</span></b><span style="font-family: "Cambria","serif";">
is a root element and specifies namespace for different XML schemas. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 6.65in;" valign="top" width="638">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><definitions
name="employee" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> xmlns:tns="http://cxfsoap.vcjain.com/"
xmlns="http://schemas.xmlsoap.org/wsdl/"<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://cxfsoap.vcjain.com/"></span><span style="color: teal; font-family: Consolas; font-size: 10.0pt;"><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Cambria","serif";">The name attribute is merely a name given
to a WSDL document. It is not used in any processing and acts as an identifier
only. In above example we have used default namespace for WSDL schema hence we can
avoid prefix on a wsdl schema element in rest of document. The targetNamespace
attribute will identify the namespace for element define in the WSDL document. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Cambria","serif";">The
<types> element</span></b><span style="font-family: "Cambria","serif";"> is
used to define any custom data type used in web service. For an example in our
web service we have a POJO object Employee which is an input parameter in
addEmployee operation. We can define Employee schema in <types> element.
We can also import a schema specifying a location. Prefer to define all imports
before defining any XML element. Below is how a <types> element
declaration looks like in the WSDL document<o:p></o:p></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 6.65in;" valign="top" width="638">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><types><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <import namespace=" <a href="http://cxfsoap.vcjain.com/">http://cxfsoap.vcjain.com/</a>" location="http://cxfsoap.vcjain.com/department.xsd"/><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <xsd:schema
targetNamespace="http://cxfsoap.vcjain.com/"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><!—Defining
Employee object</span><span style="font-family: Wingdings; font-size: 9.0pt; mso-ascii-font-family: Cambria; mso-bidi-font-size: 11.0pt; mso-char-type: symbol; mso-hansi-font-family: Cambria; mso-symbol-font-family: Wingdings;">à</span><span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><xsd:complexType
name="employee"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <xsd:sequence><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <xsd:element
minOccurs="0" name="firstName"
type="xsd:string" /><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <xsd:element
name="ID" type="xsd:long" /><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <xsd:element
minOccurs="0" name="lastName" type="xsd:string"
/><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <xsd:element
maxOccurs="unbounded" minOccurs="0"
name="subjects"<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> nillable="true"
type="xsd:string" /><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </xsd:sequence><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </xsd:complexType><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><!—Defining
Exception</span><span style="font-family: Wingdings; font-size: 9.0pt; mso-ascii-font-family: Cambria; mso-bidi-font-size: 11.0pt; mso-char-type: symbol; mso-hansi-font-family: Cambria; mso-symbol-font-family: Wingdings;">à</span><span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><xsd:element
name="NameMismatchFaultDetails"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <xsd:complexType><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <xsd:sequence><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <xsd:element
name="code" type="xsd:int"></xsd:element><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <xsd:element
name="message" type="xsd:string"></xsd:element><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </xsd:sequence><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </xsd:complexType><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </xsd:element><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </xsd:schema><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </types></span><span style="font-family: "Cambria","serif";"><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Cambria","serif";">In above snippet we have defined two Java
object Employee and NameMisMatchException which are used in our web service.
Other tags are simple XML tag used to define a schema. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Cambria","serif";">The
<message> element</span></b><span style="font-family: "Cambria","serif";">
is used to describe incoming and outgoing messages of the web service. The way
a message is define is based on whether we use messaging style as ‘rpc’ or ‘document’.
In WSDL document we define multiple messages corresponding to input parameter,
out parameter, SOAP headers and faults. A message in itself cannot be
identified as input/output/fault. These messages are further referenced in <porttype>
element to define their basic type (input/output/fault) and associate them with
operations. The name attribute can have any name but it is a good convention to
suffix message with request, response and fault to specify as Input, output and
Exception message.<o:p></o:p></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 6.65in;" valign="top" width="638">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <message
name="addEmpRequest"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <part
name="employee" type="tns:employee"></part><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </message><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <message
name="addEmpResponse"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <part
name="response" type="xsd:string"></part><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </message><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <message
name="NameMisMatchException"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <part
name="NameMisMatchException"
element="tns:NameMismatchFaultDetails"></part><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </message><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <message
name="accept_header"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <part
name="Accept" type="xsd:string"></part><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </message></span><span style="font-family: "Cambria","serif";"><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Cambria","serif";">A message can have a multiple parts. You
can consider each part as a separate argument. If a method in your web service
takes two arguments then we may need to define a message with two parts and each
part representing an argument. In Java for calling a method we need to pass
method argument in specified order hence in WSDL parts will take precedence in
the order in which we define in WSDL document; moreover we can define order of
parts (argument) in operation element under <porttype>. When we implement
a web service in Java we can have only one return type hence an output message
will only have one part. Since a web service can be implemented in any language
other than Java, there is a notion of multiple parts in output message too. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Cambria","serif";">The
<porttype> element</span></b><span style="font-family: "Cambria","serif";">
defines an abstract interface of a Web service. It resemble to a Java
interface, with operation element resembling to Interface methods.<o:p></o:p></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 6.65in;" valign="top" width="638">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><portType name="EmpService"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <operation
name="addEmp"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <input
message="tns:addEmpRequest"></input><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <output
message="tns:addEmpResponse"></output><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <fault name="NameMisMatchException"
message="tns:NameMisMatchException"></fault><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </operation><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </portType></span><span style="font-family: "Cambria","serif";"><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Cambria","serif";">The <operation> element defines
name of operation and input, output and fault parameters. Each<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Cambria","serif";">Operation is composed of at most one
input or output element and any number of fault elements. You can add
parameterOrder attribute to operation tag to define specific order of input
parts.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Cambria","serif";">The
<binding> element</span></b><span style="font-family: "Cambria","serif";">
relates the abstract interface <porttype> element to concrete internet
protocols, messaging styles and encoding styles. The <binding> element is
composed of two different namespace elements, wsdl specific elements and protocol
specific elements. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 6.65in;" valign="top" width="638">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><binding name="EmpServiceBinding"
type="tns:EmpService"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> style="rpc"
/><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <operation
name="addEmp"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <soap:operation
style="rpc" /><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <input><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <soap:body
use="literal" namespace="http://cxfsoap.vcjain.com/"/><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </input><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <output><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <soap:body
use="literal" namespace="http://cxfsoap.vcjain.com/"/><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </output><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <fault
name="NameMisMatchException"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <soap:fault
name="NameMisMatchException" use="literal"
namespace="http://cxfsoap.vcjain.com/"/><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </fault><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </operation><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </binding></span><span style="font-family: "Cambria","serif";"><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Cambria","serif";">Each internet protocol has their own set
of elements which describe protocol specific settings. In above snippet we have
associate <porttype> with a SOAP protocol. Hence you can see different
SOAP protocol specific tag like soap:binding, soap:operation, soap:body in
binding element. If you are using HTTP protocol then you may have define http:binding,
http:operation, http:urlEncoded etc elements. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Cambria","serif";">The soap:binding element specify the
internet protocol used to send soap messages (transport attribute)and default
messaging style for operations (style attribute). J2EE web service only
supports soap protocol and HTTP protocol for message transfer. The
soap:operation element is specific to each operation and can override the
default messaging style define in soap:binding element. The element soap:body
specify encoding style of input, output and fault parameters (use attribute).
It can be set to literal or encoding. If you closely look then you find that
operation element of <binding> is directly associated with the operation
element of <porttype>. In binding element we are associating each port
type operation with its messaging and encoding style and defining a transfer
protocol for a web service. There are some other soap specific elements also like
soap:header, soap:headerfault etc but these are optional.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Cambria","serif";">The
last element is the <service> element</span></b><span style="font-family: "Cambria","serif";"> which associated an endpoint URI (address) with a web
service definition.<o:p></o:p></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 6.65in;" valign="top" width="638">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><service name="EmpService"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <port
name="EmpServicePort" binding="tns:EmpServiceBinding"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> <soap:address
location="http://localhost:8080/cxfsoap/emp" /><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </port><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Cambria","serif"; font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"> </service></span><span style="font-family: "Cambria","serif";"><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Cambria","serif";">The service element may contain one or
more port element, where each port element represents a web service. The type
attribute must have a binding reference.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Cambria","serif";">Conclusion:
</span></b><span style="font-family: "Cambria","serif";">There are two approaches
for developing and publishing a web service, one is to write some Java code and
then generate a WSDL document and another is to create a WSDL document first and
use it for web service implementation. It will be helpful to know basic
knowledge of each element for second approach of web service development. Knowing
about different elements of WSDL document will help us in defining WSDL
document and help us in effective debugging.<o:p></o:p></span></div>
<div align="center" class="MsoNormal" style="text-align: center;">
</div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/08995975401793637016noreply@blogger.com0tag:blogger.com,1999:blog-1084987175561048059.post-14725643804017699842013-12-17T04:08:00.002-08:002013-12-17T04:08:56.451-08:00Profiling Java Application using annotation<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">This blog will provide details of measuring a
performance of a code snippet while developing. This is will very handy to
developer to quickly measure the performance of a method while unit testing.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">Benefits:<o:p></o:p></span></span></b></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">While developing a feature a developer usually missed out
performance parameter which is equally and important nonfunctional requirement.
Ideally a developer must make it as a
practice to test performance of their code along with unit testing and improved
it if it is not fall under acceptance criteria. A quick measurement of
performance is to check the elapse time of a method. Most of the time we monitor
elapse time using System.currentTimeMillis method. But for this we need to add unwanted
statements in our code. Moreover along with elapse time sometime we also
required some further information like mean, minimum, maximum, standard
deviation and transactions per second over a set time span.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">All above task for testing performance can be easily
carried out by using perf4j API. It provides us some annotation placing which
we can profile our code and can get statistic in log statement. We can turn off
profiling any time by removing annotation. It is quicker method to profile code
snippet along with unit testing.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif;"><b><span style="line-height: 115%;">How to use:</span></b><span style="line-height: 115%;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: 'Trebuchet MS', sans-serif; line-height: 115%;">Integrating perf4j API with a project is very easy. Below
are steps to integrate Perf4j with a maven project. </span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">Add following dependency to your pom.xml. If you are
integrating in an existing project then you may have some of them already in
your pom.xml<o:p></o:p></span></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #F2F2F2; border-collapse: collapse; border: none; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184; width: 571px;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 5.95in;" valign="top" width="571">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: teal;"><</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span>org.perf4j<span style="color: teal;"></</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span>perf4j<span style="color: teal;"></</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span>0.9.16<span style="color: teal;"></</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span>compile<span style="color: teal;"></</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!-- if you use the log4j implementation of Perf4J, you
must also include this dependency --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span>log4j<span style="color: teal;"></</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span>log4j<span style="color: teal;"></</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span>1.2.14<span style="color: teal;"></</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span>compile<span style="color: teal;"></</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!-- if you use the commons logging implementation of
Perf4J, you must also include this dependency --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span>commons-logging<span style="color: teal;"></</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span>commons-logging<span style="color: teal;"></</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span>1.0.3<span style="color: teal;"></</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span>compile<span style="color: teal;"></</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!-- if you use the SLF4J implementation of Perf4J, you
must also include this dependency --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span>org.slf4j<span style="color: teal;"></</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span>slf4j-<u>api</u><span style="color: teal;"></</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span>1.5.6<span style="color: teal;"></</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span>compile<span style="color: teal;"></</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!-- if you use also use <u>logback</u> as the SLF4J
underlying <u>impl</u>, you must also include this dependency --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span>ch.qos.logback<span style="color: teal;"></</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><u>logback</u>-classic<span style="color: teal;"></</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span>0.9.15<span style="color: teal;"></</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span>compile<span style="color: teal;"></</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">optional</span><span style="color: teal;">></span>true<span style="color: teal;"></</span><span style="color: #3f7f7f;">optional</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!-- if you use the AOP functionality of Perf4J, you must
also include these 2 dependencies --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span>org.aspectj<span style="color: teal;"></</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><u>aspectjrt</u><span style="color: teal;"></</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span>1.6.1<span style="color: teal;"></</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span>runtime<span style="color: teal;"></</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span>commons-<u>jexl</u><span style="color: teal;"></</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span>commons-<u>jexl</u><span style="color: teal;"></</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span>1.1<span style="color: teal;"></</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span>runtime<span style="color: teal;"></</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!-- if you use Spring to manage the AOP <u>funcionality</u>,
you must also include these 2 dependencies --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span>org.springframework<span style="color: teal;"></</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span>spring<span style="color: teal;"></</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span>2.0.6<span style="color: teal;"></</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span>runtime<span style="color: teal;"></</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span><u>cglib</u><span style="color: teal;"></</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><u>cglib</u><span style="color: teal;"></</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span>2.2<span style="color: teal;"></</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span>runtime<span style="color: teal;"></</span><span style="color: #3f7f7f;">scope</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span>org.aspectj<span style="color: teal;"></</span><span style="color: #3f7f7f;">groupId</span><span style="color: teal;">></span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span><u>aspectjweaver</u><span style="color: teal;"></</span><span style="color: #3f7f7f;">artifactId</span><span style="color: teal;">></span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span>1.6.11<span style="color: teal;"></</span><span style="color: #3f7f7f;">version</span><span style="color: teal;">></span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">dependency</span><span style="color: teal;">></span><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">Add or append following spring configuration to project<o:p></o:p></span></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #F2F2F2; border-collapse: collapse; border: none; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184; width: 469px;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 351.9pt;" valign="top" width="469">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: teal;"><?</span><span style="color: #3f7f7f;">xml</span>
<span style="color: #7f007f;">version</span>=<i><span style="color: #2a00ff;">"1.0"</span></i> <span style="color: #7f007f;">encoding</span>=<i><span style="color: #2a00ff;">"UTF-8"</span></i><span style="color: teal;">?></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"><!-- Note how the aop namespace is defined in the top-level
beans element --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: teal;"><</span><span style="color: #3f7f7f;">beans</span>
<span style="color: #7f007f;">xmlns</span>=<i><span style="color: #2a00ff;">"http://www.springframework.org/schema/beans"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #7f007f;">xmlns:xsi</span>=<i><span style="color: #2a00ff;">"http://www.w3.org/2001/XMLSchema-instance"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #7f007f;">xmlns:aop</span>=<i><span style="color: #2a00ff;">"http://www.springframework.org/schema/aop"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #7f007f;">xsi:schemaLocation</span>=<i><span style="color: #2a00ff;">"http://www.springframework.org/schema/beans</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><i><span style="color: #2a00ff;"> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><i><span style="color: #2a00ff;">
http://www.springframework.org/schema/aop</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><i><span style="color: #2a00ff;">
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">aop:aspectj-autoproxy</span><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">bean</span>
<span style="color: #7f007f;">id</span>=<i><span style="color: #2a00ff;">"timingAspect"</span></i> <span style="color: #7f007f;">class</span>=<i><span style="color: #2a00ff;">"org.perf4j.log4j.aop.TimingAspect"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!--</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> Because we
included the aspectj-autoproxy element, Spring will automatically</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> create a proxy for
this bean that runs the TimingAspect around any public</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> @Profiled methods
on this bean.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">bean</span>
<span style="color: #7f007f;">id</span>=<i><span style="color: #2a00ff;">"performanceTester"</span></i> <span style="color: #7f007f;">class</span>=<i><span style="color: #2a00ff;">"com.vcjain.perf.PerformanceTester"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: teal;"></</span><span style="color: #3f7f7f;">beans</span><span style="color: teal;">></span><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">Add or append following log configuration<o:p></o:p></span></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #F2F2F2; border-collapse: collapse; border: none; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 342.9pt;" valign="top" width="457">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: teal;"><?</span><span style="color: #3f7f7f;">xml</span>
<span style="color: #7f007f;">version</span>=<i><span style="color: #2a00ff;">"1.0"</span></i> <span style="color: #7f007f;">encoding</span>=<i><span style="color: #2a00ff;">"UTF-8"</span></i>
<span style="color: teal;">?></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: teal;"><!</span><span style="color: #3f7f7f;">DOCTYPE</span>
<span style="color: teal;">log4j:configuration</span> <span style="color: grey;">SYSTEM</span>
<span style="color: #3f7f5f;">"log4j.dtd"</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: teal;"><</span><span style="color: #3f7f7f;">log4j:configuration</span>
<span style="color: #7f007f;">debug</span>=<i><span style="color: #2a00ff;">"false"</span></i> <span style="color: #7f007f;">xmlns:log4j</span>=<i><span style="color: #2a00ff;">"http://jakarta.apache.org/log4j/"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!--</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> This default
ConsoleAppender is used to log all NON perf4j messages</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> to System.out</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">appender</span>
<span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"console"</span></i> <span style="color: #7f007f;">class</span>=<i><span style="color: #2a00ff;">"org.apache.log4j.ConsoleAppender"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">layout</span>
<span style="color: #7f007f;">class</span>=<i><span style="color: #2a00ff;">"org.apache.log4j.PatternLayout"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">param</span>
<span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"ConversionPattern"</span></i> <span style="color: #7f007f;">value</span>=<i><span style="color: #2a00ff;">"%-5p %c{1} - %m%n"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">layout</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">appender</span><span style="color: teal;">></span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!-- Perf4J appenders --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!--</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> This
AsyncCoalescingStatisticsAppender groups StopWatch log messages</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> into
GroupedTimingStatistics messages which it sends on the</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> file appender
defined below</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">appender</span>
<span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"CoalescingStatistics"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #7f007f;">class</span>=<i><span style="color: #2a00ff;">"org.perf4j.log4j.AsyncCoalescingStatisticsAppender"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!--</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> The TimeSlice
option is used to determine the time window for which</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> all received
StopWatch logs are aggregated to create a single</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;">
GroupedTimingStatistics log. Here we set it to 10 seconds, overriding</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> the default of
30000 ms</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">param</span>
<span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"TimeSlice"</span></i> <span style="color: #7f007f;">value</span>=<i><span style="color: #2a00ff;">"10000"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">appender-ref</span>
<span style="color: #7f007f;">ref</span>=<i><span style="color: #2a00ff;">"fileAppender"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">appender</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!-- This file appender is used to output aggregated performance
statistics --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">appender</span>
<span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"fileAppender"</span></i> <span style="color: #7f007f;">class</span>=<i><span style="color: #2a00ff;">"org.apache.log4j.FileAppender"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">param</span>
<span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"File"</span></i> <span style="color: #7f007f;">value</span>=<i><span style="color: #2a00ff;">"profile.log"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">layout</span>
<span style="color: #7f007f;">class</span>=<i><span style="color: #2a00ff;">"org.apache.log4j.PatternLayout"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">param</span>
<span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"ConversionPattern"</span></i> <span style="color: #7f007f;">value</span>=<i><span style="color: #2a00ff;">"%m%n"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">layout</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">appender</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!-- Loggers --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!--</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> The Perf4J logger.
Note that org.perf4j.TimingLogger is the value of the</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;">
org.perf4j.StopWatch.DEFAULT_LOGGER_NAME constant. Also, note that</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> additivity is set
to false, which is usually what is desired - this means</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> that timing
statements will only be sent to this logger and NOT to</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> upstream loggers.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">logger</span>
<span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"org.perf4j.TimingLogger"</span></i> <span style="color: #7f007f;">additivity</span>=<i><span style="color: #2a00ff;">"false"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">level</span>
<span style="color: #7f007f;">value</span>=<i><span style="color: #2a00ff;">"INFO"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">appender-ref</span>
<span style="color: #7f007f;">ref</span>=<i><span style="color: #2a00ff;">"CoalescingStatistics"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">logger</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #3f5fbf;"><!--</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> The root logger
sends all log statements EXCEPT those sent to the perf4j</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> logger to
System.out.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: #3f5fbf;"> --></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">root</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">level</span>
<span style="color: #7f007f;">value</span>=<i><span style="color: #2a00ff;">"INFO"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">appender-ref</span>
<span style="color: #7f007f;">ref</span>=<i><span style="color: #2a00ff;">"console"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"></</span><span style="color: #3f7f7f;">root</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: teal;"></</span><span style="color: #3f7f7f;">log4j:configuration</span><span style="color: teal;">></span><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: 'Trebuchet MS', sans-serif; line-height: 115%;">With above configuration you are ready for profiling. Now
add </span><b style="font-family: 'Trebuchet MS', sans-serif; line-height: 115%;">@Profiled</b><span style="font-family: 'Trebuchet MS', sans-serif; line-height: 115%;"> annotation to the
method which you want to profile and execute code. You will receive your
statistic in your log file specified in logging configuration something like
below</span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #D9D9D9; border-collapse: collapse; border: none; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184; width: 463px;">
<tbody>
<tr style="height: 57.8pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="border: solid windowtext 1.0pt; height: 57.8pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 347.4pt;" valign="top" width="463">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;">Performance
Statistics 2013-08-30 13:07:10 -
2013-08-30 13:07:20<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;">Tag <u>Avg</u>(<u>ms</u>) <u>Min</u> Max <u>Std</u>
<u>Dev</u> Count<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;">profileTest 2027.0 2027 2027 0.0 1<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
</div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">For non-maven project we can
keep all dependency jars in the classpath. I have created a sample maven project
to demonstrate use of Perf API. Please get the complete project from Git
repository <a href="https://github.com/vcjain/perfapi.git">https://github.com/vcjain/perfapi.git</a>.
You can execute project using maven command <b>mvn exec:java.</b></span><span style="font-family: Arial, sans-serif; font-size: x-small;"><o:p></o:p></span></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/08995975401793637016noreply@blogger.com0tag:blogger.com,1999:blog-1084987175561048059.post-36958261429768516712013-12-17T01:50:00.001-08:002013-12-17T01:51:45.024-08:00What is Apache Camel<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">Now
a day’s most of enterprise application are design and develop on SOA. When we
talk about SOA we are talking about an enterprise application composed of
different components. Each component may be develop in different language and
technology and will be using a different protocol for communication. With
protocol you can think of language which a service will understand. In such a
heterogeneous environment first challenge is about effective interaction of different
Services/component with each other. Just thinking it seems to be complex
enough. It became more complex when we think about other attribute like
security, performance and scalability associate with service communication. <o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;"><br /></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">Simply
thinks of a dining table seated with people speaking different languages, how
they can interact with each other. We will definitely needs a middle man who
understand each language and help different people to interact. This common man
is <b>Apache Camel</b>. Apache Camel is an
open source service integration framework. Apache Camel is written in Java and provides
a routing engine which can easily transfer a message from one service to
another service. While piping a message, Camel can also transform/convert the
message in suitable format accepted by target service. This conversion handles
by component supported by Camel. There are around 80 components supported by
Camel like ftp, file, JMS, cxf etc. You can also define your own components and
extend Camel API. Components are simple class which acts as a factory for
creating endpoints. <o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;"><br /></span></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="line-height: 115%;">Camel
recognizes a service by an endpoint URI. A URI have three parts as components,
endpoints and options. In URI </span><a href="ftp://vcjain.com/orders?username=user&password=pass"><span style="line-height: 115%;">ftp://vcjain.com/orders?username=user&password=pass</span></a><span style="line-height: 115%;"> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">ftp is component, <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">vcjain.com/orders is an endpoint
and <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">username and passwords are
options<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">The
Endpoints in Camel provides a way through which Services can exchange their
messages. You can consider Endpoints as an address to a service. <o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;"><br /></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">Now
we have an understanding of URI, Let’s see how to create routes using Camel
API. Writing a routing logic in Camel is very simple. We only need to extends class
RouteBuilder and provide implementation of configure method. Below code will
give you a sense of routing logic written in Camel<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;"><br /></span></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #D9D9D9; border-collapse: collapse; border: none; margin-left: .5in; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="height: 43.6pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="border: solid windowtext 1.0pt; height: 43.6pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 303.35pt;" valign="top" width="404"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;">Public class MyRouter extends
RouteBuilder{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> Public void configure(){<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> from(ftp://vcjain.com/orders?username=user&password=pass).to(jms:queue:inbound)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;">}<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">Above
one line in configure method will be enough to transfer a file from FTP server
to a JMS Queue. Here both from and to are method with having URI as argument.
Camel understands a service using a URI. The URI in from() method have
component as FTP. Camel’s FTP component encapsulate all functionality to get
data from an FTP server. </span></span><span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">Location within a FTP
server is denoted by endpoint like ‘/orders’ and connecting to FTP server using
options username and password in above URI</span></span><span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="line-height: 115%;">A component in camel provides all
sort of functionality to tackle a message of a kind. You can see more details
for specific components at page <a href="http://camel.apache.org/components.html" target="_blank">http://camel.apache.org/components.html</a></span>.
There are <span style="line-height: 115%;">other
integration frameworks also available in the market but Apache Camel is more
popular because it provides us flexibility to write Routing logic in different
language like Java, Scala, Groovy, XML etc. Below is an example
of above Java logic in Spring XML style <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #D9D9D9; border-collapse: collapse; border: none; margin-left: 44.85pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184; width: 392px;">
<tbody>
<tr style="height: 39.4pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="border: solid windowtext 1.0pt; height: 39.4pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 293.85pt;" valign="top" width="392"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: teal;"><</span><span style="background-color: lightgrey; background-position: initial initial; background-repeat: initial initial; color: #3f7f7f;">route</span> <span style="color: #7f007f;">id</span>=<i><span style="color: #2a00ff;">"my_Sample_Camel_Route_with_CXF"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">from</span> <span style="color: #7f007f;">uri</span>=<i><span style="color: #2a00ff;">"file:src/data?noop=true"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">to</span> <span style="color: #7f007f;">uri</span>=<i><span style="color: #2a00ff;">"</span></i> jms:queue:inbound<i><span style="color: #2a00ff;">"</span></i><span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: teal;"></</span><span style="background-color: lightgrey; background-position: initial initial; background-repeat: initial initial; color: #3f7f7f;">route</span><span style="color: teal;">></span><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">In
order to activate a route you need to instantiate a Camel Context object. You can add your Route to camel context using addRoutes () method. Once your
routes added in context you can start context using start() method and your
program will start picking up messages from FTP, convert them to JMS message
format and send it to queue. You can start and stop camel context using start ()
and stop () methods.<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;"><br /></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">If
you want to perform some alteration on message before sending it to JMS queue,
you can add processor in camel context. You can create a processor by implement
a Processor interface define a single method process(Exchange exchange).<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;">from("ftp://vcjain.com/orders?username=user&password=pass").<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;">process(new
Processor() {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;">public void
process(Exchange exchange) throws Exception {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;">
<span style="font-family: Trebuchet MS, sans-serif;">System.out.println("We
just downloaded: "<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;">
<span style="font-family: Trebuchet MS, sans-serif;">+
exchange.getIn().getHeader("CamelFileName"));<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;">
<span style="font-family: Trebuchet MS, sans-serif;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;">}).<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">to("jms:incomingOrders");<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Trebuchet MS, sans-serif;">You
can add a Processor at any point in a route. Above route will print the
filename processed from FTP server before sending it to JMS queue.<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="line-height: 115%;"><br /></span></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="line-height: 115%;">I
have created a sample project which takes a file from file system and sends it
to Stock Quote web service. You can download src from </span><a href="https://github.com/vcjain/apachecamel.git"><span style="line-height: 115%;">https://github.com/vcjain/apachecamel.git</span></a><span style="line-height: 115%;"> and can run program using maven
command <b><i>mvn camel:run<o:p></o:p></i></b></span></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="line-height: 115%;"><b><i><br /></i></b></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Trebuchet MS, sans-serif;">Camel has implemented many enterprise integration patterns for messaging
like Content based routing, message filter, multicast, recipient list, wire tap
etc. You can find complete list of supported enterprise integration pattern at <a href="http://camel.apache.org/enterprise-integration-patterns.html" target="_blank">http://camel.apache.org/enterprise-integration-patterns.html</a>.
<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: Trebuchet MS, sans-serif;">Conclusion:</span></b><span style="font-family: Trebuchet MS, sans-serif;"> Camel is very effective open source integration
framework. It can quickly configured and easily integrate with enterprise
application. It provides implementation for various enterprise integration
patterns which will make integrating different platform application easy. The
open source Enterprise Bus Service Apache ServiceMix toolkit internally uses Apache
Camel. I will provide more information on Apache ServiceMix in my next blog.</span><span style="font-family: Cambria, serif; font-size: 10pt;"><o:p></o:p></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/08995975401793637016noreply@blogger.com0tag:blogger.com,1999:blog-1084987175561048059.post-3911413272507320322013-12-16T23:45:00.000-08:002013-12-17T01:18:56.797-08:00Why to choose Git Repository<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<div class="MsoNormal">
<span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">There are numerous internet articles which will tell you difference
between Git and other popular repository system like subversion, CVS etc. But I
didn’t want to discuss comparison rather I will let you know what the benefits
Git can delivers to us, so that we can clearly make our mind whether to go for
Git. Below are some of benefits <o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst">
</div>
<ul style="text-align: left;">
<li><span style="font-family: Cambria, serif;">No Internet required to work on, you can work
offline.</span></li>
<li><span style="font-family: Cambria, serif;">Branching is a light weight process</span></li>
<li><span style="font-family: Cambria, serif;">You can stack your uncommitted changes and can
popup them once you are ready.</span></li>
<li><span style="font-family: Cambria, serif;">More flexible workflow</span></li>
<li><span style="font-family: Cambria, serif;">Data redundancy & replication</span></li>
<li><span style="font-family: Cambria, serif;">Works well with open source project or projects
where contributors may take months to contribute there code.</span></li>
</ul>
<br />
<div class="MsoListParagraphCxSpMiddle">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Let’s review
each of them in detail<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="margin-left: 0in; mso-add-space: auto;">
<br /></div>
<div class="MsoNormal">
<b><u><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">No Internet
required to work on, you can work offline</span></u></b><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;"> – First steps to use Git is to
create a local repo at your machine. You can use Git Clone command for the
same. Since you have a complete repo at local machine, we did not have to
bother about internet connection. We can access complete history or revision
and commit our changes. Once we get online and are ready to submit code then we
can push code to remote server. Here I want to brief you with terminology Push.
In Git operation commit is used to commit changes in Local repository and when
you want to commit your changes into the remote repository from where you have
cloned your Local repository you will be ‘Pushing’ your changes. The command
Push can be used for the same. Similarly for getting changes from remote
repository after clone operation you can use Pull operation.<o:p></o:p></span></div>
<div class="MsoNormal">
<b><u><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Branching is
light weight process</span></u></b><u><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;"> </span></u><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">– We all know advantages of branches. In Git creation
of a branch is simply creating a Pointer. Git branching is so cheap that you
can create hundreds of branch in a day and can delete them. It’s always good to
work with branches so that main trunk will always be cleaner. In Git we can
merge even two branches which don’t have common ancestors. We will look more on
it in Branching and merging section.<o:p></o:p></span></div>
<div class="MsoNormal">
<b><u><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Stash</span></u></b><b><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;"> </span></b><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">– In order to understand Git Stash feature lets
consider a scenario which we all had encountered some or other way. Let’s
consider that I am working on an issue1 and I am in middle of my changes.
Suddenly my manager comes in and asks me to quickly fix a production bug.
Unfortunately the changes required to fix production bug is in same file on
which I had changes for issue1. Since I am not done completely with issue1
coding, I can’t check In my code. But I want to fix production issue which
should be on latest code. One way is to backup file at our file system and
replaces workspace file with latest from repository and later on when we done
with Production changes we can copy backup file in to workspace.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Git provides us one easy way to do this as Stash. You can stash your
uncommitted changes in Git and later on can unstash your changes to continue
your work. In data source terminology you can push your uncommitted changes in
to a Stack using <b>stash</b> command and
later on can popup your changes. With stash command, Git will save your changes
and will replace workspace file with latest from repository. Later on when you
done with your critical issue fixing you can unstack your changes using apply
option of stash command.<o:p></o:p></span></div>
<div class="MsoNormal">
<b><u><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">More Flexible
Workflow (Stage/Index)</span></u></b><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;"> – Working with repository we usually have below
workflow<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 1.0in; margin-right: 0in; margin-top: 0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Cambria; mso-fareast-font-family: Cambria;">1.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Checkout/Update
files from repository<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 1.0in; margin-right: 0in; margin-top: 0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Cambria; mso-fareast-font-family: Cambria;">2.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Modify files
for relevant changes<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 1.0in; margin-right: 0in; margin-top: 0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Cambria; mso-fareast-font-family: Cambria;">3.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Commit file
back to repository<u><o:p></o:p></u></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">In Git one
more level/area is introduce before committing your changes. This area is known
as <b>Stage/Index</b>. You can consider
this level as an area where you are preparing your commit. Once you prepare
your commit you can move ahead for commit. Once you are done with your changes
then you need to add modified files to staging using add command. <o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">$git add
<filename> <o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Adding a file
in staging is optional, You can use commit command with –a option to add a file
into staging and then committing. The command commit with –a option will merge
add and commit command.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Let’s consider
same scenario as above, we are working on an issue1 and we need to pause our
work to fix a production issue. This time changes required to fix production
issue is a subset of changes done for issue1. In other words we can say that
some of changes implemented for issue1 will be fixed production issue. But
committing a file means committing all changes/modifications in a file. <b>We can’t able to select a set of changes
within a file to commit. <o:p></o:p></b></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Git enable us
to do it using stage area. You can choose selected changes within a file and
can add them to staging area. Only changes added to staging area will be getting
committed. We can use Git add command in interactive mode.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Please refer
link for more details </span><a href="http://git-scm.com/book/en/Git-Tools-Interactive-Staging"><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">http://git-scm.com/book/en/Git-Tools-Interactive-Staging</span></a><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;"><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Git provides
easy way to ignore files from tracking. It provides us fault tolerance as data
redundant on multiple machines. Other than above benefits, Git provide lot more
benefits which we can explore more when we actually start using Git.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 0in; mso-add-space: auto;">
<br /></div>
<br />
<div class="MsoListParagraphCxSpLast" style="margin-left: 0in; mso-add-space: auto;">
<b><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Conclusion: </span></b><span style="font-family: "Cambria","serif"; mso-bidi-font-family: Arial;">Overall you will be benefited by
using Git. It provides lot more flexibility which I have not able to cover
above. There are lots of client tools available for Git to use like Tortiose
Git, SmartGit etc. For eclipse lovers there is a Egit plugin to make life
easier. There is only one disadvantage which I see with Git is about space
utilization. Since a complete repository is replicated on each developer’s
machine it will definitely not beneficial or effective in case you have limited
space. But in my opinion Data storage are so cheap now a days that it can be
easily overcome. <b><o:p></o:p></b></span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/08995975401793637016noreply@blogger.com0