Examples of reset()


Examples of org.apache.helix.api.TransitionHandler.reset()

    for (Map<String, StateTransitionHandlerFactory<? extends TransitionHandler>> ftyMap : _stateModelFactoryMap
        .values()) {
      for (StateTransitionHandlerFactory<? extends TransitionHandler> stateModelFactory : ftyMap.values()) {
        for (PartitionId partition : stateModelFactory.getPartitionSet()) {
          TransitionHandler stateModel = stateModelFactory.getTransitionHandler(partition);
          stateModel.reset();
          String initialState = _stateModelParser.getInitialState(stateModel.getClass());
          stateModel.updateState(initialState);
          // TODO probably should update the state on ZK. Shi confirm what needs
          // to be done here.
        }
View Full Code Here

Examples of org.apache.helix.manager.MockListener.reset()

    AssertJUnit.assertTrue(controller.isConnected());
    controller.connect();
    AssertJUnit.assertTrue(controller.isConnected());

    MockListener listener = new MockListener();
    listener.reset();

    try
    {
      controller.addControllerListener(null);
      Assert.fail("Should throw HelixException");
View Full Code Here

Examples of org.apache.helix.participant.statemachine.StateModel.reset()

        }

        for (String resourceKey : modelMap.keySet())
        {
          StateModel stateModel = modelMap.get(resourceKey);
          stateModel.reset();
          String initialState = _stateModelParser.getInitialState(stateModel.getClass());
          stateModel.updateState(initialState);
          // TODO probably should update the state on ZK. Shi confirm what needs
          // to be done here.
        }
View Full Code Here

Examples of org.apache.http.WritableByteChannelMock.reset()

        Assert.assertEquals(0, encoder.write(src));
        Assert.assertEquals(0, encoder.write(src));
        Assert.assertEquals(0, encoder.write(src));

        // should not be able to copy any bytes, until we flush the channel and buffer
        channel.reset();
        outbuf.flush(channel);
        channel.reset();

        Assert.assertEquals(10, encoder.write(src));
        channel.flush();
View Full Code Here

Examples of org.apache.http.auth.AuthState.reset()

                    && proxyAuthState.getAuthScheme() != null
                    && proxyAuthState.getAuthScheme().isConnectionBased()) {
                if (this.log.isDebugEnabled()) {
                    this.log.debug("[exchange: " + state.getId() + "] Resetting proxy auth state");
                }
                proxyAuthState.reset();
            }
            final AuthState targetAuthState = localContext.getTargetAuthState();
            if (targetAuthState.getState() == AuthProtocolState.SUCCESS
                    && targetAuthState.getAuthScheme() != null
                    && targetAuthState.getAuthScheme().isConnectionBased()) {
View Full Code Here

Examples of org.apache.http.client.methods.HttpGet.reset()

            }
            catch (Exception e) {
                message = DataSourceRT.getExceptionMessage(e);
            }
            finally {
                request.reset();
            }

            if (retries <= 0)
                throw new TranslatableException(message);
            retries--;
View Full Code Here

Examples of org.apache.http.client.methods.HttpHead.reset()

        HttpContext cookieContext = new BasicHttpContext();
        cookieContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
        HttpHead cookieRequest = new HttpHead(
            settings.getSessionCookieUri());
        client.execute(cookieRequest, cookieContext);
        cookieRequest.reset();
      } catch (ClientProtocolException e) {
        throw new FailedFetchingCookieException(
            "Failed to fetch cookie at URI '" +
                settings.getSessionCookieUri() + "'", e);
      } catch (IOException e) {
View Full Code Here

Examples of org.apache.http.client.methods.HttpPost.reset()

           
            HttpResponse response = this.httpClient.execute(post);
           
            //Expect a 4xx response
            int status = response.getStatusLine().getStatusCode();
            post.reset();
            if (status >= 400 && status < 500) {
                //OK
                LOGGER.info("Request failed as expected with HTTP Code " + status);
            } else {
                throw new ValidationError("Query Request with wrong media type did not fail with 4xx status code as expected, got HTTP status code " + status);
View Full Code Here

Examples of org.apache.http.client.methods.HttpPut.reset()

           
            HttpResponse response = this.httpClient.execute(put);
           
            //Expect a 4xx response
            int status = response.getStatusLine().getStatusCode();
            put.reset();
            if (status >= 400 && status < 500) {
                //OK
                LOGGER.info("Request failed as expected with HTTP Code " + status);
            } else {
                throw new ValidationError("Query Request with bad HTTP Method (PUT) did not fail with 4xx status code as expected, got HTTP status code " + status);
View Full Code Here

Examples of org.apache.http.client.methods.HttpRequestBase.reset()

            final Request request) throws ClientProtocolException, IOException {
        this.localContext.setAttribute(ClientContext.CREDS_PROVIDER, this.credentialsProvider);
        this.localContext.setAttribute(ClientContext.AUTH_CACHE, this.authCache);
        this.localContext.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
        HttpRequestBase httprequest = request.getHttpRequest();
        httprequest.reset();
        return new Response(this.httpclient.execute(httprequest, this.localContext));
    }

    public static void registerScheme(final Scheme scheme) {
        CONNMGR.getSchemeRegistry().register(scheme);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.