mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 13:21:53 +01:00
Merge pull request #9 from kaikreuzer/init
removed the core.init bundle as it is no longer required
This commit is contained in:
commit
43e3908fd2
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.openhab.core.init</name>
|
||||
<comment>This is the logging initializing component of the open Home Automation Bus (openHAB)</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ds.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -1,8 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
@ -1,9 +0,0 @@
|
||||
#Fri Feb 19 21:35:42 CET 2010
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
fullBuildGoals=process-test-resources
|
||||
includeModules=false
|
||||
resolveWorkspaceProjects=true
|
||||
resourceFilterGoals=process-resources resources\:testResources
|
||||
skipCompilerPlugin=true
|
||||
version=1
|
@ -1,21 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Service-Component: OSGI-INF/logservice.xml
|
||||
Bundle-Name: openHAB Initializer
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-Vendor: openHAB.org
|
||||
Bundle-Version: 2.0.0.qualifier
|
||||
Bundle-Activator: org.openhab.core.init.internal.InitActivator
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Description: This is the initializer component of the
|
||||
open Home Automation Bus (openHAB)
|
||||
Bundle-License: http://www.eclipse.org/legal/epl-v10.html
|
||||
Import-Package: org.apache.commons.io,
|
||||
org.apache.commons.lang,
|
||||
org.eclipse.smarthome.config.core,
|
||||
org.osgi.framework,
|
||||
org.osgi.service.log,
|
||||
org.slf4j,
|
||||
org.slf4j.bridge
|
||||
Bundle-SymbolicName: org.openhab.core.init
|
||||
Bundle-DocURL: http://www.openhab.org
|
||||
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2015-2015 Kai Kreuzer 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
|
||||
|
||||
-->
|
||||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" deactivate="deactivate" name="org.openhab.core.logservice">
|
||||
<implementation class="org.openhab.core.init.internal.OSGILogListener"/>
|
||||
<reference bind="addLogReaderService" cardinality="0..n" interface="org.osgi.service.log.LogReaderService" name="LogReaderService" policy="dynamic" unbind="removeLogReaderService"/>
|
||||
</scr:component>
|
@ -1,6 +0,0 @@
|
||||
output.. = target/classes/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
OSGI-INF/
|
||||
source.. = src/main/java/,\
|
||||
src/main/resources/
|
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.openhab.core</groupId>
|
||||
<artifactId>pom-bundles</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>org.openhab.core.init</artifactId>
|
||||
|
||||
<name>openHAB Initializer</name>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
</project>
|
@ -1,31 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2015-2015 Kai Kreuzer 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.openhab.core.init.internal;
|
||||
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.slf4j.bridge.SLF4JBridgeHandler;
|
||||
|
||||
/**
|
||||
* This activator sets up slf4j with all bridges for the different logging frameworks.
|
||||
*
|
||||
* @author Kai Kreuzer
|
||||
*/
|
||||
public class InitActivator implements BundleActivator {
|
||||
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
SLF4JBridgeHandler.removeHandlersForRootLogger();
|
||||
SLF4JBridgeHandler.install();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {}
|
||||
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2015-2015 Kai Kreuzer 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.openhab.core.init.internal;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.osgi.service.log.LogEntry;
|
||||
import org.osgi.service.log.LogListener;
|
||||
import org.osgi.service.log.LogReaderService;
|
||||
import org.osgi.service.log.LogService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.Marker;
|
||||
import org.slf4j.MarkerFactory;
|
||||
|
||||
/**
|
||||
* This is an adapter for forwarding OSGi Log Service entries to our logging backend (slf4j).
|
||||
*
|
||||
* @author Kai Kreuzer
|
||||
* @since 0.1.0
|
||||
*
|
||||
*/
|
||||
public class OSGILogListener {
|
||||
|
||||
/** a map for storing the different listeners (one for each log service) */
|
||||
static private Map<LogReaderService, NLogListener> logReaderMap = new HashMap<LogReaderService, NLogListener>();
|
||||
|
||||
public void activate() {}
|
||||
|
||||
public void deactivate() {
|
||||
logReaderMap.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by the OSGi DS whenever there is a new log reader service available.
|
||||
* Usually there is only one, but in general there could be multiple services available.
|
||||
*
|
||||
* @param aLogReaderService a new log reader service
|
||||
*/
|
||||
public void addLogReaderService(LogReaderService aLogReaderService) {
|
||||
NLogListener listener = new NLogListener();
|
||||
logReaderMap.put(aLogReaderService, listener);
|
||||
aLogReaderService.addLogListener(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by the OSGi DS whenever a service becomes unavailable.
|
||||
*
|
||||
* @param aLogReaderService the service that is no longer available
|
||||
*/
|
||||
public void removeLogReaderService(LogReaderService aLogReaderService) {
|
||||
logReaderMap.remove(aLogReaderService);
|
||||
}
|
||||
|
||||
/**
|
||||
* We use this private class as a listener for OSGi log entries. Whenever it is
|
||||
* notified of a log entry, it forwards this entry to slf4j.
|
||||
*
|
||||
* @author Kai Kreuzer
|
||||
* @author Jochen Hiller - Fix #068 NPE when getBundle() is null
|
||||
* @since 0.1.0
|
||||
*
|
||||
*/
|
||||
private static class NLogListener implements LogListener {
|
||||
public void logged(LogEntry entry) {
|
||||
Logger logger = LoggerFactory.getLogger("OSGi");
|
||||
String markerName = entry.getBundle() == null ? "unknownBundle" : entry.getBundle().getSymbolicName();
|
||||
Marker marker = MarkerFactory.getMarker(markerName);
|
||||
switch(entry.getLevel()) {
|
||||
case LogService.LOG_DEBUG: logger.debug(marker, entry.getMessage(), entry.getException()); break;
|
||||
case LogService.LOG_INFO: logger.info(marker, entry.getMessage(), entry.getException()); break;
|
||||
case LogService.LOG_WARNING: logger.warn(marker, entry.getMessage(), entry.getException()); break;
|
||||
case LogService.LOG_ERROR: logger.error(marker, entry.getMessage(), entry.getException()); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1 +0,0 @@
|
||||
Bundle resources go in here!
|
@ -17,7 +17,6 @@
|
||||
|
||||
<modules>
|
||||
<module>org.openhab.core</module>
|
||||
<module>org.openhab.core.init</module>
|
||||
<module>org.openhab.core.compat1x</module>
|
||||
<module>org.openhab.core.compat1x.test</module>
|
||||
<module>org.openhab.core.karaf</module>
|
||||
|
@ -50,13 +50,6 @@
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.openhab.core.init"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.openhab.ui.dashboard"
|
||||
download-size="0"
|
||||
|
Loading…
Reference in New Issue
Block a user