KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > bean > BeanListener


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.bean;
17
18 /**
19  * Interface allowing caller to install a listener so that it can be informed
20  * as the bean makes progress through the links to be called.
21  *
22  * @author <a HREF="mailto:uv@upaya.co.uk">Upayavira</a>
23  * @version CVS $Id: BeanListener.java 30932 2004-07-29 17:35:38Z vgritsenko $
24  */

25 public interface BeanListener {
26
27     /**
28      * Report a page as successfully generated
29      * @param sourceURI
30      * @param destinationURI
31      * @param pageSize
32      * @param linksInPage Number of links found in this page
33      * @param newLinksinPage
34      * @param pagesRemaining Number of pages still to be generated
35      * @param pagesComplete
36      * @param timeTaken
37      */

38     public void pageGenerated(String JavaDoc sourceURI,
39                               String JavaDoc destinationURI,
40                               int pageSize,
41                               int linksInPage,
42                               int newLinksinPage,
43                               int pagesRemaining,
44                               int pagesComplete,
45                               long timeTaken);
46                               
47     /**
48      * Report a that was skipped because its URI matched an
49      * include/exclude pattern.
50      * @param uri
51      * @param message
52      */

53     public void pageSkipped(String JavaDoc uri, String JavaDoc message);
54     
55     /**
56      * Report a general message about operation of the bean
57      * @param msg The message to be reported
58      */

59     public void messageGenerated(String JavaDoc msg);
60
61     /**
62      * Report a warning about something non-fatal that happened within
63      * the bean.
64      * @param uri The page being generated when warning was triggered
65      * @param warning The warning to be reported
66      */

67     public void warningGenerated(String JavaDoc uri, String JavaDoc warning);
68
69     /**
70      * Report a broken link
71      * @param uri The URI that failed to be generated
72      * @param message A reason why the link was not generated
73      */

74     public void brokenLinkFound(String JavaDoc uri, String JavaDoc parentURI, String JavaDoc message, Throwable JavaDoc t);
75     
76     /**
77      * Signals completion of the generation process. This method can
78      * be used to write out reports, display time generation duration,
79      * etc.
80      */

81     public void complete();
82 }
83
Popular Tags