1
2
3 /*
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5 *
6 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
7 *
8 * Portions Copyright Apache Software Foundation.
9 *
10 * The contents of this file are subject to the terms of either the GNU
11 * General Public License Version 2 only ("GPL") or the Common Development
12 * and Distribution License("CDDL") (collectively, the "License"). You
13 * may not use this file except in compliance with the License. You can obtain
14 * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
15 * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
16 * language governing permissions and limitations under the License.
17 *
18 * When distributing the software, include this License Header Notice in each
19 * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
20 * Sun designates this particular file as subject to the "Classpath" exception
21 * as provided by Sun in the GPL Version 2 section of the License file that
22 * accompanied this code. If applicable, add the following below the License
23 * Header, with the fields enclosed by brackets [] replaced by your own
24 * identifying information: "Portions Copyrighted [year]
25 * [name of copyright owner]"
26 *
27 * Contributor(s):
28 *
29 * If you wish your version of this file to be governed by only the CDDL or
30 * only the GPL Version 2, indicate your decision by adding "[Contributor]
31 * elects to include this software in this distribution under the [CDDL or GPL
32 * Version 2] license." If you don't indicate a single choice of license, a
33 * recipient has the option to distribute your version of this file under
34 * either the CDDL, the GPL Version 2 or to extend the choice of license to
35 * its licensees as provided above. However, if you add GPL Version 2 code
36 * and therefore, elected the GPL Version 2 license, then the option applies
37 * only if the new code is made subject to such option by the copyright
38 * holder.
39 */
40
41
42 package org.apache.catalina;
43
44
45 import javax.servlet.ServletContext;
46
47 import org.apache.tomcat.util.http.mapper.Mapper;
48
49 import org.apache.catalina.deploy.ApplicationParameter;
50 import org.apache.catalina.deploy.ContextEjb;
51 import org.apache.catalina.deploy.ContextEnvironment;
52 import org.apache.catalina.deploy.ContextLocalEjb;
53 import org.apache.catalina.deploy.ContextResource;
54 import org.apache.catalina.deploy.ContextResourceLink;
55 import org.apache.catalina.deploy.ErrorPage;
56 import org.apache.catalina.deploy.FilterDef;
57 import org.apache.catalina.deploy.FilterMap;
58 import org.apache.catalina.deploy.LoginConfig;
59 import org.apache.catalina.deploy.NamingResources;
60 import org.apache.catalina.deploy.SecurityConstraint;
61 import org.apache.catalina.util.CharsetMapper;
62
63
64 /**
65 * A <b>Context</b> is a Container that represents a servlet context, and
66 * therefore an individual web application, in the Catalina servlet engine.
67 * It is therefore useful in almost every deployment of Catalina (even if a
68 * Connector attached to a web server (such as Apache) uses the web server's
69 * facilities to identify the appropriate Wrapper to handle this request.
70 * It also provides a convenient mechanism to use Interceptors that see
71 * every request processed by this particular web application.
72 * <p>
73 * The parent Container attached to a Context is generally a Host, but may
74 * be some other implementation, or may be omitted if it is not necessary.
75 * <p>
76 * The child containers attached to a Context are generally implementations
77 * of Wrapper (representing individual servlet definitions).
78 * <p>
79 *
80 * @author Craig R. McClanahan
81 * @version $Revision: 1.4 $ $Date: 2007/05/05 05:31:51 $
82 */
83
84 public interface Context extends Container {
85
86
87 // ----------------------------------------------------- Manifest Constants
88
89
90 /**
91 * The LifecycleEvent type sent when a context is reloaded.
92 */
93 public static final String RELOAD_EVENT = "reload";
94
95
96 // ------------------------------------------------------------- Properties
97
98
99 /**
100 * Return the set of initialized application event listener objects,
101 * in the order they were specified in the web application deployment
102 * descriptor, for this application.
103 *
104 * @exception IllegalStateException if this method is called before
105 * this application has started, or after it has been stopped
106 */
107 public Object[] getApplicationEventListeners();
108
109
110 /**
111 * Store the set of initialized application event listener objects,
112 * in the order they were specified in the web application deployment
113 * descriptor, for this application.
114 *
115 * @param listeners The set of instantiated listener objects.
116 */
117 public void setApplicationEventListeners(Object listeners[]);
118
119
120 /**
121 * Return the set of initialized application lifecycle listener objects,
122 * in the order they were specified in the web application deployment
123 * descriptor, for this application.
124 *
125 * @exception IllegalStateException if this method is called before
126 * this application has started, or after it has been stopped
127 */
128 public Object[] getApplicationLifecycleListeners();
129
130
131 /**
132 * Store the set of initialized application lifecycle listener objects,
133 * in the order they were specified in the web application deployment
134 * descriptor, for this application.
135 *
136 * @param listeners The set of instantiated listener objects.
137 */
138 public void setApplicationLifecycleListeners(Object listeners[]);
139
140
141 /**
142 * Return the application available flag for this Context.
143 */
144 public boolean getAvailable();
145
146
147 /**
148 * Set the application available flag for this Context.
149 *
150 * @param available The new application available flag
151 */
152 public void setAvailable(boolean available);
153
154
155 /**
156 * Return the Locale to character set mapper for this Context.
157 */
158 public CharsetMapper getCharsetMapper();
159
160
161 /**
162 * Set the Locale to character set mapper for this Context.
163 *
164 * @param mapper The new mapper
165 */
166 public void setCharsetMapper(CharsetMapper mapper);
167
168
169 /**
170 * Return the path to a file to save this Context information.
171 */
172 public String getConfigFile();
173
174
175 /**
176 * Set the path to a file to save this Context information.
177 *
178 * @param configFile The path to a file to save this Context information.
179 */
180 public void setConfigFile(String configFile);
181
182
183 /**
184 * Return the "correctly configured" flag for this Context.
185 */
186 public boolean getConfigured();
187
188
189 /**
190 * Set the "correctly configured" flag for this Context. This can be
191 * set to false by startup listeners that detect a fatal configuration
192 * error to avoid the application from being made available.
193 *
194 * @param configured The new correctly configured flag
195 */
196 public void setConfigured(boolean configured);
197
198
199 /**
200 * Return the "use cookies for session ids" flag.
201 */
202 public boolean getCookies();
203
204
205 /**
206 * Set the "use cookies for session ids" flag.
207 *
208 * @param cookies The new flag
209 */
210 public void setCookies(boolean cookies);
211
212
213 /**
214 * Return the "allow crossing servlet contexts" flag.
215 */
216 public boolean getCrossContext();
217
218
219
220 /**
221 * Return the alternate Deployment Descriptor name.
222 */
223 public String getAltDDName();
224
225
226 /**
227 * Set an alternate Deployment Descriptor name.
228 */
229 public void setAltDDName(String altDDName) ;
230
231
232 /**
233 * Set the "allow crossing servlet contexts" flag.
234 *
235 * @param crossContext The new cross contexts flag
236 */
237 public void setCrossContext(boolean crossContext);
238
239
240 /**
241 * Return the display name of this web application.
242 */
243 public String getDisplayName();
244
245
246 /**
247 * Set the display name of this web application.
248 *
249 * @param displayName The new display name
250 */
251 public void setDisplayName(String displayName);
252
253
254 /**
255 * Return the distributable flag for this web application.
256 */
257 public boolean getDistributable();
258
259
260 /**
261 * Set the distributable flag for this web application.
262 *
263 * @param distributable The new distributable flag
264 */
265 public void setDistributable(boolean distributable);
266
267
268 /**
269 * Return the document root for this Context. This can be an absolute
270 * pathname, a relative pathname, or a URL.
271 */
272 public String getDocBase();
273
274
275 /**
276 * Set the document root for this Context. This can be an absolute
277 * pathname, a relative pathname, or a URL.
278 *
279 * @param docBase The new document root
280 */
281 public void setDocBase(String docBase);
282
283
284 /**
285 * Return the URL encoded context path, using UTF-8.
286 */
287 public String getEncodedPath();
288
289
290 /**
291 * Return the login configuration descriptor for this web application.
292 */
293 public LoginConfig getLoginConfig();
294
295
296 /**
297 * Set the login configuration descriptor for this web application.
298 *
299 * @param config The new login configuration
300 */
301 public void setLoginConfig(LoginConfig config);
302
303
304 /**
305 * Get the request dispatcher mapper.
306 */
307 public Mapper getMapper();
308
309
310 /**
311 * Return the naming resources associated with this web application.
312 */
313 public NamingResources getNamingResources();
314
315
316 /**
317 * Set the naming resources for this web application.
318 *
319 * @param namingResources The new naming resources
320 */
321 public void setNamingResources(NamingResources namingResources);
322
323
324 /**
325 * Return the context path for this web application.
326 */
327 public String getPath();
328
329
330 /**
331 * Set the context path for this web application.
332 *
333 * @param path The new context path
334 */
335 public void setPath(String path);
336
337
338 /**
339 * Return the public identifier of the deployment descriptor DTD that is
340 * currently being parsed.
341 */
342 public String getPublicId();
343
344
345 /**
346 * Set the public identifier of the deployment descriptor DTD that is
347 * currently being parsed.
348 *
349 * @param publicId The public identifier
350 */
351 public void setPublicId(String publicId);
352
353
354 /**
355 * Return the reloadable flag for this web application.
356 */
357 public boolean getReloadable();
358
359
360 /**
361 * Set the reloadable flag for this web application.
362 *
363 * @param reloadable The new reloadable flag
364 */
365 public void setReloadable(boolean reloadable);
366
367
368 /**
369 * Return the override flag for this web application.
370 */
371 public boolean getOverride();
372
373
374 /**
375 * Set the override flag for this web application.
376 *
377 * @param override The new override flag
378 */
379 public void setOverride(boolean override);
380
381
382 /**
383 * Return the privileged flag for this web application.
384 */
385 public boolean getPrivileged();
386
387
388 /**
389 * Set the privileged flag for this web application.
390 *
391 * @param privileged The new privileged flag
392 */
393 public void setPrivileged(boolean privileged);
394
395
396 /**
397 * Return the servlet context for which this Context is a facade.
398 */
399 public ServletContext getServletContext();
400
401
402 /**
403 * Return the default session timeout (in minutes) for this
404 * web application.
405 */
406 public int getSessionTimeout();
407
408
409 /**
410 * Set the default session timeout (in minutes) for this
411 * web application.
412 *
413 * @param timeout The new default session timeout
414 */
415 public void setSessionTimeout(int timeout);
416
417
418 /**
419 * Return the Java class name of the Wrapper implementation used
420 * for servlets registered in this Context.
421 */
422 public String getWrapperClass();
423
424
425 /**
426 * Set the Java class name of the Wrapper implementation used
427 * for servlets registered in this Context.
428 *
429 * @param wrapperClass The new wrapper class
430 */
431 public void setWrapperClass(String wrapperClass);
432
433
434 // START IASRI 4823322
435 /**
436 * Get Auditors associated with this context, if any.
437 *
438 * @return array of Auditor objects, or null
439 *
440 */
441 public Auditor[] getAuditors();
442
443
444 /**
445 * Set the Auditors associated with this context.
446 *
447 * @param auditor array of Auditor objects
448 *
449 */
450 public void setAuditors(Auditor[] auditor);
451 // END IASRI 4823322
452
453
454 // --------------------------------------------------------- Public Methods
455
456
457 /**
458 * Add a new Listener class name to the set of Listeners
459 * configured for this application.
460 *
461 * @param listener Java class name of a listener class
462 */
463 public void addApplicationListener(String listener);
464
465
466 /**
467 * Add a new application parameter for this application.
468 *
469 * @param parameter The new application parameter
470 */
471 public void addApplicationParameter(ApplicationParameter parameter);
472
473
474 /**
475 * Add a security constraint to the set for this web application.
476 */
477 public void addConstraint(SecurityConstraint constraint);
478
479
480 /**
481 * Add an EJB resource reference for this web application.
482 *
483 * @param ejb New EJB resource reference
484 */
485 public void addEjb(ContextEjb ejb);
486
487
488 /**
489 * Add an environment entry for this web application.
490 *
491 * @param environment New environment entry
492 */
493 public void addEnvironment(ContextEnvironment environment);
494
495
496 /**
497 * Add an error page for the specified error or Java exception.
498 *
499 * @param errorPage The error page definition to be added
500 */
501 public void addErrorPage(ErrorPage errorPage);
502
503
504 /**
505 * Add a filter definition to this Context.
506 *
507 * @param filterDef The filter definition to be added
508 */
509 public void addFilterDef(FilterDef filterDef);
510
511
512 /**
513 * Add a filter mapping to this Context.
514 *
515 * @param filterMap The filter mapping to be added
516 */
517 public void addFilterMap(FilterMap filterMap);
518
519
520 /**
521 * Add the classname of an InstanceListener to be added to each
522 * Wrapper appended to this Context.
523 *
524 * @param listener Java class name of an InstanceListener class
525 */
526 public void addInstanceListener(String listener);
527
528
529 /**
530 * Add the given URL pattern as a jsp-property-group. This maps
531 * resources that match the given pattern so they will be passed
532 * to the JSP container. Though there are other elements in the
533 * property group, we only care about the URL pattern here. The
534 * JSP container will parse the rest.
535 *
536 * @param pattern URL pattern to be mapped
537 */
538 public void addJspMapping(String pattern);
539
540
541 /**
542 * Add a Locale Encoding Mapping (see Sec 5.4 of Servlet spec 2.4)
543 *
544 * @param locale locale to map an encoding for
545 * @param encoding encoding to be used for a give locale
546 */
547 public void addLocaleEncodingMappingParameter(String locale, String encoding);
548
549
550 /**
551 * Add a local EJB resource reference for this web application.
552 *
553 * @param ejb New local EJB resource reference
554 */
555 public void addLocalEjb(ContextLocalEjb ejb);
556
557
558 /**
559 * Add a new MIME mapping, replacing any existing mapping for
560 * the specified extension.
561 *
562 * @param extension Filename extension being mapped
563 * @param mimeType Corresponding MIME type
564 */
565 public void addMimeMapping(String extension, String mimeType);
566
567
568 /**
569 * Add a new context initialization parameter, replacing any existing
570 * value for the specified name.
571 *
572 * @param name Name of the new parameter
573 * @param value Value of the new parameter
574 */
575 public void addParameter(String name, String value);
576
577
578 /**
579 * Add a resource reference for this web application.
580 *
581 * @param resource New resource reference
582 */
583 public void addResource(ContextResource resource);
584
585
586 /**
587 * Add a resource environment reference for this web application.
588 *
589 * @param name The resource environment reference name
590 * @param type The resource environment reference type
591 */
592 public void addResourceEnvRef(String name, String type);
593
594
595 /**
596 * Add a resource link for this web application.
597 *
598 * @param resource New resource link
599 */
600 public void addResourceLink(ContextResourceLink resourceLink);
601
602
603 /**
604 * Add a security role reference for this web application.
605 *
606 * @param role Security role used in the application
607 * @param link Actual security role to check for
608 */
609 public void addRoleMapping(String role, String link);
610
611
612 /**
613 * Add a new security role for this web application.
614 *
615 * @param role New security role
616 */
617 public void addSecurityRole(String role);
618
619
620 /**
621 * Add a new servlet mapping, replacing any existing mapping for
622 * the specified pattern.
623 *
624 * @param pattern URL pattern to be mapped
625 * @param name Name of the corresponding servlet to execute
626 */
627 public void addServletMapping(String pattern, String name);
628
629
630 /**
631 * Add a JSP tag library for the specified URI.
632 *
633 * @param uri URI, relative to the web.xml file, of this tag library
634 * @param location Location of the tag library descriptor
635 */
636 public void addTaglib(String uri, String location);
637
638
639 /**
640 * Add a new welcome file to the set recognized by this Context.
641 *
642 * @param name New welcome file name
643 */
644 public void addWelcomeFile(String name);
645
646
647 /**
648 * Add the classname of a LifecycleListener to be added to each
649 * Wrapper appended to this Context.
650 *
651 * @param listener Java class name of a LifecycleListener class
652 */
653 public void addWrapperLifecycle(String listener);
654
655
656 /**
657 * Add the classname of a ContainerListener to be added to each
658 * Wrapper appended to this Context.
659 *
660 * @param listener Java class name of a ContainerListener class
661 */
662 public void addWrapperListener(String listener);
663
664
665 /**
666 * Factory method to create and return a new Wrapper instance, of
667 * the Java implementation class appropriate for this Context
668 * implementation. The constructor of the instantiated Wrapper
669 * will have been called, but no properties will have been set.
670 */
671 public Wrapper createWrapper();
672
673
674 /**
675 * Return the set of application listener class names configured
676 * for this application.
677 */
678 public String[] findApplicationListeners();
679
680
681 /**
682 * Return the set of application parameters for this application.
683 */
684 public ApplicationParameter[] findApplicationParameters();
685
686
687 /**
688 * Return the set of security constraints for this web application.
689 * If there are none, a zero-length array is returned.
690 */
691 public SecurityConstraint[] findConstraints();
692
693
694 /**
695 * Return the EJB resource reference with the specified name, if any;
696 * otherwise, return <code>null</code>.
697 *
698 * @param name Name of the desired EJB resource reference
699 */
700 public ContextEjb findEjb(String name);
701
702
703 /**
704 * Return the defined EJB resource references for this application.
705 * If there are none, a zero-length array is returned.
706 */
707 public ContextEjb[] findEjbs();
708
709
710 /**
711 * Return the environment entry with the specified name, if any;
712 * otherwise, return <code>null</code>.
713 *
714 * @param name Name of the desired environment entry
715 */
716 public ContextEnvironment findEnvironment(String name);
717
718
719 /**
720 * Return the set of defined environment entries for this web
721 * application. If none have been defined, a zero-length array
722 * is returned.
723 */
724 public ContextEnvironment[] findEnvironments();
725
726
727 /**
728 * Return the error page entry for the specified HTTP error code,
729 * if any; otherwise return <code>null</code>.
730 *
731 * @param errorCode Error code to look up
732 */
733 public ErrorPage findErrorPage(int errorCode);
734
735
736 /**
737 * Return the error page entry for the specified Java exception type,
738 * if any; otherwise return <code>null</code>.
739 *
740 * @param exceptionType Exception type to look up
741 */
742 public ErrorPage findErrorPage(String exceptionType);
743
744
745
746 /**
747 * Return the set of defined error pages for all specified error codes
748 * and exception types.
749 */
750 public ErrorPage[] findErrorPages();
751
752
753 /**
754 * Return the filter definition for the specified filter name, if any;
755 * otherwise return <code>null</code>.
756 *
757 * @param filterName Filter name to look up
758 */
759 public FilterDef findFilterDef(String filterName);
760
761
762 /**
763 * Return the set of defined filters for this Context.
764 */
765 public FilterDef[] findFilterDefs();
766
767
768 /**
769 * Return the set of filter mappings for this Context.
770 */
771 public FilterMap[] findFilterMaps();
772
773
774 /**
775 * Return the set of InstanceListener classes that will be added to
776 * newly created Wrappers automatically.
777 */
778 public String[] findInstanceListeners();
779
780
781 /**
782 * Return the local EJB resource reference with the specified name, if any;
783 * otherwise, return <code>null</code>.
784 *
785 * @param name Name of the desired EJB resource reference
786 */
787 public ContextLocalEjb findLocalEjb(String name);
788
789
790 /**
791 * Return the defined local EJB resource references for this application.
792 * If there are none, a zero-length array is returned.
793 */
794 public ContextLocalEjb[] findLocalEjbs();
795
796
797 /**
798 * Return the MIME type to which the specified extension is mapped,
799 * if any; otherwise return <code>null</code>.
800 *
801 * @param extension Extension to map to a MIME type
802 */
803 public String findMimeMapping(String extension);
804
805
806 /**
807 * Return the extensions for which MIME mappings are defined. If there
808 * are none, a zero-length array is returned.
809 */
810 public String[] findMimeMappings();
811
812
813 /**
814 * Return the value for the specified context initialization
815 * parameter name, if any; otherwise return <code>null</code>.
816 *
817 * @param name Name of the parameter to return
818 */
819 public String findParameter(String name);
820
821
822 /**
823 * Return the names of all defined context initialization parameters
824 * for this Context. If no parameters are defined, a zero-length
825 * array is returned.
826 */
827 public String[] findParameters();
828
829
830 /**
831 * Return the resource reference with the specified name, if any;
832 * otherwise return <code>null</code>.
833 *
834 * @param name Name of the desired resource reference
835 */
836 public ContextResource findResource(String name);
837
838
839 /**
840 * Return the resource environment reference type for the specified
841 * name, if any; otherwise return <code>null</code>.
842 *
843 * @param name Name of the desired resource environment reference
844 */
845 public String findResourceEnvRef(String name);
846
847
848 /**
849 * Return the set of resource environment reference names for this
850 * web application. If none have been specified, a zero-length
851 * array is returned.
852 */
853 public String[] findResourceEnvRefs();
854
855
856 /**
857 * Return the resource link with the specified name, if any;
858 * otherwise return <code>null</code>.
859 *
860 * @param name Name of the desired resource link
861 */
862 public ContextResourceLink findResourceLink(String name);
863
864
865 /**
866 * Return the defined resource links for this application. If
867 * none have been defined, a zero-length array is returned.
868 */
869 public ContextResourceLink[] findResourceLinks();
870
871
872 /**
873 * Return the defined resource references for this application. If
874 * none have been defined, a zero-length array is returned.
875 */
876 public ContextResource[] findResources();
877
878
879 /**
880 * For the given security role (as used by an application), return the
881 * corresponding role name (as defined by the underlying Realm) if there
882 * is one. Otherwise, return the specified role unchanged.
883 *
884 * @param role Security role to map
885 */
886 public String findRoleMapping(String role);
887
888
889 /**
890 * Return <code>true</code> if the specified security role is defined
891 * for this application; otherwise return <code>false</code>.
892 *
893 * @param role Security role to verify
894 */
895 public boolean findSecurityRole(String role);
896
897
898 /**
899 * Return the security roles defined for this application. If none
900 * have been defined, a zero-length array is returned.
901 */
902 public String[] findSecurityRoles();
903
904
905 /**
906 * Return the servlet name mapped by the specified pattern (if any);
907 * otherwise return <code>null</code>.
908 *
909 * @param pattern Pattern for which a mapping is requested
910 */
911 public String findServletMapping(String pattern);
912
913
914 /**
915 * Return the patterns of all defined servlet mappings for this
916 * Context. If no mappings are defined, a zero-length array is returned.
917 */
918 public String[] findServletMappings();
919
920
921 /**
922 * Return the context-relative URI of the error page for the specified
923 * HTTP status code, if any; otherwise return <code>null</code>.
924 *
925 * @param status HTTP status code to look up
926 */
927 public String findStatusPage(int status);
928
929
930 /**
931 * Return the set of HTTP status codes for which error pages have
932 * been specified. If none are specified, a zero-length array
933 * is returned.
934 */
935 public int[] findStatusPages();
936
937
938 /**
939 * Return the tag library descriptor location for the specified taglib
940 * URI, if any; otherwise, return <code>null</code>.
941 *
942 * @param uri URI, relative to the web.xml file
943 */
944 public String findTaglib(String uri);
945
946
947 /**
948 * Return the URIs of all tag libraries for which a tag library
949 * descriptor location has been specified. If none are specified,
950 * a zero-length array is returned.
951 */
952 public String[] findTaglibs();
953
954
955 /**
956 * Return <code>true</code> if the specified welcome file is defined
957 * for this Context; otherwise return <code>false</code>.
958 *
959 * @param name Welcome file to verify
960 */
961 public boolean findWelcomeFile(String name);
962
963
964 /**
965 * Return the set of welcome files defined for this Context. If none are
966 * defined, a zero-length array is returned.
967 */
968 public String[] findWelcomeFiles();
969
970
971 /**
972 * Return the set of LifecycleListener classes that will be added to
973 * newly created Wrappers automatically.
974 */
975 public String[] findWrapperLifecycles();
976
977
978 /**
979 * Return the set of ContainerListener classes that will be added to
980 * newly created Wrappers automatically.
981 */
982 public String[] findWrapperListeners();
983
984
985 /**
986 * Reload this web application, if reloading is supported.
987 *
988 * @exception IllegalStateException if the <code>reloadable</code>
989 * property is set to <code>false</code>.
990 */
991 public void reload();
992
993
994 /**
995 * Remove the specified application listener class from the set of
996 * listeners for this application.
997 *
998 * @param listener Java class name of the listener to be removed
999 */
1000 public void removeApplicationListener(String listener);
1001
1002
1003 /**
1004 * Remove the application parameter with the specified name from
1005 * the set for this application.
1006 *
1007 * @param name Name of the application parameter to remove
1008 */
1009 public void removeApplicationParameter(String name);
1010
1011
1012 /**
1013 * Remove the specified security constraint from this web application.
1014 *
1015 * @param constraint Constraint to be removed
1016 */
1017 public void removeConstraint(SecurityConstraint constraint);
1018
1019
1020 /**
1021 * Remove any EJB resource reference with the specified name.
1022 *
1023 * @param name Name of the EJB resource reference to remove
1024 */
1025 public void removeEjb(String name);
1026
1027
1028 /**
1029 * Remove any environment entry with the specified name.
1030 *
1031 * @param name Name of the environment entry to remove
1032 */
1033 public void removeEnvironment(String name);
1034
1035
1036 /**
1037 * Remove the error page for the specified error code or
1038 * Java language exception, if it exists; otherwise, no action is taken.
1039 *
1040 * @param errorPage The error page definition to be removed
1041 */
1042 public void removeErrorPage(ErrorPage errorPage);
1043
1044
1045 /**
1046 * Remove the specified filter definition from this Context, if it exists;
1047 * otherwise, no action is taken.
1048 *
1049 * @param filterDef Filter definition to be removed
1050 */
1051 public void removeFilterDef(FilterDef filterDef);
1052
1053
1054 /**
1055 * Remove a filter mapping from this Context.
1056 *
1057 * @param filterMap The filter mapping to be removed
1058 */
1059 public void removeFilterMap(FilterMap filterMap);
1060
1061
1062 /**
1063 * Remove a class name from the set of InstanceListener classes that
1064 * will be added to newly created Wrappers.
1065 *
1066 * @param listener Class name of an InstanceListener class to be removed
1067 */
1068 public void removeInstanceListener(String listener);
1069
1070
1071 /**
1072 * Remove any local EJB resource reference with the specified name.
1073 *
1074 * @param name Name of the EJB resource reference to remove
1075 */
1076 public void removeLocalEjb(String name);
1077
1078
1079 /**
1080 * Remove the MIME mapping for the specified extension, if it exists;
1081 * otherwise, no action is taken.
1082 *
1083 * @param extension Extension to remove the mapping for
1084 */
1085 public void removeMimeMapping(String extension);
1086
1087
1088 /**
1089 * Remove the context initialization parameter with the specified
1090 * name, if it exists; otherwise, no action is taken.
1091 *
1092 * @param name Name of the parameter to remove
1093 */
1094 public void removeParameter(String name);
1095
1096
1097 /**
1098 * Remove any resource reference with the specified name.
1099 *
1100 * @param name Name of the resource reference to remove
1101 */
1102 public void removeResource(String name);
1103
1104
1105 /**
1106 * Remove any resource environment reference with the specified name.
1107 *
1108 * @param name Name of the resource environment reference to remove
1109 */
1110 public void removeResourceEnvRef(String name);
1111
1112
1113 /**
1114 * Remove any resource link with the specified name.
1115 *
1116 * @param name Name of the resource link to remove
1117 */
1118 public void removeResourceLink(String name);
1119
1120
1121 /**
1122 * Remove any security role reference for the specified name
1123 *
1124 * @param role Security role (as used in the application) to remove
1125 */
1126 public void removeRoleMapping(String role);
1127
1128
1129 /**
1130 * Remove any security role with the specified name.
1131 *
1132 * @param role Security role to remove
1133 */
1134 public void removeSecurityRole(String role);
1135
1136
1137 /**
1138 * Remove any servlet mapping for the specified pattern, if it exists;
1139 * otherwise, no action is taken.
1140 *
1141 * @param pattern URL pattern of the mapping to remove
1142 */
1143 public void removeServletMapping(String pattern);
1144
1145
1146 /**
1147 * Remove the tag library location forthe specified tag library URI.
1148 *
1149 * @param uri URI, relative to the web.xml file
1150 */
1151 public void removeTaglib(String uri);
1152
1153
1154 /**
1155 * Remove the specified welcome file name from the list recognized
1156 * by this Context.
1157 *
1158 * @param name Name of the welcome file to be removed
1159 */
1160 public void removeWelcomeFile(String name);
1161
1162
1163 /**
1164 * Remove a class name from the set of LifecycleListener classes that
1165 * will be added to newly created Wrappers.
1166 *
1167 * @param listener Class name of a LifecycleListener class to be removed
1168 */
1169 public void removeWrapperLifecycle(String listener);
1170
1171
1172 /**
1173 * Remove a class name from the set of ContainerListener classes that
1174 * will be added to newly created Wrappers.
1175 *
1176 * @param listener Class name of a ContainerListener class to be removed
1177 */
1178 public void removeWrapperListener(String listener);
1179
1180
1181 // START S1AS8PE 4817642
1182 /**
1183 * Return the "reuse session IDs when creating sessions" flag
1184 */
1185 public boolean getReuseSessionID();
1186
1187 /**
1188 * Set the "reuse session IDs when creating sessions" flag
1189 *
1190 * @param reuse The new value for the flag
1191 */
1192 public void setReuseSessionID(boolean reuse);
1193 // END S1AS8PE 4817642
1194
1195
1196 // START RIMOD 4642650
1197 /**
1198 * Return whether this context allows sendRedirect() to redirect
1199 * to a relative URL.
1200 *
1201 * The default value for this property is 'false'.
1202 */
1203 public boolean getAllowRelativeRedirect();
1204
1205
1206 /**
1207 * Set whether this context allows sendRedirect() to redirect
1208 * to a relative URL.
1209 *
1210 * @param allowRelativeURLs The new value for this property. The
1211 * default value for this flag is 'false'.
1212 */
1213 public void setAllowRelativeRedirect(boolean allowRelativeURLs);
1214
1215
1216 // END RIMOD 4642650
1217 /**
1218 * Get the server.xml <context> attribute's xmlNamespaceAware.
1219 * @return true if namespace awarenes is enabled.
1220 *
1221 */
1222 public boolean getXmlNamespaceAware();
1223
1224
1225 /**
1226 * Get the server.xml <context> attribute's xmlValidation.
1227 * @return true if validation is enabled.
1228 *
1229 */
1230 public boolean getXmlValidation();
1231
1232
1233 /**
1234 * Set the validation feature of the XML parser used when
1235 * parsing xml instances.
1236 * @param xmlValidation true to enable xml instance validation
1237 */
1238 public void setXmlValidation(boolean xmlValidation);
1239
1240
1241 /**
1242 * Set the namespace aware feature of the XML parser used when
1243 * parsing xml instances.
1244 * @param xmlNamespaceAware true to enable namespace awareness
1245 */
1246 public void setXmlNamespaceAware(boolean xmlNamespaceAware);
1247 /**
1248 * Get the server.xml <context> attribute's xmlValidation.
1249 * @return true if validation is enabled.
1250 */
1251
1252
1253 /**
1254 * Set the validation feature of the XML parser used when
1255 * parsing tlds files.
1256 * @param tldXmlValidation true to enable xml instance validation
1257 */
1258 public void setTldValidation(boolean tldValidation);
1259
1260
1261 /**
1262 * Get the server.xml <context> attribute's webXmlValidation.
1263 * @return true if validation is enabled.
1264 *
1265 */
1266 public boolean getTldValidation();
1267
1268
1269 /**
1270 * Get the server.xml <host> attribute's xmlNamespaceAware.
1271 * @return true if namespace awarenes is enabled.
1272 */
1273 public boolean getTldNamespaceAware();
1274
1275
1276 /**
1277 * Set the namespace aware feature of the XML parser used when
1278 * parsing xml instances.
1279 * @param xmlNamespaceAware true to enable namespace awareness
1280 */
1281 public void setTldNamespaceAware(boolean tldNamespaceAware);
1282
1283
1284 // START SJSAS 8.1 5049111
1285 /**
1286 * Return <code>true</code> if this context contains the JSF servlet.
1287 */
1288 public boolean isJsfApplication();
1289 // END SJSAS 8.1 5049111
1290
1291
1292 // START SJSAS 6253524
1293 /**
1294 * Indicates whether this web module contains any ad-hoc paths.
1295 *
1296 * An ad-hoc path is a servlet path that is mapped to a servlet
1297 * not declared in the web module's deployment descriptor.
1298 *
1299 * A web module all of whose mappings are for ad-hoc paths is called an
1300 * ad-hoc web module.
1301 *
1302 * @return true if this web module contains any ad-hoc paths, false
1303 * otherwise
1304 */
1305 public boolean hasAdHocPaths();
1306
1307 /**
1308 * Returns the name of the ad-hoc servlet responsible for servicing the
1309 * given path.
1310 *
1311 * @param path The path to service
1312 *
1313 * @return The name of the ad-hoc servlet responsible for servicing the
1314 * given path, or null if the given path is not an ad-hoc path
1315 */
1316 public String getAdHocServletName(String path);
1317 // END SJSAS 6253524
1318
1319 /**
1320 * Indicates whether the Pragma and Cache-Control headers will be set
1321 * to "No-cache" if proxy caching has been disabled.
1322 *
1323 * @return true if Pragma and Cache-Control headers will be set to
1324 * "No-cache" if proxy caching has been disabled; false otherwise.
1325 */
1326 public boolean isSecurePagesWithPragma();
1327
1328 /**
1329 * Sets the securePagesWithPragma property of this Context.
1330 *
1331 * Setting this property to true will result in Pragma and Cache-Control
1332 * headers with a value of "No-cache" if proxy caching has been disabled.
1333 *
1334 * Setting this property to false will not add any Pragma header,
1335 * but will set the Cache-Control header to "private".
1336 *
1337 * @param securePagesWithPragma true if Pragma and Cache-Control headers
1338 * are to be set to "No-cache" if proxy caching has been disabled, false
1339 * otherwise
1340 */
1341 public void setSecurePagesWithPragma(boolean securePagesWithPragma);
1342 }