Package org.openhab.io.rest.internal.broadcaster

Examples of org.openhab.io.rest.internal.broadcaster.GeneralBroadcaster


            Executors.newSingleThreadExecutor().submit(new Runnable() {
                    public void run() {
                        try {
                            Thread.sleep(300);
                         
                          GeneralBroadcaster delayedBroadcaster = (GeneralBroadcaster) BroadcasterFactory.getDefault().lookup(GeneralBroadcaster.class, delayedBroadcasterName);
                          delayedBroadcaster.broadcast(message, resource);
                         
                 
                } catch (Exception e) {
                  logger.error(e.getMessage());
                }
View Full Code Here


        final String delayedBroadcasterName = resource.getRequest().getPathInfo();
        Executors.newSingleThreadExecutor().submit(new Runnable() {
                public void run() {
                    try {
                        Thread.sleep(300);
              GeneralBroadcaster delayedBroadcaster = (GeneralBroadcaster) BroadcasterFactory.getDefault().lookup(GeneralBroadcaster.class, delayedBroadcasterName);
              if(delayedBroadcaster != null)
                delayedBroadcaster.broadcast(message, resource);
            } catch (Exception e) {
              logger.error("Could not broadcast message",e);
            }
                }
            });
View Full Code Here

        } else {
          logger.info("Received HTTP GET request at '{}' for the unknown item '{}'.", uriInfo.getPath(), itemname);
          throw new WebApplicationException(404);
        }
    }
      GeneralBroadcaster itemBroadcaster = (GeneralBroadcaster) BroadcasterFactory.getDefault().lookup(GeneralBroadcaster.class, resource.getRequest().getPathInfo(), true);
    itemBroadcaster.addStateChangeListener(new ItemStateChangeListener());
    return new SuspendResponse.SuspendResponseBuilder<String>()
        .scope(SCOPE.REQUEST)
        .resumeOnBroadcast(!ResponseTypeHelper.isStreamingTransport(resource.getRequest()))
        .broadcaster(itemBroadcaster)
        .outputComments(true).build();
View Full Code Here

      } else {
        throw new WebApplicationException(Response.notAcceptable(null).build());
      }
    }
   
    GeneralBroadcaster itemBroadcaster = (GeneralBroadcaster) BroadcasterFactory.getDefault().lookup(GeneralBroadcaster.class, resource.getRequest().getPathInfo(), true);
    itemBroadcaster.addStateChangeListener(new ItemStateChangeListener());
   
    return new SuspendResponse.SuspendResponseBuilder<Response>()
          .scope(SCOPE.REQUEST)
          .resumeOnBroadcast(!ResponseTypeHelper.isStreamingTransport(resource.getRequest()))
          .broadcaster(itemBroadcaster)
View Full Code Here

      } else {
        throw new WebApplicationException(Response.notAcceptable(null).build());
      }
    }
   
    GeneralBroadcaster sitemapBroadcaster = BroadcasterFactory.getDefault().lookup(GeneralBroadcaster.class, resource.getRequest().getPathInfo(), true);
    sitemapBroadcaster.addStateChangeListener(new SitemapStateChangeListener());
   
    boolean resume = false;
    try {
    AtmosphereRequest request = resource.getRequest();
    resume = !ResponseTypeHelper.isStreamingTransport(request);
View Full Code Here

TOP

Related Classes of org.openhab.io.rest.internal.broadcaster.GeneralBroadcaster

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.