Author: jawi
Date: Mon Nov 11 10:06:18 2013
New Revision: 1540653
URL: http://svn.apache.org/r1540653
Log:
Applied code formatting rules.
Modified:
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebAppBundleContext.java
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebEvent.java
Modified:
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
URL:
http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java?rev=1540653&r1=1540652&r2=1540653&view=diff
==============================================================================
---
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
(original)
+++
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
Mon Nov 11 10:06:18 2013
@@ -18,22 +18,18 @@ package org.apache.felix.http.jetty.inte
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();
Modified:
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
URL:
http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java?rev=1540653&r1=1540652&r2=1540653&view=diff
==============================================================================
---
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
(original)
+++
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
Mon Nov 11 10:06:18 2013
@@ -60,7 +60,7 @@ public final class JettyConfig
/** 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 @@ public final class JettyConfig
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 final class JettyConfig
public void update(Dictionary props)
{
- if (props == null) {
+ if (props == null)
+ {
props = new Properties();
}
@@ -325,9 +326,12 @@ public final class JettyConfig
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 @@ public final class JettyConfig
}
if (value instanceof String)
{
- return new String[]
- { (String) value };
+ return new String[] { (String) value };
}
else if (value instanceof String[])
{
@@ -393,7 +396,8 @@ public final class JettyConfig
* 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 final class JettyConfig
*/
public int getIntProperty(String name, int defValue)
{
- try {
+ try
+ {
return Integer.parseInt(getProperty(name, null));
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
return defValue;
}
}
Modified:
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java
URL:
http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java?rev=1540653&r1=1540652&r2=1540653&view=diff
==============================================================================
---
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java
(original)
+++
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java
Mon Nov 11 10:06:18 2013
@@ -21,8 +21,7 @@ import java.text.MessageFormat;
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 @@ public final class JettyLogger
this.debugEnabled = enabled;
}
- 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 String getName() {
- return name;
- }
-
- public void ignore(Throwable throwable) {
-
- }
-
- public void info(Throwable throwable) {
- SystemLogger.info(throwable.getMessage());
- }
-
- 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 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);
- }
+ 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 String getName()
+ {
+ return name;
+ }
+
+ public void ignore(Throwable throwable)
+ {
+
+ }
+
+ public void info(Throwable throwable)
+ {
+ SystemLogger.info(throwable.getMessage());
+ }
+
+ 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 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);
+ }
}
Modified:
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebAppBundleContext.java
URL:
http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebAppBundleContext.java?rev=1540653&r1=1540652&r2=1540653&view=diff
==============================================================================
---
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebAppBundleContext.java
(original)
+++
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebAppBundleContext.java
Mon Nov 11 10:06:18 2013
@@ -35,25 +35,34 @@ class WebAppBundleContext extends WebApp
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 @@ class WebAppBundleContext extends WebApp
}
@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 @@ class WebAppBundleContext extends WebApp
@Override
public Resource newResource(URL url) throws IOException
{
- if (url == null) {
+ if (url == null)
+ {
return null;
}
return new BundleURLResource(url);
@@ -95,7 +108,8 @@ class WebAppBundleContext extends WebApp
@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 @@ class WebAppBundleContext extends WebApp
@Override
public Resource addPath(String path) throws MalformedURLException
{
- if (path == null) {
+ if (path == null)
+ {
return null;
}
path = URIUtil.canonicalPath(path);
Modified:
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebEvent.java
URL:
http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebEvent.java?rev=1540653&r1=1540652&r2=1540653&view=diff
==============================================================================
---
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebEvent.java
(original)
+++
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/WebEvent.java
Mon Nov 11 10:06:18 2013
@@ -64,23 +64,25 @@ public abstract class WebEvent
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());