directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache Directory SandBox > Implementing a simple interceptor
Date Sat, 06 Feb 2010 19:44:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/1519/1/5/_/styles/combined.css?spaceKey=DIRxSBOX&amp;forWysiwyg=true"
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="">Implementing
a simple interceptor</a></h2>
     <h4>Page <b>edited</b> by             <a href="">Stefan
     <div class="notificationGreySide">
         <h1><a name="Implementingasimpleinterceptor-Implementingasimpleinterceptor"></a>Implementing
a simple interceptor</h1>

<p>The following is for developers who plan to implement their own interceptors in order
to extend or modify the functionality of Apache Directory Server. It contains a simple example
as a starting point.</p>

    <li><a href='#Implementingasimpleinterceptor-Whatexactlyisaninterceptor%3F'>What
exactly is an interceptor?</a></li>
    <li><a href='#Implementingasimpleinterceptor-Passwordhash.Asimpleinterceptor'>Password
hash. A simple interceptor</a></li>
    <li><a href='#Implementingasimpleinterceptor-Thesources'>The sources</a></li>
    <li><a href='#Implementingasimpleinterceptor-ImplementingtheclassPasswordHashInterceptor'>Implementing
the class PasswordHashInterceptor</a></li>

<h2><a name="Implementingasimpleinterceptor-Whatexactlyisaninterceptor%3F"></a>What
exactly is an interceptor?</h2>

<p>An interceptor filters method calls performed on on the DefaultPartitionNexus just
like Servlet filters do. The ApacheDS configuration contains a chain of filters performing
several tasks. In order to illustrate this, here is the list of interceptors from the default
server configuration of ApacheDS 1.5.5</p>


<p>Interceptors should usually pass the control of current invocation to the next interceptor
by calling an appropriate method on NextInterceptor.  The flow control is returned when the
next  interceptor's filter method returns. You can therefore implement pre-, post-, around-
invocation handler by how you place the statement.</p>

<p>Interceptors are a powerful way to extend and modify the server behavior. But be
warned. A mistakenly written interceptor may lead to a dis-functional or corrupt server. </p>

<h2><a name="Implementingasimpleinterceptor-Passwordhash.Asimpleinterceptor"></a>Password
hash. A simple interceptor</h2>

<h3><a name="Implementingasimpleinterceptor-Thesources"></a>The sources</h3>

<p>Currently, the sources are checked in here</p>
	<li><a href=""

<p>In order to build it, simply check it out and type "mvn install". </p>

<h3><a name="Implementingasimpleinterceptor-ImplementingtheclassPasswordHashInterceptor"></a>Implementing
the class PasswordHashInterceptor</h3>

<p>The following UML class diagram depicts the structure of the little example.</p>

<p><img src="/confluence/download/attachments/13271374/passwordHashInterceptor_UML.png"
align="absmiddle" border="0" /></p>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>

       <a href="">View
       <a href="">View

View raw message