Skip to content

Commit

Permalink
Format java files in o.e.equinox.http.servlet
Browse files Browse the repository at this point in the history
This was achieved by running:
eclipse -consolelog -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter \
  -config .settings/org.eclipse.jdt.core.prefs . -data `mktemp -d`

Signed-off-by: Torbjörn SVENSSON <[email protected]>
  • Loading branch information
Torbjorn-Svensson authored and vogella committed Oct 18, 2023
1 parent 5eb9d66 commit 686aa4a
Show file tree
Hide file tree
Showing 64 changed files with 1,303 additions and 1,667 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,48 @@
public interface ExtendedHttpService extends HttpService {

/**
* @param alias name in the URI namespace at which the filter is registered
* @param filter the filter object to register
* @param alias name in the URI namespace at which the filter is registered
* @param filter the filter object to register
* @param initparams initialization arguments for the filter or
* <code>null</code> if there are none. This argument is used by the
* filter's <code>FilterConfig</code> object.
* @param context the <code>HttpContext</code> object for the registered
* filter, or <code>null</code> if a default <code>HttpContext</code> is
* to be created and used.
* @throws javax.servlet.ServletException if the filter's <code>init</code>
* method throws an exception, or the given filter object has
* already been registered at a different alias.
* <code>null</code> if there are none. This argument is used
* by the filter's <code>FilterConfig</code> object.
* @param context the <code>HttpContext</code> object for the registered
* filter, or <code>null</code> if a default
* <code>HttpContext</code> is to be created and used.
* @throws javax.servlet.ServletException if the filter's <code>init</code>
* method throws an exception, or the
* given filter object has already
* been registered at a different
* alias.
* @throws java.lang.IllegalArgumentException if any of the arguments are
* invalid
* invalid
*/
public void registerFilter(String alias, Filter filter, Dictionary<String, String> initparams, HttpContext context) throws ServletException, NamespaceException;
public void registerFilter(String alias, Filter filter, Dictionary<String, String> initparams, HttpContext context)
throws ServletException, NamespaceException;

/**
* Unregisters a previous filter registration done by the
* <code>registerFilter</code> methods.
*
* <p>
* After this call, the registered filter will no
* longer be available. The Http Service must call the <code>destroy</code>
* method of the filter before returning.
* After this call, the registered filter will no longer be available. The Http
* Service must call the <code>destroy</code> method of the filter before
* returning.
* <p>
* If the bundle which performed the registration is stopped or otherwise
* "unget"s the Http Service without calling {@link #unregisterFilter} then the Http
* Service must automatically unregister the filter registration. However, the
* <code>destroy</code> method of the filter will not be called in this case since
* the bundle may be stopped.
* {@link #unregisterFilter} must be explicitly called to cause the
* <code>destroy</code> method of the filter to be called. This can be done
* in the <code>BundleActivator.stop</code> method of the
* "unget"s the Http Service without calling {@link #unregisterFilter} then the
* Http Service must automatically unregister the filter registration. However,
* the <code>destroy</code> method of the filter will not be called in this case
* since the bundle may be stopped. {@link #unregisterFilter} must be explicitly
* called to cause the <code>destroy</code> method of the filter to be called.
* This can be done in the <code>BundleActivator.stop</code> method of the
* bundle registering the filter.
*
* @param filter the filter object to unregister
* @throws java.lang.IllegalArgumentException if there is no registration
* for the filter or the calling bundle was not the bundle which
* registered the filter.
* @throws java.lang.IllegalArgumentException if there is no registration for
* the filter or the calling bundle
* was not the bundle which
* registered the filter.
*/
public void unregisterFilter(Filter filter);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
import org.eclipse.equinox.http.servlet.internal.servlet.ProxyServlet;

/**
* The HttpServiceServlet is the "public" side of a Servlet that when registered (and init() called) in a servlet container
* will in-turn register and provide an OSGi Http Service implementation.
* This class is not meant for extending or even using directly and is purely meant for registering
* in a servlet container.
* The HttpServiceServlet is the "public" side of a Servlet that when registered
* (and init() called) in a servlet container will in-turn register and provide
* an OSGi Http Service implementation. This class is not meant for extending or
* even using directly and is purely meant for registering in a servlet
* container.
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class HttpServiceServlet extends ProxyServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
import org.osgi.service.http.context.ServletContextHelper;

/**
* A custom servlet context helper type providing support for predicting the need
* for ranged content responses based on the content type and the user agent.
* A custom servlet context helper type providing support for predicting the
* need for ranged content responses based on the content type and the user
* agent.
*
* @since 1.5
*/
Expand All @@ -43,7 +44,7 @@ public RangeAwareServletContextHelper(Bundle bundle) {
* for a known ranged content type.
*
* @param contentType the content type of the request
* @param userAgent the value obtained from the "User-Agent" header
* @param userAgent the value obtained from the "User-Agent" header
*/
public boolean rangeableContentType(String contentType, String userAgent) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,53 @@

/**
* A customizer that is called by the Http Whiteboard runtime in order to allow
* customization of context path used for servlets, resources and filters.
* There are two types of customizations that are allowed.
* customization of context path used for servlets, resources and filters. There
* are two types of customizations that are allowed.
* <ol>
* <li>Control the default selection filter used when no &quot;osgi.http.whiteboard.context.select&quot;
* is specified.</li>
* <li>Provide a prefix to the context path &quot;osgi.http.whiteboard.context.path&quot;
* specified by ServletContextHelper registrations.</li>
* <li>Control the default selection filter used when no
* &quot;osgi.http.whiteboard.context.select&quot; is specified.</li>
* <li>Provide a prefix to the context path
* &quot;osgi.http.whiteboard.context.path&quot; specified by
* ServletContextHelper registrations.</li>
* </ol>
* <p>
* Registering a customizer results in re-initializing all existing ServletContextHelper registrations.
* This should not be done often. Only the highest ranked customizer is used the runtime.
* Registering a customizer results in re-initializing all existing
* ServletContextHelper registrations. This should not be done often. Only the
* highest ranked customizer is used the runtime.
* </p>
* <p>
* <b>Note:</b> This class is part of an interim SPI that is still under
* development and expected to change significantly before reaching stability.
* It is being made available at this early stage to solicit feedback from pioneering
* adopters on the understanding that any code that uses this SPI will almost certainly
* be broken (repeatedly) as the SPI evolves.
* <b>Note:</b> This class is part of an interim SPI that is still under
* development and expected to change significantly before reaching stability.
* It is being made available at this early stage to solicit feedback from
* pioneering adopters on the understanding that any code that uses this SPI
* will almost certainly be broken (repeatedly) as the SPI evolves.
* </p>
*
* @since 1.2
*/
public abstract class ContextPathCustomizer {
/**
* Returns a service filter that is used to select the default ServletContextHelper when no
* selection filter is specified by the whiteboard service. This method is only
* called if the supplied whiteboard service does not provide the
* &quot;osgi.http.whiteboard.context.select&quot; service property.
* Returns a service filter that is used to select the default
* ServletContextHelper when no selection filter is specified by the whiteboard
* service. This method is only called if the supplied whiteboard service does
* not provide the &quot;osgi.http.whiteboard.context.select&quot; service
* property.
*
* @param httpWhiteBoardService
* @return a service filter that is used to select the default SErvletContextHelper for the
* specified whiteboard service.
* @return a service filter that is used to select the default
* SErvletContextHelper for the specified whiteboard service.
*/
public String getDefaultContextSelectFilter(ServiceReference<?> httpWhiteBoardService) {
return null;
}

/**
* Returns a prefix that is prepended to the context path value
* specified by the supplied helper's &quot;osgi.http.whiteboard.context.path&quot;
* service property.
* Returns a prefix that is prepended to the context path value specified by the
* supplied helper's &quot;osgi.http.whiteboard.context.path&quot; service
* property.
*
* @param helper the helper for which the context path will be prepended to
* @return the prefix to prepend to the context path
* @return the prefix to prepend to the context path
*/
public String getContextPathPrefix(ServiceReference<ServletContextHelper> helper) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.osgi.service.http.runtime.dto.FailedServletDTO;

/**
* This type may become irrelevant if the properties appear as part of a
* future OSGi Http Whiteboard specification.
* This type may become irrelevant if the properties appear as part of a future
* OSGi Http Whiteboard specification.
*/
@Deprecated
public class ExtendedFailedServletDTO extends FailedServletDTO {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.osgi.service.http.runtime.dto.ServletDTO;

/**
* This type may become irrelevant if the properties appear as part of a
* future OSGi Http Whiteboard specification.
* This type may become irrelevant if the properties appear as part of a future
* OSGi Http Whiteboard specification.
*/
@Deprecated
public class ExtendedServletDTO extends ServletDTO {
Expand Down
Loading

0 comments on commit 686aa4a

Please sign in to comment.