View Javadoc

1   //
2   //  ========================================================================
3   //  Copyright (c) 1995-2016 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      @Deprecated
71      public static final String JETTY_WAR_FOLDER_PATH = "Jetty-WarFolderPath";
72      public static final String JETTY_WAR_RESOURCE_PATH = "Jetty-WarResourcePath";
73  
74      /** path within a fragment hosted by a web-bundle to a folder that contains basic resources.
75       * the path is appended to the lookup path where jetty locates static resources */
76      @Deprecated
77      public static final String JETTY_WAR_FRAGMENT_FOLDER_PATH = "Jetty-WarFragmentFolderPath";
78      public static final String JETTY_WAR_FRAGMENT_RESOURCE_PATH = "Jetty-WarFragmentResourcePath";
79      
80  
81      /** path within a fragment hosted by a web-bundle to a folder that contains basic resources.
82       * The path is prefixed to the lookup path where jetty locates static resources:
83       * this will override static resources with the same name in the web-bundle. */
84      @Deprecated
85      public static final String JETTY_WAR_PATCH_FRAGMENT_FOLDER_PATH = "Jetty-WarPatchFragmentFolderPath";
86      public static final String JETTY_WAR_PREPEND_FRAGMENT_RESOURCE_PATH = "Jetty-WarPrependFragmentResourcePath";
87  
88    
89      /** installation path of webapp bundle
90       *
91       */
92      public static final String JETTY_BUNDLE_ROOT = "bundle.root";
93      /** 
94       * web app context path 
95       * @deprecated see RFC66_WEB_CONTEXTPATH
96       */
97      public static final String SERVICE_PROP_CONTEXT_PATH = "contextPath";
98  
99      
100     /** 
101      * Path to the web application base folder 
102      * @deprecated see JETTY_WAR_FOLDER_PATH
103      */
104     public static final String SERVICE_PROP_WAR = "war";
105 
106     /** 
107      * Extra classpath
108      * @deprecated see JETTY_EXTRA_CLASSPATH 
109      */
110     public static final String SERVICE_PROP_EXTRA_CLASSPATH = "extraClasspath";
111     
112     public static final String JETTY_EXTRA_CLASSPATH = "Jetty-extraClasspath";
113 
114     /** 
115      * jetty context file path 
116      * @deprecated see JETTY_CONTEXT_FILE_PATH
117      */
118     public static final String SERVICE_PROP_CONTEXT_FILE_PATH = "contextFilePath";
119 
120     /** 
121      * web.xml file path 
122      * @deprecated see JETTY_WEB_XML_PATH
123      */
124     public static final String SERVICE_PROP_WEB_XML_PATH = "webXmlFilePath";
125     
126     public static final String JETTY_WEB_XML_PATH = "Jetty-WebXmlFilePath";
127 
128     /** 
129      * defaultweb.xml file path 
130      * @deprecated see JETTY_DEFAULT_WEB_XML_PATH
131      */
132     public static final String SERVICE_PROP_DEFAULT_WEB_XML_PATH = "defaultWebXmlFilePath";
133     
134     public static final String JETTY_DEFAULT_WEB_XML_PATH = "Jetty-defaultWebXmlFilePath";
135 
136     /**
137      * path to the base folder that overrides the computed bundle installation
138      * location if not null useful to install webapps or jetty context files
139      * that are in fact not embedded in a bundle
140      * @deprecated see JETTY_BUNDLE_INSTALL_LOCATION_OVERRIDE
141      */
142     public static final String SERVICE_PROP_BUNDLE_INSTALL_LOCATION_OVERRIDE = "thisBundleInstall";
143     
144     public static final String JETTY_BUNDLE_INSTALL_LOCATION_OVERRIDE = "Jetty-bundleInstall";
145     
146     /**
147      * Comma separated list of bundles that contain tld file used by the webapp.
148      */
149     public static final String REQUIRE_TLD_BUNDLE = "Require-TldBundle";
150     /**
151      * Comma separated list of bundles that contain tld file used by the webapp.
152      * Both the name of the manifest header and the name of the service property.
153      */
154     public static final String SERVICE_PROP_REQUIRE_TLD_BUNDLE = REQUIRE_TLD_BUNDLE;
155     
156     public static final String WATERMARK = "o.e.j.o.b.watermark";
157     
158     /**
159      * Set of extra dirs that must not be served by osgi webapps
160      */
161     public static final String[] DEFAULT_PROTECTED_OSGI_TARGETS = {"/osgi-inf", "/osgi-opts"};
162 
163     
164     
165 }