Commit e5db538c authored by yihua.huang's avatar yihua.huang

#647 remove ThreadSafe annotation

parent b539522c
...@@ -2,7 +2,6 @@ package us.codecraft.webmagic.downloader; ...@@ -2,7 +2,6 @@ package us.codecraft.webmagic.downloader;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.annotation.ThreadSafe;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
...@@ -30,7 +29,6 @@ import java.util.Map; ...@@ -30,7 +29,6 @@ import java.util.Map;
* @author code4crafter@gmail.com <br> * @author code4crafter@gmail.com <br>
* @since 0.1.0 * @since 0.1.0
*/ */
@ThreadSafe
public class HttpClientDownloader extends AbstractDownloader { public class HttpClientDownloader extends AbstractDownloader {
private Logger logger = LoggerFactory.getLogger(getClass()); private Logger logger = LoggerFactory.getLogger(getClass());
......
package us.codecraft.webmagic.pipeline; package us.codecraft.webmagic.pipeline;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.annotation.ThreadSafe;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import us.codecraft.webmagic.ResultItems; import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task; import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.utils.FilePersistentBase; import us.codecraft.webmagic.utils.FilePersistentBase;
...@@ -21,7 +19,6 @@ import java.util.Map; ...@@ -21,7 +19,6 @@ import java.util.Map;
* @author code4crafter@gmail.com <br> * @author code4crafter@gmail.com <br>
* @since 0.1.0 * @since 0.1.0
*/ */
@ThreadSafe
public class FilePipeline extends FilePersistentBase implements Pipeline { public class FilePipeline extends FilePersistentBase implements Pipeline {
private Logger logger = LoggerFactory.getLogger(getClass()); private Logger logger = LoggerFactory.getLogger(getClass());
......
package us.codecraft.webmagic.scheduler; package us.codecraft.webmagic.scheduler;
import org.apache.http.annotation.ThreadSafe;
import us.codecraft.webmagic.Request; import us.codecraft.webmagic.Request;
import us.codecraft.webmagic.Task; import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.utils.NumberUtils; import us.codecraft.webmagic.utils.NumberUtils;
...@@ -16,7 +15,6 @@ import java.util.concurrent.PriorityBlockingQueue; ...@@ -16,7 +15,6 @@ import java.util.concurrent.PriorityBlockingQueue;
* @author code4crafter@gmail.com <br> * @author code4crafter@gmail.com <br>
* @since 0.2.1 * @since 0.2.1
*/ */
@ThreadSafe
public class PriorityScheduler extends DuplicateRemovedScheduler implements MonitorableScheduler { public class PriorityScheduler extends DuplicateRemovedScheduler implements MonitorableScheduler {
public static final int INITIAL_CAPACITY = 5; public static final int INITIAL_CAPACITY = 5;
......
package us.codecraft.webmagic.scheduler; package us.codecraft.webmagic.scheduler;
import org.apache.http.annotation.ThreadSafe;
import us.codecraft.webmagic.Request; import us.codecraft.webmagic.Request;
import us.codecraft.webmagic.Task; import us.codecraft.webmagic.Task;
...@@ -15,7 +14,6 @@ import java.util.concurrent.LinkedBlockingQueue; ...@@ -15,7 +14,6 @@ import java.util.concurrent.LinkedBlockingQueue;
* @author code4crafter@gmail.com <br> * @author code4crafter@gmail.com <br>
* @since 0.1.0 * @since 0.1.0
*/ */
@ThreadSafe
public class QueueScheduler extends DuplicateRemovedScheduler implements MonitorableScheduler { public class QueueScheduler extends DuplicateRemovedScheduler implements MonitorableScheduler {
private BlockingQueue<Request> queue = new LinkedBlockingQueue<Request>(); private BlockingQueue<Request> queue = new LinkedBlockingQueue<Request>();
......
package us.codecraft.webmagic.downloader; package us.codecraft.webmagic.downloader;
import org.apache.http.annotation.ThreadSafe;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import us.codecraft.webmagic.Page; import us.codecraft.webmagic.Page;
...@@ -16,7 +15,6 @@ import java.io.*; ...@@ -16,7 +15,6 @@ import java.io.*;
* @author dolphineor@gmail.com * @author dolphineor@gmail.com
* @version 0.5.3 * @version 0.5.3
*/ */
@ThreadSafe
public class PhantomJSDownloader extends AbstractDownloader { public class PhantomJSDownloader extends AbstractDownloader {
private static Logger logger = LoggerFactory.getLogger(PhantomJSDownloader.class); private static Logger logger = LoggerFactory.getLogger(PhantomJSDownloader.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment