org.apache.felix.http.jetty
Class Activator

java.lang.Object
  extended by org.apache.felix.http.jetty.Activator
All Implemented Interfaces:
BundleActivator

public class Activator
extends Object
implements BundleActivator

Basic implementation of OSGi HTTP service 1.1. TODO: - fuller suite of testing and compatibility tests - only exposed params are those defined in the OSGi spec. Jetty is very tunable via params, some of which it may be useful to expose - no cacheing is performed on delivered resources. Although not part of the OSGi spec, it also isn't precluded and would enhance performance in a high usage environment. Jetty's ResourceHandler class could be a model for this. - scanning the Jetty ResourceHandler class it's clear that there are many other sophisticated areas to do with resource handling such as checking date and range fields in the http headers. It's not clear whether any of these play a part in the OSGi service - the spec just describes "returning the contents of the URL to the client" which doesn't state what other HTTP handling might be compliant or desirable


Nested Class Summary
 class Activator.ConnectorListener
           
 class Activator.HttpServiceFactory
           
 
Field Summary
protected static boolean debug
           
static boolean DEFAULT_HTTP_ENABLE
           
static int DEFAULT_HTTP_PORT
           
static boolean DEFAULT_HTTPS_ENABLE
           
static int DEFAULT_HTTPS_PORT
           
static String DEFAULT_SSL_PROVIDER
           
static boolean DEFAULT_USE_NIO
           
static String FELIX_HTTP_DEBUG
          Felix specific property to enable debug messages
static String FELIX_HTTP_ENABLE
          Felix specific property to control whether to enable HTTP.
static String FELIX_HTTPS_ENABLE
          Felix specific property to control whether to enable HTTPS.
static String FELIX_KEYSTORE
          Felix specific property to override the keystore file location.
static String FELIX_KEYSTORE_KEY_PASSWORD
          Felix specific property to override the keystore key password.
static String FELIX_KEYSTORE_PASSWORD
          Felix specific property to override the keystore password.
static String FELIX_SSL_PROVIDER
          Felix specific property to override the SSL provider.
static String HTTP_DEBUG
           
static String HTTP_NIO
          Felix specific property to control whether NIO will be used.
static String HTTP_PORT
          Standard OSGi port property for HTTP service
static String HTTP_SVCPROP_PORT
          Felix specific property to determine the name of the service property to set with the http port used.
static String HTTPS_PORT
          Standard OSGi port property for HTTPS service
static String HTTPS_SVCPROP_PORT
          Felix specific property to determine the name of the service property to set with the https port used.
static String OSCAR_HTTPS_ENABLE
           
static String OSCAR_KEYSTORE
           
static String OSCAR_KEYSTORE_KEY_PASSWORD
           
static String OSCAR_KEYSTORE_PASSWORD
           
static String OSCAR_SSL_PROVIDER
           
 
Constructor Summary
Activator()
           
 
Method Summary
static void debug(String txt)
           
 boolean getBooleanProperty(String name, boolean dflt_val)
           
 int getIntProperty(String name, int dflt_val)
           
 String getStringProperty(String name, String dflt_val)
           
protected  void initializeHTTPS()
           
protected  void initializeJetty()
           
protected  void initializeJettyLogger()
           
