org.eclipse.jetty.osgi.boot
Class JettyBootstrapActivator

java.lang.Object
  extended by org.eclipse.jetty.osgi.boot.JettyBootstrapActivator
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class JettyBootstrapActivator
extends Object
implements org.osgi.framework.BundleActivator

Experiment: bootstrap jetty's complete distrib from an OSGi bundle. Progress:

  1. basic servlet [ok]
  2. basic jetty.xml [ok]
  3. basic jetty.xml and jetty-plus.xml [ok]
  4. basic jsp [ok with modifications]
  5. jsp with tag-libs [ok]
  6. test-jndi with atomikos and derby inside ${jetty.home}/lib/ext [ok]

  7. Constructor Summary
    JettyBootstrapActivator()
               
     
    Method Summary
    static JettyBootstrapActivator getInstance()
               
    static void registerContext(org.osgi.framework.Bundle contributor, String contextFilePath)
              Helper method that creates a new skeleton of a ContextHandler and registers it as an OSGi service.
    static void registerContext(org.osgi.framework.Bundle contributor, String contextFilePath, Dictionary<String,String> dic)
              Helper method that creates a new skeleton of a ContextHandler and registers it as an OSGi service.
    static void registerWebapplication(org.osgi.framework.Bundle contributor, String webappFolderPath, String contextPath)
              Helper method that creates a new org.jetty.webapp.WebAppContext and registers it as an OSGi service.
    static void registerWebapplication(org.osgi.framework.Bundle contributor, String webappFolderPath, String contextPath, Dictionary<String,String> dic)
              Helper method that creates a new org.jetty.webapp.WebAppContext and registers it as an OSGi service.
     void start(org.osgi.framework.BundleContext context)
              Setup a new jetty Server, registers it as a service.
     void stop(org.osgi.framework.BundleContext context)
               
    static void unregister(String contextPath)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    JettyBootstrapActivator

    public JettyBootstrapActivator()
    Method Detail

    getInstance

    public static JettyBootstrapActivator getInstance()

    start

    public void start(org.osgi.framework.BundleContext context)
               throws Exception
    Setup a new jetty Server, registers it as a service. Setup the Service tracker for the jetty ContextHandlers that are in charge of deploying the webapps. Setup the BundleListener that supports the extender pattern for the jetty ContextHandler.

    Specified by:
    start in interface org.osgi.framework.BundleActivator
    Parameters:
    context -
    Throws:
    Exception

    stop

    public void stop(org.osgi.framework.BundleContext context)
              throws Exception
    Specified by:
    stop in interface org.osgi.framework.BundleActivator
    Throws:
    Exception

    registerWebapplication

    public static void registerWebapplication(org.osgi.framework.Bundle contributor,
                                              String webappFolderPath,
                                              String contextPath)
                                       throws Exception
    Helper method that creates a new org.jetty.webapp.WebAppContext and registers it as an OSGi service. The tracker JettyContextHandlerServiceTracker will do the actual deployment.

    Parameters:
    contributor - The bundle
    webappFolderPath - The path to the root of the webapp. Must be a path relative to bundle; either an absolute path.
    contextPath - The context path. Must start with "/"
    Throws:
    Exception

    registerWebapplication

    public static void registerWebapplication(org.osgi.framework.Bundle contributor,
                                              String webappFolderPath,
                                              String contextPath,
                                              Dictionary<String,String> dic)
                                       throws Exception
    Helper method that creates a new org.jetty.webapp.WebAppContext and registers it as an OSGi service. The tracker JettyContextHandlerServiceTracker will do the actual deployment.

    Parameters:
    contributor - The bundle
    webappFolderPath - The path to the root of the webapp. Must be a path relative to bundle; either an absolute path.
    contextPath - The context path. Must start with "/"
    dic - TODO: parameter description
    Throws:
    Exception

    registerContext

    public static void registerContext(org.osgi.framework.Bundle contributor,
                                       String contextFilePath)
                                throws Exception
    Helper method that creates a new skeleton of a ContextHandler and registers it as an OSGi service. The tracker JettyContextHandlerServiceTracker will do the actual deployment.

    Parameters:
    contributor - The bundle that registers a new context
    contextFilePath - The path to the file inside the bundle that defines the context.
    Throws:
    Exception

    registerContext

    public static void registerContext(org.osgi.framework.Bundle contributor,
                                       String contextFilePath,
                                       Dictionary<String,String> dic)
                                throws Exception
    Helper method that creates a new skeleton of a ContextHandler and registers it as an OSGi service. The tracker JettyContextHandlerServiceTracker will do the actual deployment.

    Parameters:
    contributor - The bundle that registers a new context
    contextFilePath - The path to the file inside the bundle that defines the context.
    dic - TODO: parameter description
    Throws:
    Exception

    unregister

    public static void unregister(String contextPath)


    Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.