當前位置: 首頁>>代碼示例>>Java>>正文


Java Unirest.shutdown方法代碼示例

本文整理匯總了Java中com.mashape.unirest.http.Unirest.shutdown方法的典型用法代碼示例。如果您正苦於以下問題:Java Unirest.shutdown方法的具體用法?Java Unirest.shutdown怎麽用?Java Unirest.shutdown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.mashape.unirest.http.Unirest的用法示例。


在下文中一共展示了Unirest.shutdown方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shutdown

import com.mashape.unirest.http.Unirest; //導入方法依賴的package包/類
/**
 * Shutdown all the threads
 */
public static void shutdown() 
{
    if(null != scheduler) 
    {
        scheduler.shutdown();
    }
    
    try 
    {
        Unirest.shutdown();
    } 
    catch (IOException e) 
    {
        //do nothing
    }
}
 
開發者ID:messagemedia,項目名稱:messages-java-sdk,代碼行數:20,代碼來源:APIHelper.java

示例2: stop

import com.mashape.unirest.http.Unirest; //導入方法依賴的package包/類
public void stop() {
    try {
        Unirest.shutdown();
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:drinkwater-io,項目名稱:drinkwater-java,代碼行數:8,代碼來源:RestService.java

示例3: close

import com.mashape.unirest.http.Unirest; //導入方法依賴的package包/類
/**
 * Closes this resource, relinquishing any underlying resources.
 * This method is invoked automatically on objects managed by the
 * {@code try}-with-resources statement.
 * <p>
 * <p>While this interface method is declared to throw {@code
 * Exception}, implementers are <em>strongly</em> encouraged to
 * declare concrete implementations of the {@code close} method to
 * throw more specific exceptions, or to throw no exception at all
 * if the close operation cannot fail.
 * <p>
 * <p> Cases where the close operation may fail require careful
 * attention by implementers. It is strongly advised to relinquish
 * the underlying resources and to internally <em>mark</em> the
 * resource as closed, prior to throwing the exception. The {@code
 * close} method is unlikely to be invoked more than once and so
 * this ensures that the resources are released in a timely manner.
 * Furthermore it reduces problems that could arise when the resource
 * wraps, or is wrapped, by another resource.
 * <p>
 * <p><em>Implementers of this interface are also strongly advised
 * to not have the {@code close} method throw {@link
 * InterruptedException}.</em>
 * <p>
 * This exception interacts with a thread's interrupted status,
 * and runtime misbehavior is likely to occur if an {@code
 * InterruptedException} is {@linkplain Throwable#addSuppressed
 * suppressed}.
 * <p>
 * More generally, if it would cause problems for an
 * exception to be suppressed, the {@code AutoCloseable.close}
 * method should not throw it.
 * <p>
 * <p>Note that unlike the {@link Closeable#close close}
 * method of {@link Closeable}, this {@code close} method
 * is <em>not</em> required to be idempotent.  In other words,
 * calling this {@code close} method more than once may have some
 * visible side effect, unlike {@code Closeable.close} which is
 * required to have no effect if called more than once.
 * <p>
 * However, implementers of this interface are strongly encouraged
 * to make their {@code close} methods idempotent.
 *
 * @throws Exception if this resource cannot be closed
 */
@Override
public void close() throws Exception {
    Unirest.shutdown();
}
 
開發者ID:sjsucohort6,項目名稱:amigo-chatbot,代碼行數:50,代碼來源:HttpClient.java


注:本文中的com.mashape.unirest.http.Unirest.shutdown方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。