KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > equinox > http > servlet > internal > HttpServiceFactory


1 /*******************************************************************************
2  * Copyright (c) 2005-2007 Cognos Incorporated, IBM Corporation and others
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * Cognos Incorporated - initial API and implementation
10  * IBM Corporation - bug fixes and enhancements
11  *******************************************************************************/

12
13 package org.eclipse.equinox.http.servlet.internal;
14
15 import org.osgi.framework.*;
16
17 // Factory to create http services. This is because the service needs to be customized for each bundle in order to implement the default resource lookups.
18
public class HttpServiceFactory implements ServiceFactory {
19
20     private ProxyServlet proxy;
21
22     public HttpServiceFactory(ProxyServlet proxy) {
23         this.proxy = proxy;
24     }
25
26     public Object JavaDoc getService(Bundle bundle, ServiceRegistration registration) {
27         return new HttpServiceImpl(bundle, proxy);
28     }
29
30     public void ungetService(Bundle bundle, ServiceRegistration registration, Object JavaDoc service) {
31         ((HttpServiceImpl) service).unregisterAliases();
32
33     }
34
35 }
36
Popular Tags