KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > jsp > cfg > TldPreload


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Scott Ferguson
28  */

29
30 package com.caucho.jsp.cfg;
31
32 import com.caucho.config.BuilderProgram;
33 import com.caucho.server.webapp.WebApp;
34 import com.caucho.vfs.Path;
35
36 import java.util.ArrayList JavaDoc;
37
38 /**
39  * Configuration for the taglib in the .tld
40  */

41 public class TldPreload {
42   private boolean _isInit;
43   
44   private String JavaDoc _uri;
45   private String JavaDoc _location;
46
47   private ArrayList JavaDoc<TldListener> _listeners = new ArrayList JavaDoc<TldListener>();
48
49   private Path _path;
50   private Throwable JavaDoc _configException;
51
52   /**
53    * Sets the uri
54    */

55   public void setURI(String JavaDoc uri)
56   {
57     _uri = uri;
58   }
59
60   /**
61    * Gets the uri
62    */

63   public String JavaDoc getURI()
64   {
65     return _uri;
66   }
67
68   /**
69    * Sets the location
70    */

71   public void setLocation(String JavaDoc location)
72   {
73     _location = location;
74   }
75
76   /**
77    * Gets the location
78    */

79   public String JavaDoc getLocation()
80   {
81     return _uri;
82   }
83
84   /**
85    * Adds a listener
86    */

87   public void addListener(TldListener listener)
88   {
89     _listeners.add(listener);
90   }
91
92   /**
93    * Sets the path to the tld.
94    */

95   public void setPath(Path path)
96   {
97     _path = path;
98   }
99
100   /**
101    * Gets the path.
102    */

103   public Path getPath()
104   {
105     return _path;
106   }
107
108   /**
109    * Sets any configuration exception
110    */

111   public void setConfigException(Throwable JavaDoc e)
112   {
113     _configException = e;
114   }
115
116   /**
117    * Gets any configuration exception
118    */

119   public Throwable JavaDoc getConfigException()
120   {
121     return _configException;
122   }
123   
124   /**
125    * Ignores unknown options.
126    */

127   public void addBuilderProgram(BuilderProgram program)
128   {
129   }
130
131
132   /**
133    * Applies the listeners.
134    */

135   public void initListeners(WebApp app)
136     throws InstantiationException JavaDoc, IllegalAccessException JavaDoc
137   {
138     if (app == null)
139       return;
140
141     for (int i = 0; i < _listeners.size(); i++) {
142       TldListener listener = _listeners.get(i);
143
144       listener.register(app);
145     }
146   }
147
148   public String JavaDoc toString()
149   {
150     return "TldPreload[" + _path + "]";
151   }
152 }
153
Popular Tags