KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > binding > xquarebc > listeners > NewDataStrategy


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id : $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.binding.xquarebc.listeners;
23
24 import javax.xml.transform.Source JavaDoc;
25
26 /**
27  * This interface represents a strategy for detecting "new data",
28  * getting it (as XML) and updating what data is known.
29  *
30  * Implementations are typically instanciated from a factory
31  * each time new data must be detected and processed, so it may
32  * (it is even advised) have a state.
33  *
34  * @version $Rev: 250 $Date: {date}
35  * @since Petals 1.0
36  * @author Marc Dutoo - Open Wide
37  *
38  */

39 public interface NewDataStrategy {
40
41     /**
42      * Detects new data. May save the resulting information
43      * for later use in getNewData() and updateDataKnown().
44      * @return true if there is new data
45      * @throws Exception
46      */

47     public abstract boolean detectNewData() throws Exception JavaDoc;
48
49     /**
50      * Queries for the detected new data and returns them as
51      * a formatted XML source.
52      * @return
53      * @throws Exception
54      */

55     public abstract Source JavaDoc getNewData() throws Exception JavaDoc;
56
57     /**
58      * Updates the persistent knwoledge of new data found so the
59      * new time the strategy is used, it will be old data.
60      * @throws Exception
61      */

62     public abstract void updateDataKnown() throws Exception JavaDoc;
63 }
Popular Tags