felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Wilson <am...@health.state.ny.us>
Subject EventAdmin Blacklist
Date Fri, 18 Oct 2013 16:30:19 GMT

Hi all,

We're experiencing a blacklist of a crucial service on a remote system and
have not been able to replicate it locally.

Once a service has been blacklisted, what can we do about it?  From the
EventAdmin code, it emits a log message and releases the service. There
doesn't appear to be any way to detect the blacklisting and mitigate it.
Ideally, it seems like a BLACKLIST event should be emitted so that you can
set up handlers to manage these situations---but, obviously, that could get

We're also having a hard time creating a circumstance that creates a
blacklisted service to inspect what happens.  Is there an easier way to
simulate blacklisting?

Below is the code that I tried to get something blacklisted, but it did not


package osgi.event;

import aQute.bnd.annotation.component.Activate;
import aQute.bnd.annotation.component.Component;
import aQute.bnd.annotation.component.Deactivate;
import aQute.bnd.annotation.component.Reference;

import org.osgi.framework.BundleContext;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventAdmin;
import org.osgi.service.event.EventConstants;
import org.osgi.service.event.EventHandler;

import java.util.HashMap;

@Component(immediate=true, name="tester",
public class Tester implements EventHandler {
    public static EventAdmin event;
    public void setEvent(EventAdmin e) { event = e; }

    public void start(BundleContext ctx) throws Exception {
        event.postEvent(new Event("testingevent",new HashMap<Object,Object>

    public void handleEvent(final Event event) {
        System.out.println("Event received, sleeping.");

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message