KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > verifier > event > VerificationEventGeneratorSupport


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.verifier.event;
23
24 /*
25  * Class org.jboss.verifier.event.VerificationEventGeneratorSupport
26  * Copyright (C) 2000 Juha Lindfors
27  *
28  * This library is free software; you can redistribute it and/or
29  * modify it under the terms of the GNU Lesser General Public
30  * License as published by the Free Software Foundation; either
31  * version 2 of the License, or (at your option) any later version
32  *
33  * This library is distributed in the hope that it will be useful,
34  * but WITHOUT ANY WARRANTY; without even the implied warranty of
35  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36  * Lesser General Public License for more details.
37  *
38  * You should have received a copy of the GNU Lesser General Public
39  * License along with this library; if not, write to the Free Software
40  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
41  *
42  * This package and its source code is available at www.jboss.org
43  * $Id: VerificationEventGeneratorSupport.java 37459 2005-10-30 00:04:02Z starksm $
44  *
45  * You can reach the author by sending email to jplindfo@helsinki.fi.
46  */

47
48
49 // standard imports
50
import java.util.Enumeration JavaDoc;
51
52
53 // non-standard class dependencies
54
import org.gjt.lindfors.util.EventGeneratorSupport;
55 import org.jboss.verifier.strategy.VerificationContext;
56
57
58 /**
59  * << DESCRIBE THE CLASS HERE >>
60  *
61  * For more detailed documentation, refer to the
62  * <a HREF="" << INSERT DOC LINK HERE >> </a>
63  *
64  * @see << OTHER RELATED CLASSES >>
65  *
66  * @author Juha Lindfors
67  * @version $Revision: 37459 $
68  * @since JDK 1.3
69  */

70 public class VerificationEventGeneratorSupport extends EventGeneratorSupport {
71
72     /*
73      * Default constructor
74      */

75     public VerificationEventGeneratorSupport() {
76
77         super();
78
79     }
80     
81     public void addVerificationListener(VerificationListener listener) {
82
83         super.addListener(listener);
84
85     }
86     
87     public void removeVerificationListener(VerificationListener listener) {
88
89         super.removeListener(listener);
90
91     }
92     
93     
94     /*
95      * Fires the event to all VerificationListeners. Listeners implements the
96      * beanChecked method and can pull the information from the event object
97      * and decide how to handle the situation by themselves
98      */

99     public void fireBeanChecked(VerificationEvent event) {
100             
101         Enumeration JavaDoc e = super.getListeners();
102
103         while (e.hasMoreElements()) {
104             VerificationListener listener = (VerificationListener) e.nextElement();
105             listener.beanChecked(event);
106         }
107     }
108     
109     public void fireSpecViolation(VerificationEvent event) {
110         
111         Enumeration JavaDoc e = super.getListeners();
112         
113         while (e.hasMoreElements()) {
114             VerificationListener listener = (VerificationListener) e.nextElement();
115             listener.specViolation(event);
116         }
117     }
118
119 }
120
121
Popular Tags