Package org.osgi.framework

Examples of org.osgi.framework.ServiceEvent


    try {
      ServiceReference [] srl = bc.getServiceReferences(null, filter);
      for(int i = 0; srl != null && i < srl.length; i++) {

        serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED, srl[i]));
      }
      bc.addServiceListener(this, filter);
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here


  public void close() {
    bc.removeServiceListener(this);

    for(Enumeration e = logReaders.keys(); e.hasMoreElements(); ) {
      ServiceReference sr = (ServiceReference)e.nextElement();
      serviceChanged(new ServiceEvent(ServiceEvent.UNREGISTERING, sr));
    }
    logReaders.clear();
  }
View Full Code Here

   * Get all registered SOAP services and deploy them in axis servlets
   */
  void handleRegisteredSOAPServices() throws Exception {
    ServiceReference[] srl = bc.getServiceReferences(null, null);
    for(int i = 0; srl != null && i < srl.length; i++) {
      soapServiceListener.serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED, srl[i]));
    }
  }
View Full Code Here

   
    Activator.bc.addServiceListener(httpServiceListener, filter);
   
    ServiceReference[] srl = Activator.bc.getServiceReferences(null, filter);
    for(int i = 0; srl != null && i < srl.length; i++) {
        httpServiceListener.serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED,
                                                            srl[i]));
    }
  }
View Full Code Here

        bc.addServiceListener(this, filter);
        ServiceReference[] sra = bc.getServiceReferences(null, filter);
        if (sra != null) {
            for (int i = 0; i < sra.length; i++) {
                try {
                    serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED,
                            sra[i]));
                } catch (Exception e) {
                }
            }
        }
View Full Code Here

  void getAllServices() {
    try {
      ServiceReference[] srl = Activator.getTargetBC_getServiceReferences();
      for(int i = 0; srl != null && i < srl.length; i++) {
        serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED, srl[i]));
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    bc.addServiceListener(listener, filter);
   
    ServiceReference references[] = bc.getServiceReferences(null, filter);
    for (int i = 0; references != null && i < references.length; i++)
      {
        listener.serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED,
                                                 references[i]));
      }
  }
View Full Code Here

    Activator.getTargetBC().addBundleListener(this);

    try {
      ServiceReference [] srl = Activator.getTargetBC_getServiceReferences();
      for(int i = 0; srl != null && i < srl.length; i++) {
        serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED, srl[i]));
      }
      Activator.getTargetBC().addServiceListener(this, null);
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

    public void removeServiceListener(final ServiceListener serviceListener) {
        serviceListeners.remove(serviceListener);
    }

    private void notifyServiceListeners(int eventType, ServiceReference serviceReference) {
        final ServiceEvent event = new ServiceEvent(eventType, serviceReference);
        for (ServiceListener serviceListener : serviceListeners) {
            serviceListener.serviceChanged(event);
        }
    }
View Full Code Here

        // Notify callback objects about unregistering service.
        if (m_callbacks != null)
        {
            m_callbacks.serviceChanged(
                new ServiceEvent(ServiceEvent.UNREGISTERING, reg.getReference()), null);
        }

        // Now forcibly unget the service object for all stubborn clients.
        ServiceReference<?> ref = reg.getReference();
        Bundle[] clients = getUsingBundles(ref);
View Full Code Here

TOP

Related Classes of org.osgi.framework.ServiceEvent

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.