KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > providers > gs > filters > PojoTypeTemplateFilter


1 /*
2  * $Id: PojoTypeTemplateFilter.java 3807 2006-11-06 13:13:36Z holger $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.providers.gs.filters;
12
13 import java.lang.reflect.InvocationTargetException JavaDoc;
14
15 import net.jini.core.entry.Entry;
16
17 import org.mule.providers.gs.JiniMessage;
18 import org.mule.umo.UMOMessage;
19
20 /**
21  * TODO document
22  */

23 public class PojoTypeTemplateFilter implements JavaSpaceFilter
24 {
25     private String JavaDoc expectedType;
26
27     public Entry getEntry()
28         throws IllegalAccessException JavaDoc, NoSuchMethodException JavaDoc, InvocationTargetException JavaDoc,
29         InstantiationException JavaDoc, ClassNotFoundException JavaDoc
30     {
31         if (expectedType == null)
32         {
33             return null;
34         }
35
36         JiniMessage entry = new JiniMessage();
37         entry.setPayloadType(expectedType);
38         return entry;
39     }
40
41     /**
42      * Check a given message against this filter.
43      *
44      * @param message a non null message to filter.
45      * @return <code>true</code> if the message matches the filter
46      */

47     public boolean accept(UMOMessage message)
48     {
49         return true;
50     }
51
52     public String JavaDoc getExpectedType()
53     {
54         return expectedType;
55     }
56
57     public void setExpectedType(String JavaDoc expectedType)
58     {
59         this.expectedType = expectedType;
60     }
61
62 }
63
Popular Tags