464727 - Update Javadoc for Java 8 DocLint

This commit is contained in:
Joakim Erdfelt 2015-04-23 09:39:06 -07:00
parent a2566bedd8
commit 40d91775ca
22 changed files with 114 additions and 287 deletions

View File

@ -32,9 +32,6 @@ import com.sun.net.httpserver.HttpContext;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpPrincipal;
/* ------------------------------------------------------------ */
/**
*/
public class JettyHttpExchange extends HttpExchange implements JettyExchange
{
private JettyHttpExchangeDelegate _delegate;
@ -46,9 +43,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#hashCode()
*/
@Override
public int hashCode()
{
@ -56,9 +50,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getRequestHeaders()
*/
@Override
public Headers getRequestHeaders()
{
@ -66,9 +57,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getResponseHeaders()
*/
@Override
public Headers getResponseHeaders()
{
@ -76,9 +64,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getRequestURI()
*/
@Override
public URI getRequestURI()
{
@ -86,9 +71,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getRequestMethod()
*/
@Override
public String getRequestMethod()
{
@ -96,9 +78,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getHttpContext()
*/
@Override
public HttpContext getHttpContext()
{
@ -106,9 +85,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#close()
*/
@Override
public void close()
{
@ -116,9 +92,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj)
{
@ -126,9 +99,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getRequestBody()
*/
@Override
public InputStream getRequestBody()
{
@ -136,9 +106,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getResponseBody()
*/
@Override
public OutputStream getResponseBody()
{
@ -146,9 +113,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#sendResponseHeaders(int, long)
*/
@Override
public void sendResponseHeaders(int rCode, long responseLength) throws IOException
{
@ -156,9 +120,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getRemoteAddress()
*/
@Override
public InetSocketAddress getRemoteAddress()
{
@ -166,9 +127,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getResponseCode()
*/
@Override
public int getResponseCode()
{
@ -176,9 +134,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getLocalAddress()
*/
@Override
public InetSocketAddress getLocalAddress()
{
@ -186,9 +141,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getProtocol()
*/
@Override
public String getProtocol()
{
@ -196,9 +148,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#getAttribute(java.lang.String)
*/
@Override
public Object getAttribute(String name)
{
@ -206,9 +155,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#setAttribute(java.lang.String, java.lang.Object)
*/
@Override
public void setAttribute(String name, Object value)
{
@ -216,9 +162,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see JettyHttpExchangeDelegate#setStreams(java.io.InputStream, java.io.OutputStream)
*/
@Override
public void setStreams(InputStream i, OutputStream o)
{
@ -226,9 +169,6 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#getPrincipal()
*/
@Override
public HttpPrincipal getPrincipal()
{
@ -236,18 +176,12 @@ public class JettyHttpExchange extends HttpExchange implements JettyExchange
}
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#setPrincipal(com.sun.net.httpserver.HttpPrincipal)
*/
public void setPrincipal(HttpPrincipal principal)
{
_delegate.setPrincipal(principal);
}
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.spi.JettyExchange#toString()
*/
@Override
public String toString()
{

View File

@ -149,7 +149,7 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot
* @param parser The parser
* @param webbundle The current webbundle
* @param fragmentBundle The OSGi fragment bundle to scan
* @throws Exception
* @throws Exception if unable to parse fragment bundle
*/
protected void parseFragmentBundle(WebAppContext context, AnnotationParser parser,
Bundle webbundle, Bundle fragmentBundle) throws Exception
@ -162,8 +162,7 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot
* @param context The webapp context
* @param parser The parser
* @param webbundle The current webbundle
* @param fragmentBundle The OSGi required bundle to scan
* @throws Exception
* @throws Exception if unable to parse the web bundle
*/
protected void parseWebBundle(WebAppContext context, AnnotationParser parser, Bundle webbundle)
throws Exception
@ -176,8 +175,8 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot
* @param context The webapp context
* @param parser The parser
* @param webbundle The current webbundle
* @param fragmentBundle The OSGi required bundle to scan
* @throws Exception
* @param requiredBundle The OSGi required bundle to scan
* @throws Exception if unable to parse the required bundle
*/
protected void parseRequiredBundle(WebAppContext context, AnnotationParser parser,
Bundle webbundle, Bundle requiredBundle) throws Exception
@ -208,8 +207,8 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot
/**
* Returns the same classname resolver than for the webInfjar scanner
* @param context
* @return
* @param context the web app context
* @return the class name resolver
*/
protected ClassNameResolver createClassNameResolver(final WebAppContext context)
{

View File

@ -51,9 +51,10 @@ public class AnnotationParser extends org.eclipse.jetty.annotations.AnnotationPa
/**
* Keep track of a jetty URI Resource and its associated OSGi bundle.
* @param uri
* @param bundle
* @throws Exception
*
* @param bundle the bundle to index
* @return the resource for the bundle
* @throws Exception if unable to create the resource reference
*/
protected Resource indexBundle(Bundle bundle) throws Exception
{

View File

@ -46,15 +46,11 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.packageadmin.PackageAdmin;
/**
* AbstractWebAppProvider
*
* <p>
* Base class for Jetty DeploymentManager Providers that are capable of deploying a webapp,
* either from a bundle or an OSGi service.
*
*/
public abstract class AbstractWebAppProvider extends AbstractLifeCycle implements AppProvider
{
@ -603,9 +599,6 @@ public abstract class AbstractWebAppProvider extends AbstractLifeCycle implement
}
/* ------------------------------------------------------------ */
/**
*
*/
public String[] getConfigurationClasses()
{
return _configurationClasses;
@ -623,9 +616,6 @@ public abstract class AbstractWebAppProvider extends AbstractLifeCycle implement
}
/* ------------------------------------------------------------ */
/**
* @return
*/
public DeploymentManager getDeploymentManager()
{
return _deploymentManager;

View File

@ -33,28 +33,20 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceRegistration;
/**
* BundleContextProvider
*
* <p>
* Handles deploying OSGi bundles that define a context xml file for configuring them.
*
*
*/
public class BundleContextProvider extends AbstractContextProvider implements BundleProvider
{
private static final Logger LOG = Log.getLogger(AbstractContextProvider.class);
private Map<String, App> _appMap = new HashMap<String, App>();
private Map<Bundle, List<App>> _bundleMap = new HashMap<Bundle, List<App>>();
private ServiceRegistration _serviceRegForBundles;
/* ------------------------------------------------------------ */
public BundleContextProvider(ServerInstanceWrapper wrapper)
@ -96,11 +88,6 @@ public class BundleContextProvider extends AbstractContextProvider implements Bu
/* ------------------------------------------------------------ */
/**
* @param bundle
* @param contextFiles
* @return
*/
public boolean bundleAdded (Bundle bundle) throws Exception
{
if (bundle == null)
@ -149,8 +136,8 @@ public class BundleContextProvider extends AbstractContextProvider implements Bu
/* ------------------------------------------------------------ */
/**
* Bundle has been removed. If it was a context we deployed, undeploy it.
* @param bundle
*
* @param bundle the bundle
* @return true if this was a context we had deployed, false otherwise
*/
public boolean bundleRemoved (Bundle bundle) throws Exception

View File

@ -32,13 +32,10 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceRegistration;
/**
* BundleWebAppProvider
*
* <p>
* A Jetty Provider that knows how to deploy a WebApp contained inside a Bundle.
*
*/
public class BundleWebAppProvider extends AbstractWebAppProvider implements BundleProvider
{
@ -53,17 +50,11 @@ public class BundleWebAppProvider extends AbstractWebAppProvider implements Bund
/* ------------------------------------------------------------ */
/**
* @param wrapper
*/
public BundleWebAppProvider (ServerInstanceWrapper wrapper)
{
super(wrapper);
}
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStart()
@ -108,7 +99,7 @@ public class BundleWebAppProvider extends AbstractWebAppProvider implements Bund
/* ------------------------------------------------------------ */
/**
* A bundle has been added that could be a webapp
* @param bundle
* @param bundle the bundle
*/
public boolean bundleAdded (Bundle bundle) throws Exception
{
@ -190,8 +181,8 @@ public class BundleWebAppProvider extends AbstractWebAppProvider implements Bund
/* ------------------------------------------------------------ */
/**
* Bundle has been removed. If it was a webapp we deployed, undeploy it.
* @param bundle
*
* @param bundle the bundle
* @return true if this was a webapp we had deployed, false otherwise
*/
public boolean bundleRemoved (Bundle bundle) throws Exception

View File

@ -36,13 +36,12 @@ import org.osgi.util.tracker.ServiceTracker;
/**
* JettyBootstrapActivator
*
* <p>
* Bootstrap jetty and publish a default Server instance as an OSGi service.
*
* <p>
* Listen for other Server instances to be published as services and support them as deployment targets.
*
* <p>
* Listen for Bundles to be activated, and deploy those that represent webapps/ContextHandlers to one of the known Server instances.
*
*/
public class JettyBootstrapActivator implements BundleActivator
{
@ -74,7 +73,7 @@ public class JettyBootstrapActivator implements BundleActivator
* webapps. Setup the BundleListener that supports the extender pattern for
* the jetty ContextHandler.
*
* @param context
* @param context the bundle context
*/
public void start(final BundleContext context) throws Exception
{

View File

@ -36,19 +36,15 @@ import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
/**
* ServiceWebAppProvider
*
* <p>
* Jetty Provider that knows how to deploy a WebApp that has been registered as an OSGi service.
*
*/
public class ServiceWebAppProvider extends AbstractWebAppProvider implements ServiceProvider
{
private static final Logger LOG = Log.getLogger(AbstractWebAppProvider.class);
/**
* Map of ServiceRef to App. Used when it is an osgi service that is a WebAppContext.
*/
@ -56,7 +52,6 @@ public class ServiceWebAppProvider extends AbstractWebAppProvider implements Ser
private ServiceRegistration _serviceRegForServices;
/**
* ServiceApp
*
@ -91,9 +86,6 @@ public class ServiceWebAppProvider extends AbstractWebAppProvider implements Ser
/* ------------------------------------------------------------ */
/**
* @param wrapper
*/
public ServiceWebAppProvider (ServerInstanceWrapper wrapper)
{
super(wrapper);

View File

@ -42,12 +42,11 @@ import org.osgi.framework.BundleContext;
/**
* DefaultJettyAtJettyHomeHelper
*
*
* <p>
* Creates a default instance of Jetty, based on the values of the
* System properties "jetty.home" or "jetty.home.bundle", one of which
* must be specified in order to create the default instance.
*
* <p>
* Called by the {@link JettyBootstrapActivator} during the starting of the
* bundle.
*/
@ -92,6 +91,9 @@ public class DefaultJettyAtJettyHomeHelper
* jetty.ssl.port are passed to the configuration files that might use them
* as part of their properties.
* </p>
* @param bundleContext the bundle context
* @return the configured server
* @throws Exception if unable to create / configure / or start the server
*/
public static Server startJettyAtJettyHome(BundleContext bundleContext) throws Exception
{
@ -288,9 +290,9 @@ public class DefaultJettyAtJettyHomeHelper
/**
* Get a resource representing a directory inside a bundle. If the dir is null,
* return a resource representing the installation location of the bundle.
* @param bundle
* @param dir
* @return
* @param bundle the bundle
* @param dir the directory
* @return the resource found
*/
public static Resource findDir (Bundle bundle, String dir)
{

View File

@ -206,7 +206,7 @@ public class ServerInstanceWrapper
* The classloader that should be the parent classloader for each webapp
* deployed on this server.
*
* @return
* @return the classloader
*/
public ClassLoader getParentClassLoaderForWebapps()
{

View File

@ -42,12 +42,9 @@ import org.osgi.util.tracker.ServiceTracker;
/**
* BundleWatcher
*
*
* Tracks the installation and removal of Bundles in the OSGi environment. Any bundles
* that are added are passed to the set of Jetty DeploymentManager providers to see if
* the bundle should be deployed as a webapp or ContextHandler into Jetty.
*
* @author hmalphettes
*/
public class BundleWatcher implements BundleTrackerCustomizer
{
@ -66,9 +63,6 @@ public class BundleWatcher implements BundleTrackerCustomizer
/* ------------------------------------------------------------ */
/**
* @throws Exception
*/
public BundleWatcher() throws Exception
{
_bundle = FrameworkUtil.getBundle(this.getClass());
@ -133,10 +127,6 @@ public class BundleWatcher implements BundleTrackerCustomizer
}
/* ------------------------------------------------------------ */
/**
* @param managedServerName
* @return
*/
public Map<ServiceReference, BundleProvider> getDeployers(String managedServerName)
{
if (managedServerName == null)

View File

@ -32,10 +32,9 @@ import java.util.Set;
/**
* LibExtClassLoaderHelper
*
*
* <p>
* Helper to create a URL class-loader with the jars inside
* ${jetty.home}/lib/ext and ${jetty.home}/resources. In an ideal world, every
* <code>${jetty.home}/lib/ext</code> and <code>${jetty.home}/resources</code>. In an ideal world, every
* library is an OSGi bundle that does loads nicely. To support standard jars or
* bundles that cannot be loaded in the current OSGi environment, we support
* inserting the jars in the usual jetty/lib/ext folders in the proper classpath
@ -43,7 +42,6 @@ import java.util.Set;
* <p>
* The drawback is that those jars will not be available in the OSGi
* classloader.
* </p>
* <p>
* Alternatives to placing jars in lib/ext:
* <ol>
@ -54,7 +52,6 @@ import java.util.Set;
* <li>Use equinox Buddy-Policy: register a buddy of the jetty bootstrapper
* bundle. (Note: it will work only on equinox)</li>
* </ol>
* </p>
*/
public class LibExtClassLoaderHelper
{
@ -76,11 +73,12 @@ public class LibExtClassLoaderHelper
/* ------------------------------------------------------------ */
/**
* @param server
* @param jettyHome the jetty home
* @param parentClassLoader the parent classloader
* @return a url classloader with the jars of resources, lib/ext and the
* jars passed in the other argument. The parent classloader usually
* is the JettyBootStrapper (an osgi classloader.
* @throws MalformedURLException
* @throws MalformedURLException if the jetty home reference is invalid
*/
public static ClassLoader createLibEtcClassLoader(File jettyHome, ClassLoader parentClassLoader) throws MalformedURLException
{
@ -132,12 +130,14 @@ public class LibExtClassLoaderHelper
/* ------------------------------------------------------------ */
/**
* @param server
* @param jarsContainerOrJars the jars via file references
* @param otherJarsOrFolder more jars via url references
* @param parentClassLoader the parent classloader
* @return a url classloader with the jars of resources, lib/ext and the
* jars passed in the other argument. The parent classloader usually
* is the JettyBootStrapper (an osgi classloader). If there was no
* extra jars to insert, then just return the parentClassLoader.
* @throws MalformedURLException
* @throws MalformedURLException if there is a bad jar file reference
*/
public static ClassLoader createLibExtClassLoader(List<File> jarsContainerOrJars, List<URL> otherJarsOrFolder, ClassLoader parentClassLoader)
throws MalformedURLException
@ -181,13 +181,14 @@ public class LibExtClassLoaderHelper
* depending too much directly on a particular logging framework.
* <p>
* We can afford to do some implementation specific code for a logging
* framework only in a fragment. <br>
* framework only in a fragment.
* <p>
* Trying to configure log4j and logback in here.
* </p>
* <p>
* We recommend that slf4j jars are all placed in the osgi framework. And a
* single implementation if possible packaged as an osgi bundle is there.
* </p>
* @param jettyHome the jetty home reference
* @param childrenFiles the map of child files
*/
protected static void processFilesInResourcesFolder(File jettyHome, Map<String, File> childrenFiles)
{

View File

@ -85,7 +85,7 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe
* @param parent The parent classloader.
* @param context The WebAppContext
* @param contributor The bundle that defines this web-application.
* @throws IOException
* @throws IOException if unable to cerate the OSGiWebappClassLoader
*/
public OSGiWebappClassLoader(ClassLoader parent, WebAppContext context, Bundle contributor)
throws IOException
@ -272,6 +272,7 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe
* WebappContext So we place a fake one there to start with. We replace it
* with the actual webapp context with this method. We also apply the
* extraclasspath there at the same time.
* @param webappContext the web app context
*/
public void setWebappContext(WebAppContext webappContext)
{

View File

@ -54,16 +54,11 @@ public class ServiceWatcher implements ServiceTrackerCustomizer
public static final String FILTER = "(objectclass=" + ServiceProvider.class.getName() + ")";
//track all instances of deployers of webapps as bundles
ServiceTracker _serviceTracker;
/* ------------------------------------------------------------ */
/**
* @param registry
*/
public ServiceWatcher() throws Exception
{
//track all instances of deployers of webapps
@ -75,10 +70,6 @@ public class ServiceWatcher implements ServiceTrackerCustomizer
/* ------------------------------------------------------------ */
/**
* @param managedServerName
* @return
*/
public Map<ServiceReference, ServiceProvider> getDeployers(String managedServerName)
{
if (managedServerName == null)
@ -154,9 +145,10 @@ public class ServiceWatcher implements ServiceTrackerCustomizer
/* ------------------------------------------------------------ */
/** Deploy ContextHandler that is a Service.
*
* @param reference
* @return
* @param context the bundle context
* @param contextHandler the context handler
* @param reference the service reference
* @return the object added
*/
public Object addService (BundleContext context, ContextHandler contextHandler, ServiceReference reference)
{
@ -200,8 +192,9 @@ public class ServiceWatcher implements ServiceTrackerCustomizer
/* ------------------------------------------------------------ */
/**
* Undeploy a ContextHandler that is a Service.
*
* @param reference
* @param context the bundle context
* @param contextHandler the context handler
* @param reference the service reference
*/
public void removeService (BundleContext context, ContextHandler contextHandler, ServiceReference reference)
{

View File

@ -22,10 +22,8 @@ import org.eclipse.jetty.osgi.boot.utils.internal.DefaultBundleClassLoaderHelper
import org.osgi.framework.Bundle;
/**
*
* BundleClassLoaderHelper
*
*
* <p>
* Is there a clean OSGi way to go from the Bundle object to the classloader of
* the Bundle ? You can certainly take a class inside the bundle and get the
* bundle's classloader that way. Getting the classloader directly from the
@ -34,11 +32,9 @@ import org.osgi.framework.Bundle;
* We could use fragments that are specific to each OSGi implementation. Using
* introspection here to keep packaging simple and avoid the multiplication of
* the jars.
* </p>
* <p>
* The default implementation relies on introspection and supports equinox-3.5
* and felix-2.0.0
* </p>
*/
public interface BundleClassLoaderHelper
{
@ -50,6 +46,7 @@ public interface BundleClassLoaderHelper
public static BundleClassLoaderHelper DEFAULT = new DefaultBundleClassLoaderHelper();
/**
* @param bundle the bundle
* @return The classloader of a given bundle. Assuming the bundle is
* started.
*/

View File

@ -28,12 +28,9 @@ import org.osgi.framework.Bundle;
/**
* BundleFileLocatorHelper
*
*
* <p>
* From a bundle to its location on the filesystem. Assumes the bundle is not a
* jar.
*
* @author hmalphettes
*/
public interface BundleFileLocatorHelper
{
@ -50,21 +47,20 @@ public interface BundleFileLocatorHelper
* other situations.
* <p>
* Currently only works with bundles that are not jar.
* </p>
*
* @param bundle The bundle
* @return Its installation location as a file.
* @throws Exception
* @throws Exception if unable to get the install location
*/
public File getBundleInstallLocation(Bundle bundle) throws Exception;
/**
* Locate a file inside a bundle.
*
* @param bundle
* @param path
* @return file object
* @throws Exception
* @param bundle the bundle
* @param path the path
* @return file the file object
* @throws Exception if unable to get the file
*/
public File getFileInBundle(Bundle bundle, String path) throws Exception;
@ -76,11 +72,11 @@ public interface BundleFileLocatorHelper
* files inside jars alone. In fact we only support the second situation for
* development purpose where the bundle was imported in pde and the classes
* kept in a jar.
* </p>
*
* @param bundle
* @param bundle the bundle
* @return The jar(s) file that is either the bundle itself, either the jars
* embedded inside it.
* @throws Exception if unable to locate the jars
*/
public File[] locateJarsInsideBundle(Bundle bundle) throws Exception;
@ -88,37 +84,37 @@ public interface BundleFileLocatorHelper
* Helper method equivalent to Bundle#getEntry(String entryPath) except that
* it searches for entries in the fragments by using the findEntries method.
*
* @param bundle
* @param entryPath
* @param bundle the bundle
* @param entryPath the entry path
* @return null or all the entries found for that path.
*/
public Enumeration<URL> findEntries(Bundle bundle, String entryPath);
/**
* Only useful for equinox: on felix we get the file:// or jar:// url
* Only useful for equinox: on felix we get the <code>file://</code> or <code>jar://</code> url
* already. Other OSGi implementations have not been tested
* <p>
* Get a URL to the bundle entry that uses a common protocol (i.e. file:
* jar: or http: etc.).
* </p>
* Get a URL to the bundle entry that uses a common protocol (i.e. <code>file:</code>
* <code>jar:</code> or <code>http:</code> etc.).
*
* @param url the url
* @return a URL to the bundle entry that uses a common protocol
* @throws Exception if unable to get the local url
*/
public URL getLocalURL(URL url) throws Exception;
/**
* Only useful for equinox: on felix we get the file:// url already. Other
* Only useful for equinox: on felix we get the <code>file://</code> url already. Other
* OSGi implementations have not been tested
* <p>
* Get a URL to the content of the bundle entry that uses the file:
* Get a URL to the content of the bundle entry that uses the <code>file:</code>
* protocol. The content of the bundle entry may be downloaded or extracted
* to the local file system in order to create a file: URL.
*
* @param url the url
* @return a URL to the content of the bundle entry that uses the file:
* protocol
* </p>
* @throws IOException
* @throws Exception
* @throws Exception if unable to get the file url
*/
public URL getFileURL(URL url) throws Exception;

View File

@ -28,10 +28,7 @@ import org.osgi.service.event.Event;
import org.osgi.service.event.EventAdmin;
/**
* EventSender
*
* Utility class for emiting OSGi EventAdmin events
*
*/
public class EventSender
{
@ -42,18 +39,10 @@ public class EventSender
public static final String UNDEPLOYED_EVENT = "org/osgi/service/web/UNDEPLOYED";
public static final String FAILED_EVENT = "org/osgi/service/web/FAILED";
private static final EventSender __instance = new EventSender();
private Bundle _myBundle;
private EventAdmin _eventAdmin;
/* ------------------------------------------------------------ */
/**
*
*/
private EventSender ()
{
_myBundle = FrameworkUtil.getBundle(EventSender.class);
@ -62,26 +51,11 @@ public class EventSender
_eventAdmin = (EventAdmin)_myBundle.getBundleContext().getService(ref);
}
/* ------------------------------------------------------------ */
/**
* @return
*/
public static EventSender getInstance()
{
return __instance;
}
/* ------------------------------------------------------------ */
/**
* @param topic
* @param wab
* @param contextPath
*/
public void send (String topic, Bundle wab, String contextPath)
{
if (topic==null || wab==null || contextPath==null)
@ -90,15 +64,6 @@ public class EventSender
send(topic, wab, contextPath, null);
}
/* ------------------------------------------------------------ */
/**
* @param topic
* @param wab
* @param contextPath
* @param ex
*/
public void send (String topic, Bundle wab, String contextPath, Exception ex)
{
if (_eventAdmin == null)

View File

@ -22,29 +22,21 @@ import java.net.URL;
import java.net.URLClassLoader;
/**
*
* FakeURLClassLoader
*
* <p>
* A URLClassloader that overrides the getURLs() method to return the list
* of urls passed in to the constructor, but otherwise acts as if it has no
* urls, which would cause it to delegate to the parent classloader (in this
* case an OSGi classloader).
*
* <p>
* The main use of this class is with jars containing tlds. Jasper expects a
* URL classloader to inspect for jars with tlds.
*
*/
public class FakeURLClassLoader extends URLClassLoader
{
private URL[] _jars;
/* ------------------------------------------------------------ */
/**
* @param osgiClassLoader
* @param jars
*/
public FakeURLClassLoader(ClassLoader osgiClassLoader, URL[] jars)
{
super(new URL[] {},osgiClassLoader);

View File

@ -27,9 +27,7 @@ import java.util.List;
import java.util.StringTokenizer;
/**
* Util
*
* Various useful functions used widely.
* Various useful functions utility methods for OSGi wide use.
*/
public class Util
{
@ -41,8 +39,8 @@ public class Util
*
* @param name the name of the header
* @param altName an alternative name for the header (useful for deprecated names)
* @param manifest
* @return
* @param manifest the dictionary
* @return the value from the manifest
*/
public static String getManifestHeaderValue (String name, String altName, Dictionary manifest)
{
@ -62,10 +60,10 @@ public class Util
* Treating the string as a separated list of filenames,
* convert and return the list of urls.
*
* @param val the separated list
* @param delims the separators (default is ,;)
* @return
* @throws MalformedURLException
* @param val the separated list of filenames
* @param delims the separators (default is <code>,;</code>)
* @return the list of URLs found in the input list
* @throws Exception if unable to convert entry to a URL
*/
public static List<URL> fileNamesAsURLs(String val, String delims)
throws Exception
@ -96,13 +94,13 @@ public class Util
/* ------------------------------------------------------------ */
/**
* recursively substitute the ${sysprop} by their actual system property.
* ${sysprop,defaultvalue} will use 'defaultvalue' as the value if no
* recursively substitute the <code>${sysprop}</code> by their actual system property.
* <code>${sysprop,defaultvalue}</code> will use <code>'defaultvalue'</code> as the value if no
* sysprop is defined. Not the most efficient code but we are shooting for
* simplicity and speed of development here.
*
* @param value
* @return
* @param value the input string
* @return the string with replaced properties
*/
public static String resolvePropertyValue(String value)
{

View File

@ -29,8 +29,7 @@ import org.osgi.framework.Bundle;
/**
* DefaultBundleClassLoaderHelper
*
*
* <p>
* Default implementation of the BundleClassLoaderHelper. Uses introspection to
* support equinox-3.5 and felix-2.0.0
*/
@ -133,7 +132,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper
/**
* Assuming the bundle is started.
*
* @param bundle
* @param bundle the bundle
* @return classloader object
*/
public ClassLoader getBundleClassLoader(Bundle bundle)

View File

@ -38,12 +38,9 @@ import org.osgi.framework.Bundle;
/**
* DefaultFileLocatorHelper
*
*
* <p>
* From a bundle to its location on the filesystem. Assumes the bundle is not a
* jar.
*
* @author hmalphettes
*/
public class DefaultFileLocatorHelper implements BundleFileLocatorHelper
{
@ -89,7 +86,7 @@ public class DefaultFileLocatorHelper implements BundleFileLocatorHelper
*
* @param bundle The bundle
* @return Its installation location as a file.
* @throws Exception
* @throws Exception if unable to get the bundle install location
*/
public File getBundleInstallLocation(Bundle bundle) throws Exception
{
@ -212,10 +209,10 @@ public class DefaultFileLocatorHelper implements BundleFileLocatorHelper
/**
* Locate a file inside a bundle.
*
* @param bundle
* @param path
* @param bundle the bundle
* @param path the path
* @return file object
* @throws Exception
* @throws Exception if unable to get the file in the bundle
*/
public File getFileInBundle(Bundle bundle, String path) throws Exception
{
@ -239,8 +236,8 @@ public class DefaultFileLocatorHelper implements BundleFileLocatorHelper
* it searches for entries in the fragments by using the Bundle#findEntries
* method.
*
* @param bundle
* @param entryPath
* @param bundle the bundle
* @param entryPath the entry path
* @return null or all the entries found for that path.
*/
public Enumeration<URL> findEntries(Bundle bundle, String entryPath)
@ -266,7 +263,7 @@ public class DefaultFileLocatorHelper implements BundleFileLocatorHelper
* kept in a jar.
* </p>
*
* @param bundle
* @param bundle the bundle
* @return The jar(s) file that is either the bundle itself, either the jars
* embedded inside it.
*/
@ -349,7 +346,7 @@ public class DefaultFileLocatorHelper implements BundleFileLocatorHelper
* @return a URL to the content of the bundle entry that uses the file:
* protocol
* </p>
* @throws IOException
* @throws Exception if unable to get the file url
*/
public URL getFileURL(URL url) throws Exception

View File

@ -36,11 +36,10 @@ import org.osgi.service.startlevel.StartLevel;
/**
* PackageAdminServiceTracker
*
*
* <p>
* When the PackageAdmin service is activated we can look for the fragments
* attached to this bundle and do a fake "activate" on them.
*
* <p>
* See particularly the jetty-osgi-boot-jsp fragment bundle that uses this
* facility.
*/
@ -124,8 +123,8 @@ public class PackageAdminServiceTracker implements ServiceListener
* bundle. when we drop the support for the older versions of OSGi, we will
* stop using the PackageAdmin service.
*
* @param bundle
* @return
* @param bundle the bundle
* @return the bundle fragment list
*/
public Bundle[] getFragments(Bundle bundle)
{
@ -143,9 +142,8 @@ public class PackageAdminServiceTracker implements ServiceListener
* collect the required-bundles and fragment when the directive
* visibility:=reexport is added to a required-bundle.
*
* @param bundle
* @param webFragOrAnnotationOrResources
* @return
* @param bundle the bundle
* @return the bundle fragment and required list
*/
public Bundle[] getFragmentsAndRequiredBundles(Bundle bundle)
{
@ -165,9 +163,13 @@ public class PackageAdminServiceTracker implements ServiceListener
* transitively when the directive 'visibility:=reexport' is added to a
* required-bundle.
*
* @param bundle
* @param webFragOrAnnotationOrResources
* @return
* @param bundle the bundle
* @param admin the admin package
* @param deps The map of fragment and required bundles associated to the value of the
* jetty-web attribute.
* @param onlyReexport true to collect resources and web-fragments
* transitively if and only if the directive visibility is
* reexport.
*/
protected void collectFragmentsAndRequiredBundles(Bundle bundle, PackageAdmin admin, Map<String, Bundle> deps, boolean onlyReexport)
{
@ -193,12 +195,13 @@ public class PackageAdminServiceTracker implements ServiceListener
* A simplistic but good enough parser for the Require-Bundle header. Parses
* the version range attribute and the visibility directive.
*
* @param bundle the bundle
* @param admin the admin package
* @param deps The map of required bundles associated to the value of the
* jetty-web attribute.
* @param onlyReexport true to collect resources and web-fragments
* transitively if and only if the directive visibility is
* reexport.
* @param bundle
* @return The map of required bundles associated to the value of the
* jetty-web attribute.
*/
protected void collectRequiredBundles(Bundle bundle, PackageAdmin admin, Map<String, Bundle> deps, boolean onlyReexport)
{