incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache Sling Website > Request Listeners
Date Fri, 09 Jul 2010 07:47:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=SLINGxSITE&amp;forWysiwyg=true"
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="">Request
    <h4>Page  <b>added</b> by             <a href="">Mike
    <div class="notificationGreySide">
         <h1><a name="RequestListeners-RequestListenersupport"></a>Request
Listener support</h1>

<p>Sling provides the possibility to "listen" to a request processed by the Sling Engine
(<tt>SlingMainServlet</tt>). To get notified you implement the service interface

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>SlingRequestListener</b></div><div
class="codeContent panelContent">
<pre class="code-java">
<span class="code-keyword">public</span> <span class="code-keyword">interface</span>
SlingRequestListener {
	<span class="code-keyword">static</span> <span class="code-keyword">final</span>
<span class="code-object">String</span> SERVICE_NAME = <span class="code-quote">""</span>;

	 * This method is called from the Sling application <span class="code-keyword">for</span>
	 * &lt;code&gt;EventType&lt;/code&gt; appearing during the dispatching of
	 * a Sling request  
	 * @param sre the object representing the event
	 * @see
	<span class="code-keyword">public</span> void onEvent( SlingRequestEvent sre

<p>There are no special properties to set. </p>

<h2><a name="RequestListeners-Supportedtypesofevents"></a>Supported types
of events</h2>

<p>At the moment you will get two different types of <tt>SlingRequestEvent</tt>:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<th class='confluenceTh'> events types (<tt>SlingRequestEvent.EventType</tt>)
<th class='confluenceTh'> point in time </th>
<td class='confluenceTd'> EVENT_INIT </td>
<td class='confluenceTd'> after entering the <tt>service</tt> method in
<tt>SlingMainServlet</tt>. Note that this will be <b>after</b> the
<tt>handleSecurity</tt> call. </td>
<td class='confluenceTd'> EVENT_DESTROY </td>
<td class='confluenceTd'> at the end of the <tt>service</tt> method in <tt>SlingMainServlet</tt>

    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>
       <a href="">View
       <a href=";showCommentArea=true#addcomment">Add

View raw message