Package org.osgi.framework

Examples of org.osgi.framework.FrameworkEvent


            while (timeout > 0) {
                timeout -= step;
                if (shutdownCallback != null) {
                    shutdownCallback.waitingForShutdown(step * 2);
                }
                FrameworkEvent event = framework.waitForStop(step);
                if (event.getType() != FrameworkEvent.WAIT_TIMEDOUT) {
                    return true;
                }
            }
            return false;
        } finally {
View Full Code Here


        int startLevel = ((FrameworkStartLevel) this.bundleContext.getBundle(0).adapt(FrameworkStartLevel.class)).getStartLevel();
        if (startLevel >= defaultStartLevel) {
            started.set(true);
        } else {
            bundleContext.addFrameworkListener(this);
            frameworkEvent(new FrameworkEvent(FrameworkEvent.STARTLEVEL_CHANGED, bundleContext.getBundle(), null));
        }
    }
View Full Code Here

            return;
        }
        try {
            if (await) {
                while (true) {
                    FrameworkEvent event = framework.waitForStop(0);
                    if (event.getType() != FrameworkEvent.STOPPED_UPDATE) {
                        break;
                    }
                }
            }
            exiting = true;
View Full Code Here

    public void awaitShutdown() throws Exception {
        if (framework == null) {
            return;
        }
        while (true) {
            FrameworkEvent event = framework.waitForStop(0);
            if (event.getType() != FrameworkEvent.STOPPED_UPDATE) {
                return;
            }
        }
    }
View Full Code Here

            while (timeout > 0) {
                timeout -= step;
                if (shutdownCallback != null) {
                    shutdownCallback.waitingForShutdown(step * 2);
                }
                FrameworkEvent event = framework.waitForStop(step);
                if (event.getType() != FrameworkEvent.WAIT_TIMEDOUT) {
                    stopKarafActivators();
                    return true;
                }
            }
            return false;
View Full Code Here

    }

    @SuppressWarnings("deprecation")
    @Test
    public void testWriteEvent() throws Exception {
        FrameworkEvent event = new FrameworkEvent(32, new Object());
        m_eventLogger.frameworkEvent(event);

        FeedbackHandler feedbackHandler = m_agentContext.getHandler(FeedbackHandler.class);
        TestFeedbackChannel channel = (TestFeedbackChannel) feedbackHandler.getChannel("auditlog");
        assertEquals(channel.getLastTtype(), 1001);
View Full Code Here

    @Test
    public void testExcludeEvent() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);
        configureAgent(configurationHandler, AgentConstants.CONFIG_LOGGING_EXCLUDE_EVENTS, "1001,1002");

        FrameworkEvent event = new FrameworkEvent(32, new Object());

        FeedbackHandler feedbackHandler = m_agentContext.getHandler(FeedbackHandler.class);
        TestFeedbackChannel channel = (TestFeedbackChannel) feedbackHandler.getChannel("auditlog");
        // make sure the configuration is written to the channel
        assertEquals(channel.getLastTtype(), 2000);
View Full Code Here

                return bundleLocation;
            }
        });

        BundleEvent bundleEvent = new BundleEvent(BundleEvent.INSTALLED, testBundleA);
        FrameworkEvent frameworkEvent = new FrameworkEvent(FrameworkEvent.INFO, testBundleA, new IllegalStateException());

        listeners.bundleChanged(bundleEvent);
        listeners.frameworkEvent(frameworkEvent);
        listeners.stopInternal();
View Full Code Here

    private void waitForFramework(long timeout) throws InterruptedException {
        if (framework == null) {
            return;
        }
        while (true) {
            FrameworkEvent event = framework.waitForStop(timeout);
            if (event.getType() != FrameworkEvent.STOPPED_UPDATE) {
                break;
            }
        }
    }
View Full Code Here

                        {
                            dispatcher.m_logger.log(bundle,
                                Logger.LOG_ERROR,
                                "EventDispatcher: Error during dispatch.", th);
                            dispatcher.fireFrameworkEvent(
                                new FrameworkEvent(FrameworkEvent.ERROR, bundle, th));
                        }
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.osgi.framework.FrameworkEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.