View Javadoc

1   //
2   //  ========================================================================
3   //  Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
4   //  ------------------------------------------------------------------------
5   //  All rights reserved. This program and the accompanying materials
6   //  are made available under the terms of the Eclipse Public License v1.0
7   //  and Apache License v2.0 which accompanies this distribution.
8   //
9   //      The Eclipse Public License is available at
10  //      http://www.eclipse.org/legal/epl-v10.html
11  //
12  //      The Apache License v2.0 is available at
13  //      http://www.opensource.org/licenses/apache2.0.php
14  //
15  //  You may elect to redistribute this code under either of these licenses.
16  //  ========================================================================
17  //
18  
19  package org.eclipse.jetty.osgi.boot;
20  
21  /**
22   * OSGiWebappConstants
23   * 
24   * 
25   * Constants (MANIFEST headers, service properties etc) associated with deploying
26   * webapps into OSGi via Jetty.
27   * 
28   */
29  public class OSGiWebappConstants
30  {
31      /** service property osgi.web.symbolicname. See OSGi r4 */
32      public static final String OSGI_WEB_SYMBOLICNAME = "osgi.web.symbolicname";
33      
34      /** service property osgi.web.symbolicname. See OSGi r4 */
35      public static final String OSGI_WEB_VERSION = "osgi.web.version";
36      
37      /** service property osgi.web.contextpath. See OSGi r4 */
38      public static final String OSGI_WEB_CONTEXTPATH = "osgi.web.contextpath";
39      
40      /** See OSGi r4 p.427 */
41      public static final String OSGI_BUNDLECONTEXT = "osgi-bundlecontext";
42  
43      
44  
45      /** url scheme to deploy war file as bundled webapp */
46      public static final String RFC66_WAR_URL_SCHEME = "war";
47  
48      /**
49       * Name of the header that defines the context path for the embedded webapp.
50       */
51      public static final String RFC66_WEB_CONTEXTPATH = "Web-ContextPath";
52  
53      /**
54       * Name of the header that defines the path to the folder where the jsp
55       * files are extracted.
56       */
57      public static final String RFC66_JSP_EXTRACT_LOCATION = "Jsp-ExtractLocation";
58  
59      /** Name of the servlet context attribute that points to the bundle context. */
60      public static final String RFC66_OSGI_BUNDLE_CONTEXT = "osgi-bundlecontext";
61  
62      /** Name of the servlet context attribute that points to the bundle object.
63       * We can't always rely on the bundle-context as there might be no such thing. */
64      public static final String JETTY_OSGI_BUNDLE = "osgi-bundle";
65  
66      /** List of relative pathes within the bundle to the jetty context files. */
67      public static final String JETTY_CONTEXT_FILE_PATH = "Jetty-ContextFilePath";
68  
69      /** path within the bundle to the folder that contains the basic resources. */
70      public static final String JETTY_WAR_FOLDER_PATH = "Jetty-WarFolderPath";
71  
72      /** path within a fragment hosted by a web-bundle to a folder that contains basic resources.
73       * the path is appended to the lookup path where jetty locates static resources */
74      public static final String JETTY_WAR_FRAGMENT_FOLDER_PATH = "Jetty-WarFragmentFolderPath";
75  
76      /** path within a fragment hosted by a web-bundle to a folder that contains basic resources.
77       * The path is prefixed to the lookup path where jetty locates static resources:
78       * this will override static resources with the same name in the web-bundle. */
79      public static final String JETTY_WAR_PATCH_FRAGMENT_FOLDER_PATH = "Jetty-WarPatchFragmentFolderPath";
80  
81    
82      /** installation path of webapp bundle
83       *
84       */
85      public static final String JETTY_BUNDLE_ROOT = "bundle.root";
86      /** 
87       * web app context path 
88       * @deprecated see RFC66_WEB_CONTEXTPATH
89       */
90      public static final String SERVICE_PROP_CONTEXT_PATH = "contextPath";
91  
92      
93      /** 
94       * Path to the web application base folder 
95       * @deprecated see JETTY_WAR_FOLDER_PATH
96       */
97      public static final String SERVICE_PROP_WAR = "war";
98  
99      /** 
100      * Extra classpath
101      * @deprecated see JETTY_EXTRA_CLASSPATH 
102      */
103     public static final String SERVICE_PROP_EXTRA_CLASSPATH = "extraClasspath";
104     
105     public static final String JETTY_EXTRA_CLASSPATH = "Jetty-extraClasspath";
106 
107     /** 
108      * jetty context file path 
109      * @deprecated see JETTY_CONTEXT_FILE_PATH
110      */
111     public static final String SERVICE_PROP_CONTEXT_FILE_PATH = "contextFilePath";
112 
113     /** 
114      * web.xml file path 
115      * @deprecated see JETTY_WEB_XML_PATH
116      */
117     public static final String SERVICE_PROP_WEB_XML_PATH = "webXmlFilePath";
118     
119     public static final String JETTY_WEB_XML_PATH = "Jetty-WebXmlFilePath";
120 
121     /** 
122      * defaultweb.xml file path 
123      * @deprecated see JETTY_DEFAULT_WEB_XML_PATH
124      */
125     public static final String SERVICE_PROP_DEFAULT_WEB_XML_PATH = "defaultWebXmlFilePath";
126     
127     public static final String JETTY_DEFAULT_WEB_XML_PATH = "Jetty-defaultWebXmlFilePath";
128 
129     /**
130      * path to the base folder that overrides the computed bundle installation
131      * location if not null useful to install webapps or jetty context files
132      * that are in fact not embedded in a bundle
133      * @deprecated see JETTY_BUNDLE_INSTALL_LOCATION_OVERRIDE
134      */
135     public static final String SERVICE_PROP_BUNDLE_INSTALL_LOCATION_OVERRIDE = "thisBundleInstall";
136     
137     public static final String JETTY_BUNDLE_INSTALL_LOCATION_OVERRIDE = "Jetty-bundleInstall";
138     
139     /**
140      * Comma separated list of bundles that contain tld file used by the webapp.
141      */
142     public static final String REQUIRE_TLD_BUNDLE = "Require-TldBundle";
143     /**
144      * Comma separated list of bundles that contain tld file used by the webapp.
145      * Both the name of the manifest header and the name of the service property.
146      */
147     public static final String SERVICE_PROP_REQUIRE_TLD_BUNDLE = REQUIRE_TLD_BUNDLE;
148     
149     public static final String WATERMARK = "o.e.j.o.b.watermark";
150     
151     /**
152      * Set of extra dirs that must not be served by osgi webapps
153      */
154     public static final String[] DEFAULT_PROTECTED_OSGI_TARGETS = {"/osgi-inf", "/osgi-opts"};
155 
156     
157     
158 }