KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > remoting > network > filter > IdentityFilter


1 /***************************************
2  * *
3  * JBoss: The OpenSource J2EE WebOS *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  ***************************************/

9 package org.jboss.remoting.network.filter;
10
11 import org.jboss.remoting.InvokerLocator;
12 import org.jboss.remoting.ident.Identity;
13 import org.jboss.remoting.network.NetworkFilter;
14
15 /**
16  * IdentityFilter
17  *
18  * @author <a HREF="mailto:jhaynie@vocalocity.net">Jeff Haynie</a>
19  * @version $Revision: 1.2 $
20  */

21 public class IdentityFilter implements NetworkFilter
22 {
23    static final long serialVersionUID = 480519754960605284L;
24
25    private final Identity identity;
26
27    public IdentityFilter(Identity identity)
28    {
29       this.identity = identity;
30    }
31
32    /**
33     * called to apply a filter when selecting <tt>0..*</tt> servers on the network
34     *
35     * @param identity
36     * @param locators
37     * @return
38     */

39    public boolean filter(Identity identity, InvokerLocator locators[])
40    {
41       return identity.equals(this.identity);
42    }
43 }
44
Popular Tags