Package org.osgi.framework

Examples of org.osgi.framework.ServiceReference


   *               specifies the http server to remove the soap service from
   */
  void undeploySOAPServices(ServiceReference httpSR) {
    synchronized(soapServices) {
      for(Iterator it = soapServices.keySet().iterator(); it.hasNext();) {
        ServiceReference sr = (ServiceReference)it.next();
        SOAPService  soapService = (SOAPService)soapServices.get(sr);
        undeploySOAPService(soapService, httpSR);
      }
      soapServices.clear();
    }
View Full Code Here


    log.debug("undeploySOAPService " + soapService);
   
    synchronized(servletRegistrations) {
      for(Iterator it = servletRegistrations.keySet().iterator(); it.hasNext(); ) {
        try {
          ServiceReference sr      = (ServiceReference)it.next();
          if(httpSR == null || httpSR.equals(sr)) {
            Object[]         v       = (Object[])servletRegistrations.get(sr);
            Axis2Servlet     servlet = (Axis2Servlet)v[1];

            AxisConfiguration axisConfig = servlet.getAxisConfigurator().getAxisConfiguration();
View Full Code Here

    int count = 0;
    synchronized(servletRegistrations) {
     
      for(Iterator it = servletRegistrations.keySet().iterator(); it.hasNext(); ) {
        try {
          ServiceReference sr      = (ServiceReference)it.next();
          Object[]         v       = (Object[])servletRegistrations.get(sr);
          Axis2Servlet     servlet = (Axis2Servlet)v[1];
         
          AxisConfiguration axisConfig = servlet.getAxisConfigurator().getAxisConfiguration();
                   
View Full Code Here

      }
    }

    synchronized(soapServices) {
      for(Iterator it = soapServices.keySet().iterator(); it.hasNext();) {
        ServiceReference sr          = (ServiceReference)it.next();
        SOAPService      soapService = (SOAPService)soapServices.get(sr);
        String           name        = (String)sr.getProperty(Axis2Admin.SOAP_SERVICE_NAME);
        if(soapService.getDeployCount() > 0 && name.equals(serviceName)) {
          throw new IllegalArgumentException("Service '" + name + "' is already deployed");
        }
      }
    }
View Full Code Here

            }
        }
    }

    public void serviceChanged(ServiceEvent e) {
        ServiceReference sr = e.getServiceReference();
        if (isDevice.match(sr)) {
            switch (e.getType()) {
            case ServiceEvent.REGISTERED:
                info("device found, " + showDevice(sr));
                touchDevice(sr);
View Full Code Here

    public void run() {
        while (!quit) {
            boolean sleep = true;
            try {
                ServiceReference dev = (ServiceReference) newDevices.keys()
                        .nextElement();
                newDevices.remove(dev);
                sleep = false;
                handleDevice(dev);
            } catch (Exception e) {
View Full Code Here

        try {
            ServiceReference[] sra = bc.getServiceReferences(null,
                    DEVICE_FILTER);
            if (sra != null) {
                for (int i = 0; i < sra.length; i++) {
                    ServiceReference dev = sra[i];
                    if (newDevices.put(dev, dev) == null)
                        added = true;
                }
            }
        } catch (Exception e) {
View Full Code Here

     *
     * @param level Log level
     * @param msg Log message
     */
    void log(int level, String msg) {
        ServiceReference srLog = bc.getServiceReference(logServiceName);
        if (srLog != null) {
            LogService sLog = (LogService) bc.getService(srLog);
            if (sLog != null) {
                sLog.log(level, msg);
            }
View Full Code Here

        }
    }

    static ServiceReference matchCommandGroup(BundleContext bc, String word)
            throws IOException {
        ServiceReference res = null;
        ServiceReference[] refs = null;
        try {
            refs = bc.getServiceReferences(COMMAND_GROUP, "(groupName=" + word
                    + "*)");
        } catch (InvalidSyntaxException ignore) {
View Full Code Here

     *            log message
     * @param t
     *            throwable
     */
    void log(int level, String msg, Throwable t) {
        ServiceReference srLog = bc
                .getServiceReference("org.osgi.service.log.LogService");
        if (srLog != null) {
            LogService sLog = (LogService) bc.getService(srLog);
            if (sLog != null) {
                sLog.log(level, msg, t);
View Full Code Here

TOP

Related Classes of org.osgi.framework.ServiceReference

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.