Skip to content

Implement 101.8.4 Log Events #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- 'http/**'
- 'tools/maven-bundle-plugin/**'
- 'tools/osgicheck-maven-plugin/**'
- 'log/**'
- 'webconsole/**'
pull_request:
branches: [ "master" ]
Expand All @@ -17,7 +18,8 @@ on:
- 'tools/maven-bundle-plugin/**'
- 'tools/osgicheck-maven-plugin/**'
- 'webconsole/**'

- 'log/**'

permissions: {}

jobs:
Expand All @@ -34,7 +36,7 @@ jobs:
- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: 3.9.7
maven-version: 3.9.9
- name: Check which subproject changed and build affected ones
uses: dorny/paths-filter@v3
id: changes
Expand All @@ -50,10 +52,16 @@ jobs:
- 'tools/osgicheck-maven-plugin/**'
webconsole:
- 'webconsole/**'
log:
- 'log/**'

- name: Felix SCR
if: steps.changes.outputs.scr == 'true'
run: mvn -B -V -Dstyle.color=always --file scr/pom.xml clean verify
- name: Felix HTTP
- name: Felix Log
if: steps.changes.outputs.log == 'true'
run: mvn -B -V -Dstyle.color=always --file log/pom.xml clean verify
- name: Felix HTTP
if: steps.changes.outputs.http == 'true'
run: mvn -B -V -Dstyle.color=always "-Dit.test=!MissingWebsocketDependenciesIT" --file http/pom.xml clean install verify
- name: Felix Maven bundle plugin
Expand Down
30 changes: 15 additions & 15 deletions eventadmin/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.felix</groupId>
<artifactId>felix-parent</artifactId>
<version>7</version>
<version>9</version>
<relativePath>../../pom/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -53,7 +53,7 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<version>6.0.0</version>
<version>7.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -71,7 +71,7 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.log</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -96,38 +96,38 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.5</version>
<version>1.7.36</version>
<scope>test</scope>
</dependency>
<!-- Integration Testing with Pax Exam -->
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-container-forked</artifactId>
<version>4.13.1</version>
<version>4.13.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-junit4</artifactId>
<version>4.13.1</version>
<version>4.13.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-link-mvn</artifactId>
<version>4.13.1</version>
<version>4.13.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.url</groupId>
<artifactId>pax-url-aether</artifactId>
<version>2.6.2</version>
<version>2.6.14</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.url</groupId>
<artifactId>pax-url-wrap</artifactId>
<version>2.6.2</version>
<version>2.6.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -139,7 +139,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>6.0.3</version>
<version>7.0.5</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -153,7 +153,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>4.2.1</version>
<version>6.0.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
Expand All @@ -180,10 +180,10 @@
-->
org.osgi.service.metatype;version="[1.1,2)";resolution:=optional,

<!--
Optional import to back the dynamic import on org.osgi.service.log
-->
org.osgi.service.log;version="[1.3,2)";resolution:=optional,
<!--
Optional import to back the dynamic import on org.osgi.service.log
-->
org.osgi.service.log;version="[1.3,2)";resolution:=optional,

<!-- default -->
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
import java.util.Hashtable;
import java.util.StringTokenizer;

import org.apache.felix.eventadmin.impl.adapter.AbstractAdapter;
import org.apache.felix.eventadmin.impl.adapter.BundleEventAdapter;
import org.apache.felix.eventadmin.impl.adapter.FrameworkEventAdapter;
import org.apache.felix.eventadmin.impl.adapter.LogEventAdapter;
import org.apache.felix.eventadmin.impl.adapter.ServiceEventAdapter;
import org.apache.felix.eventadmin.impl.handler.EventAdminImpl;
import org.apache.felix.eventadmin.impl.security.SecureEventAdminFactory;
import org.apache.felix.eventadmin.impl.tasks.DefaultThreadPool;
Expand Down Expand Up @@ -172,9 +167,6 @@ public class Configuration
// The registration of the mbean
private volatile ServiceRegistration<Object> m_mbeanreg;

// all adapters
private AbstractAdapter[] m_adapters;

private ServiceRegistration<?> m_managedServiceReg;

// the access control context
Expand Down Expand Up @@ -431,9 +423,6 @@ private void startOrUpdate()
m_requireTopic,
m_ignoreTopics);

// Finally, adapt the outside events to our kind of events as per spec
adaptEvents(m_admin);

// register the admin wrapped in a service factory (SecureEventAdminFactory)
// that hands-out the m_admin object wrapped in a decorator that checks
// appropriated permissions of each calling bundle
Expand Down Expand Up @@ -463,14 +452,6 @@ public void destroy()
{
synchronized ( this )
{
if ( m_adapters != null )
{
for(int i=0;i<m_adapters.length;i++)
{
m_adapters[i].destroy(m_bundleContext);
}
m_adapters = null;
}
if ( m_managedServiceReg != null )
{
m_managedServiceReg.unregister();
Expand Down Expand Up @@ -504,18 +485,6 @@ public void destroy()
}
}

/**
* Init the adapters in org.apache.felix.eventadmin.impl.adapter
*/
private void adaptEvents(final EventAdmin admin)
{
m_adapters = new AbstractAdapter[4];
m_adapters[0] = new FrameworkEventAdapter(m_bundleContext, admin);
m_adapters[1] = new BundleEventAdapter(m_bundleContext, admin);
m_adapters[2] = new ServiceEventAdapter(m_bundleContext, admin);
m_adapters[3] = new LogEventAdapter(m_bundleContext, admin);
}

private Object tryToCreateMetaTypeProvider(final Object managedService)
{
try
Expand Down Expand Up @@ -565,7 +534,7 @@ private int getIntProperty(final String key, final Object value,
final int result;
if ( value instanceof Integer )
{
result = ((Integer)value).intValue();
result = (Integer) value;
}
else
{
Expand Down Expand Up @@ -606,7 +575,7 @@ private double getDoubleProperty(final String key, final Object value,
final double result;
if ( value instanceof Double )
{
result = ((Double)value).doubleValue();
result = (Double) value;
}
else
{
Expand Down Expand Up @@ -645,17 +614,17 @@ private boolean getBooleanProperty(final Object obj,
{
if ( obj instanceof Boolean )
{
return ((Boolean)obj).booleanValue();
return (Boolean) obj;
}
String value = obj.toString().trim().toLowerCase();

if(0 < value.length() && ("0".equals(value) || "false".equals(value)
if(!value.isEmpty() && ("0".equals(value) || "false".equals(value)
|| "no".equals(value)))
{
return false;
}

if(0 < value.length() && ("1".equals(value) || "true".equals(value)
if(!value.isEmpty() && ("1".equals(value) || "true".equals(value)
|| "yes".equals(value)))
{
return true;
Expand Down

This file was deleted.

Loading
Loading