@Override public void run() { while (!this.isInterrupted()) { // Exit when thread's interrupt flag is set HttpConnection con = new HttpConnection(params, "http://surfkid.redio.de/getChannelState", this.ins); con.start(); try { Log.e("Sleep", "Begin"); UpdateState.this.sleep(5000); Log.e("Sleep", "End"); } catch (InterruptedException e) { Log.e("Sleep", "Error"); e.printStackTrace(); // Restore interrupt flag after catching InterruptedException // to make loop condition false Thread.currentThread().interrupt(); } } }
/** * <p class="changed_added_2_0"></p> * @param url * @throws MalformedURLException * @throws FacesException */ protected void setupFacesRequest(String url) throws MalformedURLException, FacesException { connection = facesServer.getConnection(new URL( url)); setupConnection(); connection.start(); FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); facesContext = facesContextFactory.getFacesContext(facesServer .getContext(), connection.getRequest(), connection .getResponse(), lifecycle); }
/** * <p class="changed_added_2_0"></p> * @param url * @throws MalformedURLException * @throws FacesException */ protected void setupFacesRequest(String url) throws MalformedURLException, FacesException { connection = facesServer.getConnection(new URL( url)); setupConnection(); connection.start(); FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); facesContext = facesContextFactory.getFacesContext(facesServer .getContext(), connection.getRequest(), connection .getResponse(), lifecycle); }
public FacesRequest start() { if (connection.isStarted() || connection.isFinished()) { throw new IllegalStateException(); } connection.start(); FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); facesContext = facesContextFactory.getFacesContext(facesServer.getContext(), connection.getRequest(), connection.getResponse(), lifecycle); if (null != viewId) { facesContext.setViewRoot(application.getViewHandler().createView(facesContext, viewId)); } return this; }
public FacesRequest start() { if (connection.isStarted() || connection.isFinished()) { throw new IllegalStateException(); } connection.start(); FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); facesContext = facesContextFactory.getFacesContext(facesServer.getContext(), connection.getRequest(), connection.getResponse(), lifecycle); if (null != viewId) { facesContext.setViewRoot(application.getViewHandler().createView(facesContext, viewId)); } return this; }