Java 类org.apache.http.conn.ConnectionReleaseTrigger 实例源码

项目:purecloud-iot    文件:AbstractExecutionAwareRequest.java   
@Override
@Deprecated
public void setReleaseTrigger(final ConnectionReleaseTrigger releaseTrigger) {
    setCancellable(new Cancellable() {

        @Override
        public boolean cancel() {
            try {
                releaseTrigger.abortConnection();
                return true;
            } catch (final IOException ex) {
                return false;
            }
        }

    });
}
项目:lams    文件:HttpRequestBase.java   
public void setReleaseTrigger(final ConnectionReleaseTrigger releaseTrigger)
        throws IOException {
    if (this.aborted) {
        throw new IOException("Request already aborted");
    }
    this.abortLock.lock();
    try {
        this.releaseTrigger = releaseTrigger;
    } finally {
        this.abortLock.unlock();
    }
}
项目:remote-files-sync    文件:AbstractExecutionAwareRequest.java   
@Deprecated
public void setReleaseTrigger(final ConnectionReleaseTrigger releaseTrigger) {
    setCancellable(new Cancellable() {

        public boolean cancel() {
            try {
                releaseTrigger.abortConnection();
                return true;
            } catch (final IOException ex) {
                return false;
            }
        }

    });
}
项目:FMTech    文件:jsi.java   
public static void a(InputStream paramInputStream)
{
  if ((paramInputStream instanceof ConnectionReleaseTrigger)) {}
  try
  {
    ((ConnectionReleaseTrigger)paramInputStream).abortConnection();
    return;
  }
  catch (Throwable localThrowable) {}
}
项目:riptide    文件:RestAsyncClientHttpResponse.java   
@Override
public InputStream getBody() throws IOException {
    final InputStream body = response.getBody();
    return new FilterInputStream(body) {
        @Override
        public void close() throws IOException {
            if (body instanceof ConnectionReleaseTrigger) {
                // effectively releasing the connection back to the pool in order to prevent starvation
                ConnectionReleaseTrigger.class.cast(body).abortConnection();
            }
            super.close();
        }
    };
}
项目:Visit    文件:AbstractExecutionAwareRequest.java   
@Deprecated
public void setReleaseTrigger(final ConnectionReleaseTrigger releaseTrigger) {
    setCancellable(new Cancellable() {

        public boolean cancel() {
            try {
                releaseTrigger.abortConnection();
                return true;
            } catch (final IOException ex) {
                return false;
            }
        }

    });
}
项目:cJUnit-mc626    文件:HttpRequestBase.java   
public void setReleaseTrigger(final ConnectionReleaseTrigger releaseTrigger)
        throws IOException {
    this.abortLock.lock();
    try {
        if (this.aborted) {
            throw new IOException("Request already aborted");
        }

        this.connRequest = null;
        this.releaseTrigger = releaseTrigger;
    } finally {
        this.abortLock.unlock();
    }
}
项目:cJUnit-mc626    文件:HttpRequestBase.java   
public void abort() {
    ClientConnectionRequest localRequest;
    ConnectionReleaseTrigger localTrigger;

    this.abortLock.lock();
    try {
        if (this.aborted) {
            return;
        }            
        this.aborted = true;

        localRequest = connRequest;
        localTrigger = releaseTrigger;
    } finally {
        this.abortLock.unlock();
    }        

    // Trigger the callbacks outside of the lock, to prevent
    // deadlocks in the scenario where the callbacks have
    // their own locks that may be used while calling
    // setReleaseTrigger or setConnectionRequest.
    if (localRequest != null) {
        localRequest.abortRequest();
    }
    if (localTrigger != null) {
        try {
            localTrigger.abortConnection();
        } catch (IOException ex) {
            // ignore
        }
    }
}
项目:ZTLib    文件:AbstractExecutionAwareRequest.java   
@Deprecated
public void setReleaseTrigger(final ConnectionReleaseTrigger releaseTrigger) {
    setCancellable(new Cancellable() {

        public boolean cancel() {
            try {
                releaseTrigger.abortConnection();
                return true;
            } catch (final IOException ex) {
                return false;
            }
        }

    });
}
项目:lams    文件:AbortableHttpRequest.java   
/**
 * Sets the {@link ConnectionReleaseTrigger} callback that can
 * be used to abort an active connection.
 * Typically, this will be the {@link ManagedClientConnection} itself.
 * If the request is already aborted, throws an {@link IOException}.
 */
void setReleaseTrigger(ConnectionReleaseTrigger releaseTrigger) throws IOException;
项目:purecloud-iot    文件:AbortableHttpRequest.java   
/**
 * Sets the {@link ConnectionReleaseTrigger} callback that can
 * be used to abort an active connection.
 * Typically, this will be the
 *   {@link org.apache.http.conn.ManagedClientConnection} itself.
 * If the request is already aborted, throws an {@link IOException}.
 */
void setReleaseTrigger(ConnectionReleaseTrigger releaseTrigger) throws IOException;
项目:cJUnit-mc626    文件:AbortableHttpRequest.java   
/**
 * Sets the {@link ConnectionReleaseTrigger} callback that can
 * be used to abort an active connection.
 * Typically, this will be the {@link ManagedClientConnection} itself.
 * If the request is already aborted, throws an {@link IOException}.
 */
void setReleaseTrigger(ConnectionReleaseTrigger releaseTrigger) throws IOException;