Applied code formatting rules.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1540653 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
index 2831627..2bb8f96 100644
--- a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
+++ b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
@@ -18,22 +18,18 @@
import org.apache.felix.http.base.internal.AbstractHttpActivator;
-public final class JettyActivator
- extends AbstractHttpActivator
+public final class JettyActivator extends AbstractHttpActivator
{
private JettyService jetty;
- protected void doStart()
- throws Exception
+ protected void doStart() throws Exception
{
super.doStart();
- this.jetty = new JettyService(getBundleContext(), getDispatcherServlet(), getEventDispatcher(),
- getHttpServiceController());
+ this.jetty = new JettyService(getBundleContext(), getDispatcherServlet(), getEventDispatcher(), getHttpServiceController());
this.jetty.start();
}
- protected void doStop()
- throws Exception
+ protected void doStop() throws Exception
{
this.jetty.stop();
super.doStop();
diff --git a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
index cb9cca5..5431d8c 100644
--- a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
+++ b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
@@ -60,7 +60,7 @@
/** Felix specific property to control whether to enable HTTPS. */
private static final String FELIX_HTTPS_ENABLE = "org.apache.felix.https.enable";
- private static final String OSCAR_HTTPS_ENABLE = "org.ungoverned.osgi.bundle.https.enable";
+ private static final String OSCAR_HTTPS_ENABLE = "org.ungoverned.osgi.bundle.https.enable";
/** Felix specific property to control whether to enable HTTP. */
private static final String FELIX_HTTP_ENABLE = "org.apache.felix.http.enable";
@@ -75,10 +75,10 @@
private static final String FELIX_HTTPS_CLIENT_CERT = "org.apache.felix.https.clientcertificate";
/** Felix specific property to control whether Jetty uses NIO or not for HTTP. Valid values are "true", "false". Default is true */
- public static final String FELIX_HTTP_NIO = "org.apache.felix.http.nio";
+ public static final String FELIX_HTTP_NIO = "org.apache.felix.http.nio";
/** Felix specific property to control whether Jetty uses NIO or not for HTTPS. Valid values are "true", "false". Default is the value of org.apache.felix.http.nio */
- public static final String FELIX_HTTPS_NIO = "org.apache.felix.https.nio";
+ public static final String FELIX_HTTPS_NIO = "org.apache.felix.https.nio";
/** Felix specific property to configure the session timeout in minutes (same session-timout in web.xml). Default is servlet container specific */
public static final String FELIX_SESSION_TIMEOUT = "org.apache.felix.http.session.timeout";
@@ -266,7 +266,8 @@
public void update(Dictionary props)
{
- if (props == null) {
+ if (props == null)
+ {
props = new Properties();
}
@@ -325,9 +326,12 @@
private int getIntProperty(Dictionary props, String name, int defValue)
{
- try {
+ try
+ {
return Integer.parseInt(getProperty(props, name, null));
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
return defValue;
}
}
@@ -341,8 +345,7 @@
}
if (value instanceof String)
{
- return new String[]
- { (String) value };
+ return new String[] { (String) value };
}
else if (value instanceof String[])
{
@@ -393,7 +396,8 @@
* configuration or the bundle context. If neither property is defined
* return the defValue.
*/
- public String getProperty(String name, String defValue) {
+ public String getProperty(String name, String defValue)
+ {
Object value = this.genericProperties.get(name);
if (value == null)
{
@@ -426,9 +430,12 @@
*/
public int getIntProperty(String name, int defValue)
{
- try {
+ try
+ {
return Integer.parseInt(getProperty(name, null));
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
return defValue;
}
}
diff --git a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java
index 4f89666..fb8b873 100644
--- a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java
+++ b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java
@@ -21,8 +21,7 @@
import org.apache.felix.http.base.internal.logger.SystemLogger;
import org.eclipse.jetty.util.log.Logger;
-public final class JettyLogger
- implements Logger
+public final class JettyLogger implements Logger
{
private final String name;
private boolean debugEnabled;
@@ -54,57 +53,71 @@
this.debugEnabled = enabled;
}
- public void debug(Throwable throwable) {
- if (this.debugEnabled) {
- SystemLogger.debug(throwable.getMessage());
- }
-
- }
+ public void debug(Throwable throwable)
+ {
+ if (this.debugEnabled)
+ {
+ SystemLogger.debug(throwable.getMessage());
+ }
- public void debug(String msg, Object... args) {
- if (this.debugEnabled) {
- SystemLogger.debug(MessageFormat.format(msg, args));
- }
- }
+ }
- public void debug(String msg, Throwable throwable) {
- if (this.debugEnabled) {
- SystemLogger.debug(msg + ": " + throwable.getMessage());
- }
- }
+ public void debug(String msg, Object... args)
+ {
+ if (this.debugEnabled)
+ {
+ SystemLogger.debug(MessageFormat.format(msg, args));
+ }
+ }
- public String getName() {
- return name;
- }
+ public void debug(String msg, Throwable throwable)
+ {
+ if (this.debugEnabled)
+ {
+ SystemLogger.debug(msg + ": " + throwable.getMessage());
+ }
+ }
- public void ignore(Throwable throwable) {
-
- }
+ public String getName()
+ {
+ return name;
+ }
- public void info(Throwable throwable) {
- SystemLogger.info(throwable.getMessage());
- }
+ public void ignore(Throwable throwable)
+ {
- public void info(String msg, Object... args) {
- SystemLogger.info(MessageFormat.format(msg, args));
-
- }
+ }
- public void info(String msg, Throwable throwable) {
- SystemLogger.info(msg + ": " + throwable.getMessage());
- }
+ public void info(Throwable throwable)
+ {
+ SystemLogger.info(throwable.getMessage());
+ }
- public void warn(Throwable throwable) {
- SystemLogger.warning(null, throwable);
- }
+ public void info(String msg, Object... args)
+ {
+ SystemLogger.info(MessageFormat.format(msg, args));
- public void warn(String msg, Object... args) {
- SystemLogger.warning(MessageFormat.format(msg, args), null);
-
- }
+ }
- public void warn(String msg, Throwable throwable) {
- SystemLogger.warning(msg, throwable);
- }
+ public void info(String msg, Throwable throwable)
+ {
+ SystemLogger.info(msg + ": " + throwable.getMessage());
+ }
+
+ public void warn(Throwable throwable)
+ {
+ SystemLogger.warning(null, throwable);
+ }
+
+ public void warn(String msg, Object... args)
+ {
+ SystemLogger.warning(MessageFormat.format(msg, args), null);
+
+ }
+
+ public void warn(String msg, Throwable throwable)
+ {
+ SystemLogger.warning(msg, throwable);
+ }
}
diff --git a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebAppBundleContext.java b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebAppBundleContext.java
index 0c50c60..548b18e 100644
--- a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebAppBundleContext.java
+++ b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebAppBundleContext.java
@@ -35,25 +35,34 @@
super(null, contextPath.substring(1), contextPath);
this.setBaseResource(new BundleURLResource(bundle.getEntry("/")));
- this.setClassLoader(new ClassLoader(parent) {
+ this.setClassLoader(new ClassLoader(parent)
+ {
@Override
- protected Class<?> findClass(String s) throws ClassNotFoundException {
+ protected Class<?> findClass(String s) throws ClassNotFoundException
+ {
// Don't try to load classes from the bundle when it is not active
- if (bundle.getState() == Bundle.ACTIVE) {
- try {
+ if (bundle.getState() == Bundle.ACTIVE)
+ {
+ try
+ {
return bundle.loadClass(s);
- } catch (ClassNotFoundException e) {
+ }
+ catch (ClassNotFoundException e)
+ {
}
}
return super.findClass(s);
}
@Override
- protected URL findResource(String name) {
+ protected URL findResource(String name)
+ {
// Don't try to load resources from the bundle when it is not active
- if (bundle.getState() == Bundle.ACTIVE) {
+ if (bundle.getState() == Bundle.ACTIVE)
+ {
URL url = bundle.getResource(name);
- if (url != null) {
+ if (url != null)
+ {
return url;
}
}
@@ -61,12 +70,15 @@
}
@Override
- @SuppressWarnings({"unchecked"})
- protected Enumeration<URL> findResources(String name) throws IOException {
+ @SuppressWarnings({ "unchecked" })
+ protected Enumeration<URL> findResources(String name) throws IOException
+ {
// Don't try to load resources from the bundle when it is not active
- if (bundle.getState() == Bundle.ACTIVE) {
+ if (bundle.getState() == Bundle.ACTIVE)
+ {
Enumeration<URL> urls = (Enumeration<URL>) bundle.getResources(name);
- if (urls != null) {
+ if (urls != null)
+ {
return urls;
}
}
@@ -79,7 +91,8 @@
@Override
public Resource newResource(URL url) throws IOException
{
- if (url == null) {
+ if (url == null)
+ {
return null;
}
return new BundleURLResource(url);
@@ -95,7 +108,8 @@
@Override
public synchronized void release()
{
- if (this._in != null) {
+ if (this._in != null)
+ {
// Do not close this input stream: it would invalidate
// the associated zipfile's inflater and every future access
// to some bundle entry leads to an NPE with message
@@ -108,7 +122,8 @@
@Override
public Resource addPath(String path) throws MalformedURLException
{
- if (path == null) {
+ if (path == null)
+ {
return null;
}
path = URIUtil.canonicalPath(path);
diff --git a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebEvent.java b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebEvent.java
index b5e2cc0..c22578d 100644
--- a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebEvent.java
+++ b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebEvent.java
@@ -64,23 +64,25 @@
return new Event(TOPIC_UNDEPLOYED, createBaseProperties(webAppBundle, extenderBundle));
}
- static Event FAILED(Bundle webAppBundle, Bundle extenderBundle, Throwable exception,
- String collision, Long collisionBundles)
+ static Event FAILED(Bundle webAppBundle, Bundle extenderBundle, Throwable exception, String collision, Long collisionBundles)
{
- Dictionary<String,Object> props = createBaseProperties(webAppBundle, extenderBundle);
- if (exception != null) {
+ Dictionary<String, Object> props = createBaseProperties(webAppBundle, extenderBundle);
+ if (exception != null)
+ {
props.put(EXCEPTION, exception);
}
- if (collision != null) {
+ if (collision != null)
+ {
props.put(COLLISION, collision);
}
- if (collisionBundles != null) {
+ if (collisionBundles != null)
+ {
props.put(COLLISION_BUNDLES, collisionBundles);
}
return new Event(TOPIC_FAILED, props);
}
- private static Dictionary<String,Object> createBaseProperties(Bundle webAppBundle, Bundle extenderBundle)
+ private static Dictionary<String, Object> createBaseProperties(Bundle webAppBundle, Bundle extenderBundle)
{
Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put(EventConstants.BUNDLE_SYMBOLICNAME, webAppBundle.getSymbolicName());