View Javadoc

1   // ========================================================================
2   // Copyright (c) 2009 Intalio, Inc.
3   // ------------------------------------------------------------------------
4   // All rights reserved. This program and the accompanying materials
5   // are made available under the terms of the Eclipse Public License v1.0
6   // and Apache License v2.0 which accompanies this distribution.
7   // The Eclipse Public License is available at 
8   // http://www.eclipse.org/legal/epl-v10.html
9   // The Apache License v2.0 is available at
10  // http://www.opensource.org/licenses/apache2.0.php
11  // You may elect to redistribute this code under either of these licenses. 
12  // ========================================================================
13  package org.eclipse.jetty.osgi.boot.utils;
14  
15  import java.net.URL;
16  
17  import org.eclipse.jetty.osgi.boot.OSGiAppProvider;
18  
19  /**
20   * Fix various shortcomings with the way jasper parses the tld files.
21   */
22  public interface WebappRegistrationCustomizer
23  {
24      /**
25       * we could do something a lot more pluggable with a custom header in the
26       * manifest or some customer declarative services let's keep it simple for
27       * now. hopefully the rest of the world won't need to customize this.
28       */
29      public static final String CLASS_NAME = "org.eclipse.jetty.osgi.boot.jasper.WebappRegistrationCustomizerImpl";
30  
31      /**
32       * TODO: right now only the jetty-jsp bundle is scanned for common taglibs.
33       * Should support a way to plug more bundles that contain taglibs.
34       * 
35       * The jasper TldScanner expects a URLClassloader to parse a jar for the
36       * /META-INF/*.tld it may contain. We place the bundles that we know contain
37       * such tag-libraries. Please note that it will work if and only if the
38       * bundle is a jar (!) Currently we just hardcode the bundle that contains
39       * the jstl implemenation.
40       * 
41       * A workaround when the tld cannot be parsed with this method is to copy
42       * and paste it inside the WEB-INF of the webapplication where it is used.
43       * 
44       * Support only 2 types of packaging for the bundle: - the bundle is a jar
45       * (recommended for runtime.) - the bundle is a folder and contain jars in
46       * the root and/or in the lib folder (nice for PDE developement situations)
47       * Unsupported: the bundle is a jar that embeds more jars.
48       * 
49       * @return array of URLs
50       * @throws Exception
51       */
52      URL[] getJarsWithTlds(OSGiAppProvider provider, BundleFileLocatorHelper fileLocator) throws Exception;
53  
54  }