static void log(int level, String message, Throwable throwable)
           
 void start(BundleContext bundleContext)
           
 void stop(BundleContext bundleContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HTTP_ENABLE

public static final boolean DEFAULT_HTTP_ENABLE
See Also:
Constant Field Values

DEFAULT_HTTPS_ENABLE

public static final boolean DEFAULT_HTTPS_ENABLE
See Also:
Constant Field Values

DEFAULT_USE_NIO

public static final boolean DEFAULT_USE_NIO
See Also:
Constant Field Values

DEFAULT_HTTPS_PORT

public static final int DEFAULT_HTTPS_PORT
See Also:
Constant Field Values

DEFAULT_HTTP_PORT

public static final int DEFAULT_HTTP_PORT
See Also:
Constant Field Values

DEFAULT_SSL_PROVIDER

public static final String DEFAULT_SSL_PROVIDER
See Also:
Constant Field Values

FELIX_SSL_PROVIDER

public static final String FELIX_SSL_PROVIDER
Felix specific property to override the SSL provider.

See Also:
Constant Field Values

OSCAR_SSL_PROVIDER

public static final String OSCAR_SSL_PROVIDER
See Also:
Constant Field Values

FELIX_KEYSTORE_KEY_PASSWORD

public static final String FELIX_KEYSTORE_KEY_PASSWORD
Felix specific property to override the keystore key password.

See Also:
Constant Field Values

OSCAR_KEYSTORE_KEY_PASSWORD

public static final String OSCAR_KEYSTORE_KEY_PASSWORD
See Also:
Constant Field Values

FELIX_KEYSTORE

public static final String FELIX_KEYSTORE
Felix specific property to override the keystore file location.

See Also:
Constant Field Values

OSCAR_KEYSTORE

public static final String OSCAR_KEYSTORE
See Also:
Constant Field Values

FELIX_KEYSTORE_PASSWORD

public static final String FELIX_KEYSTORE_PASSWORD
Felix specific property to override the keystore password.

See Also:
Constant Field Values

OSCAR_KEYSTORE_PASSWORD

public static final String OSCAR_KEYSTORE_PASSWORD
See Also:
Constant Field Values

HTTP_PORT

public static final String HTTP_PORT
Standard OSGi port property for HTTP service

See Also:
Constant Field Values

HTTPS_PORT

public static final String HTTPS_PORT
Standard OSGi port property for HTTPS service

See Also:
Constant Field Values

FELIX_HTTP_DEBUG

public static final String FELIX_HTTP_DEBUG
Felix specific property to enable debug messages

See Also:
Constant Field Values

HTTP_DEBUG

public static final String HTTP_DEBUG
See Also:
Constant Field Values

HTTP_SVCPROP_PORT

public static final String HTTP_SVCPROP_PORT
Felix specific property to determine the name of the service property to set with the http port used. If not supplied then the HTTP_PORT property name will be used for the service property

See Also:
Constant Field Values

HTTPS_SVCPROP_PORT

public static final String HTTPS_SVCPROP_PORT
Felix specific property to determine the name of the service property to set with the https port used. If not supplied then the HTTPS_PORT property name will be used for the service property

See Also:
Constant Field Values

HTTP_NIO

public static final String HTTP_NIO
Felix specific property to control whether NIO will be used. If not supplied then will default to true.

See Also:
Constant Field Values

FELIX_HTTPS_ENABLE

public static final String FELIX_HTTPS_ENABLE
Felix specific property to control whether to enable HTTPS.

See Also:
Constant Field Values

OSCAR_HTTPS_ENABLE

public static final String OSCAR_HTTPS_ENABLE
See Also:
Constant Field Values

FELIX_HTTP_ENABLE

public static final String FELIX_HTTP_ENABLE
Felix specific property to control whether to enable HTTP.

See Also:
Constant Field Values

debug

protected static boolean debug
Constructor Detail

Activator

public Activator()
Method Detail

start

public void start(BundleContext bundleContext)
           throws BundleException
Specified by:
start in interface BundleActivator
Throws:
BundleException

stop

public void stop(BundleContext bundleContext)
          throws BundleException
Specified by:
stop in interface BundleActivator
Throws:
BundleException

getIntProperty

public int getIntProperty(String name,
                          int dflt_val)

getBooleanProperty

public boolean getBooleanProperty(String name,
                                  boolean dflt_val)

getStringProperty

public String getStringProperty(String name,
                                String dflt_val)

initializeJettyLogger

protected void initializeJettyLogger()

initializeJetty

protected void initializeJetty()
                        throws Exception
Throws:
Exception

initializeHTTPS

protected void initializeHTTPS()
                        throws Exception
Throws:
Exception

debug

public static void debug(String txt)

log

public static void log(int level,
                       String message,
                       Throwable throwable)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.