Package org.osgi.service.wireadmin

Examples of org.osgi.service.wireadmin.WireAdminEvent


     * @param wire
     * @param exception
     */
    void fireEvent(int eventType,WireImpl wire, Throwable exception)
    {
        WireAdminEvent evt = new WireAdminEvent(m_ref,eventType,wire,exception);
        m_eventDispatcher.queueEvent(evt);
    }
View Full Code Here


        public void run()
        {
            while (m_stop == false || (m_stop == true && m_empty == false))
            {
                WireAdminEvent nextEvent = null;

                synchronized (m_eventStack)
                {
                    while (m_eventStack.size() == 0)
                    {
                        try
                        {
                            m_eventStack.wait();
                        }
                        catch (InterruptedException ex)
                        {
                            // Ignore.
                        }
                    }
                    nextEvent = (WireAdminEvent) m_eventStack.remove(0);
                   
                    if(m_eventStack.size()==0)
                    {
                        // This allows the queue to be flushed upon termination
                        m_empty = true;
                    }
                }
               
                synchronized (m_wireAdminListeners)
                {
                    Iterator listenerIt = m_wireAdminListeners.keySet().iterator();
                    while(listenerIt.hasNext())
                    {
                        ServiceReference listenerRef = (ServiceReference)listenerIt.next();
                        WireAdminListener listener = (WireAdminListener)m_wireAdminListeners.get(listenerRef);
                       
                        try
                        {
                            Integer evtsInteger = (Integer) listenerRef.getProperty(WireConstants.WIREADMIN_EVENTS);
                            if(evtsInteger != null)
                            {
                                int events = evtsInteger.intValue();
                                if((nextEvent.getType()&events)!=0)
                                {
                                    listener.wireAdminEvent(nextEvent);
                                }                           
                            }
                            else
View Full Code Here

TOP

Related Classes of org.osgi.service.wireadmin.WireAdminEvent

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.