X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sdnr%2Fwireless-transport%2Fcode-Carbon-SR1%2Fapps%2Fdlux%2Floader%2Fimpl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fdlux%2Floader%2Fimplementation%2FDluxLoader.java;fp=sdnr%2Fwireless-transport%2Fcode-Carbon-SR1%2Fapps%2Fdlux%2Floader%2Fimpl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fdlux%2Floader%2Fimplementation%2FDluxLoader.java;h=0000000000000000000000000000000000000000;hb=1c1e7f98416875f3ee78af9103865c32f95a82a0;hp=df49a5e91a49ddb56f93baa44bfbc762278ae123;hpb=6a893bb0ae984d15076394d9225d4873ad953791;p=ccsdk%2Fapps.git diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/loader/impl/src/main/java/org/opendaylight/dlux/loader/implementation/DluxLoader.java b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/loader/impl/src/main/java/org/opendaylight/dlux/loader/implementation/DluxLoader.java deleted file mode 100644 index df49a5e9..00000000 --- a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/loader/impl/src/main/java/org/opendaylight/dlux/loader/implementation/DluxLoader.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) 2014 Inocybe Technologies, and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.dlux.loader.implementation; - -import javax.servlet.ServletException; - -import com.google.common.base.Preconditions; -import org.opendaylight.dlux.loader.DluxModuleLoader; -import org.opendaylight.dlux.loader.Module; -import org.opendaylight.dlux.loader.exception.DluxLoaderException; -import org.osgi.service.http.HttpService; -import org.osgi.service.http.NamespaceException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; - -public class DluxLoader implements DluxModuleLoader { - - private DluxLoaderIndexServlet index; - private static Logger logger = LoggerFactory.getLogger(DluxLoader.class); - - /** - * List of modules registered with dlux - */ - private List modules = new ArrayList<>(); - - private String RESOURCE_URL = "/"; - - private String RESOURCE_DIRECTORY = "/dlux"; - - private String SERVLET_URL = "/index.html"; - - @Override - public void addModule(Module module){ - modules.add(module); - } - - @Override - public void removeModule(Module module) { - modules.remove(module); - } - - public List getModules() { - return modules; - } - - public void onUnbindService(HttpService httpService) { - httpService.unregister(SERVLET_URL); - httpService.unregister(RESOURCE_URL); - index = null; - } - - public void onBindService(HttpService httpService) throws ServletException, NamespaceException, DluxLoaderException { - Preconditions.checkNotNull(httpService, - "Unable to inject HttpService into DluxLoader. dlux modules won't work without httpService"); - - index = new DluxLoaderIndexServlet(this); - httpService.registerServlet(SERVLET_URL, index, null, null); - httpService.registerResources(RESOURCE_URL, RESOURCE_DIRECTORY, null); - logger.info("DluxLoader Service initialization complete."); - } - -}