work in progress for OSGi boot to use Deployment manager

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1177 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2010-01-05 00:32:37 +00:00
parent 238cb5b5fc
commit 6ba39e7fdf
1 changed files with 13 additions and 8 deletions

View File

@ -34,6 +34,7 @@ import java.util.zip.ZipEntry;
import org.eclipse.jetty.deploy.AppProvider;
import org.eclipse.jetty.deploy.DeploymentManager;
import org.eclipse.jetty.osgi.boot.JettyBootstrapActivator;
import org.eclipse.jetty.osgi.boot.OSGiAppProvider;
import org.eclipse.jetty.osgi.boot.OSGiWebappConstants;
import org.eclipse.jetty.osgi.boot.internal.jsp.TldLocatableURLClassloader;
import org.eclipse.jetty.osgi.boot.utils.BundleClassLoaderHelper;
@ -124,6 +125,8 @@ class WebappRegistrationHelper
private DeploymentManager _deploymentManager;
private OSGiAppProvider _provider;
public WebappRegistrationHelper(Server server)
{
_server = server;
@ -362,16 +365,10 @@ class WebappRegistrationHelper
System.setProperty("java.naming.factory.url.pkgs","org.eclipse.jetty.jndi");
}
// Get the context handler
_ctxtHandler = (ContextHandlerCollection)_server.getChildHandlerByClass(ContextHandlerCollection.class);
if (_ctxtHandler == null)
{
throw new IllegalStateException("ERROR: No ContextHandlerCollection was configured" + " with the server to add applications to."
+ "Using a default one is not supported at" + " this point. " + " Please review the jetty.xml file used.");
}
// get a deployerManager
List<DeploymentManager> deployers = _server.getBeans(DeploymentManager.class);
if (deployers != null && !deployers.isEmpty())
{
@ -379,10 +376,18 @@ class WebappRegistrationHelper
for (AppProvider provider : _deploymentManager.getAppProviders())
{
// if (provider instanceof OSGiAppProvider)
if (provider instanceof OSGiAppProvider)
{
_provider=(OSGiAppProvider)provider;
break;
}
}
}
if (_ctxtHandler == null || _provider==null)
throw new IllegalStateException("ERROR: No ContextHandlerCollection or OSGiAppProvider configured");
}
/**