Package org.apache.felix.upnp.basedriver.importer.core.event.message

Examples of org.apache.felix.upnp.basedriver.importer.core.event.message.ListenerModified


                }
              }//for services
            }//services ==null
            context.ungetService(devicesRefs[i]);
          }//for devicesRefs
          ListenerModified msg = new ListenerModified(newServices,
              listener);
          subQueue.enqueue(msg);
        }//devicesrefs !=null
      } else {//interrested in all devices
        try {

          String newfilter = "(!(" + UPnPDevice.UPNP_EXPORT + "=*"
              + ")" + ")";
          devicesRefs = context.getServiceReferences(UPnPDevice.class
              .getName(), newfilter);
        } catch (InvalidSyntaxException e) {
          e.printStackTrace();
        }
        if (devicesRefs != null) {/*
                       * only if there is a device
                       */

          for (int i = 0; i < devicesRefs.length; i++) {
            UPnPDevice device = (UPnPDevice) context
                .getService(devicesRefs[i]);
            UPnPService[] services = device.getServices();
            if (services != null) {
              for (int j = 0; j < services.length; j++) {
                UPnPStateVariable[] stateVars = services[j]
                    .getStateVariables();
                boolean hasEventedVars = false;
                for (int k = 0; k < stateVars.length; k++) {
                  hasEventedVars = stateVars[k].sendsEvents();
                  if (hasEventedVars) {
                    break;
                  }
                }
                if (hasEventedVars) {
                  newServices
                      .add(((UPnPServiceImpl) services[j])
                          .getCyberService());
                }//hasEventedvars
              }//for services
            }//services !=null
                        context.ungetService(devicesRefs[i]);
          }//for devicesRefs
          subQueue
              .enqueue(new ListenerModified(newServices, listener));
        }//devicesRefs !=null

      }

    } else if (event.getType() == ServiceEvent.UNREGISTERING) {
View Full Code Here


                }
              }//for services
            }//services ==null
            context.ungetService(devicesRefs[i]);
          }//for devicesRefs
          ListenerModified msg = new ListenerModified(newServices,
              listener);
          subQueue.enqueue(msg);
        }//devicesrefs !=null
      } else {//interrested in all devices
        try {

          String newfilter = "(!(" + UPnPDevice.UPNP_EXPORT + "=*"
              + ")" + ")";
          devicesRefs = context.getServiceReferences(UPnPDevice.class
              .getName(), newfilter);
        } catch (InvalidSyntaxException e) {
          e.printStackTrace();
        }
        if (devicesRefs != null) {/*
                       * only if there is a device
                       */

          for (int i = 0; i < devicesRefs.length; i++) {
            UPnPDevice device = (UPnPDevice) context
                .getService(devicesRefs[i]);
            UPnPService[] services = device.getServices();
            if (services != null) {
              for (int j = 0; j < services.length; j++) {
                UPnPStateVariable[] stateVars = services[j]
                    .getStateVariables();
                boolean hasEventedVars = false;
                for (int k = 0; k < stateVars.length; k++) {
                  hasEventedVars = stateVars[k].sendsEvents();
                  if (hasEventedVars) {
                    break;
                  }
                }
                if (hasEventedVars) {
                  newServices
                      .add(((UPnPServiceImpl) services[j])
                          .getCyberService());
                }//hasEventedvars
              }//for services
            }//services !=null
                        context.ungetService(devicesRefs[i]);
          }//for devicesRefs
          subQueue
              .enqueue(new ListenerModified(newServices, listener));
        }//devicesRefs !=null

      }

    } else if (event.getType() == ServiceEvent.UNREGISTERING) {
View Full Code Here

TOP

Related Classes of org.apache.felix.upnp.basedriver.importer.core.event.message.ListenerModified

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.