From 17af20ab502bb56b2fc71da4b4176eb5918ff84e Mon Sep 17 00:00:00 2001 From: romanman Date: Thu, 22 May 2014 15:30:38 +0300 Subject: [PATCH] minor --- ethereumj-core/pom.xml | 2 +- .../net/peerdiscovery/PeerDiscovery.java | 3 --- .../ethereum/net/peerdiscovery/PeerTaster.java | 4 ---- .../RejectedExecutionHandlerImpl.java | 17 +++++++++++++++++ .../net/peerdiscovery/WorkerThread.java | 1 - 5 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/RejectedExecutionHandlerImpl.java diff --git a/ethereumj-core/pom.xml b/ethereumj-core/pom.xml index 82b7acf4..575c6e64 100644 --- a/ethereumj-core/pom.xml +++ b/ethereumj-core/pom.xml @@ -10,7 +10,7 @@ diff --git a/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/PeerDiscovery.java b/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/PeerDiscovery.java index 6b8979c2..b48826b8 100644 --- a/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/PeerDiscovery.java +++ b/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/PeerDiscovery.java @@ -1,10 +1,7 @@ package org.ethereum.net.peerdiscovery; -import org.ethereum.manager.MainData; import org.ethereum.net.client.PeerData; -import samples.threadpool.MyMonitorThread; -import samples.threadpool.RejectedExecutionHandlerImpl; import java.util.List; import java.util.concurrent.*; diff --git a/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/PeerTaster.java b/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/PeerTaster.java index a21a54f3..11e1e097 100644 --- a/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/PeerTaster.java +++ b/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/PeerTaster.java @@ -9,10 +9,6 @@ import org.ethereum.gui.PeerListener; import org.ethereum.manager.MainData; import org.ethereum.net.client.EthereumFrameDecoder; import org.ethereum.net.client.PeerData; - -import java.net.Inet4Address; -import java.net.InetAddress; -import java.net.UnknownHostException; import java.util.ArrayList; diff --git a/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/RejectedExecutionHandlerImpl.java b/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/RejectedExecutionHandlerImpl.java new file mode 100644 index 00000000..27ddfeb2 --- /dev/null +++ b/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/RejectedExecutionHandlerImpl.java @@ -0,0 +1,17 @@ +package org.ethereum.net.peerdiscovery; + +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * www.ethereumJ.com + * User: Roman Mandeleil + * Created on: 22/05/2014 10:31 + */ + +public class RejectedExecutionHandlerImpl implements RejectedExecutionHandler { + @Override + public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { + System.out.println(r.toString() + " is rejected"); + } +} diff --git a/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/WorkerThread.java b/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/WorkerThread.java index f3310922..a1368cf0 100644 --- a/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/WorkerThread.java +++ b/ethereumj-core/src/main/java/org/ethereum/net/peerdiscovery/WorkerThread.java @@ -1,6 +1,5 @@ package org.ethereum.net.peerdiscovery; -import org.ethereum.manager.MainData; import org.ethereum.net.client.PeerData; import java.util.concurrent.ThreadPoolExecutor;