Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor BinaryLogClient into an abstract base class to allow for more flexible use #16

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Cosmetic changes to reduce diff noise for the pull request
ldcasillas-progreso committed Apr 18, 2014
commit 0f98923a4c49c80f7a8a0732bacb9cf7ad59f824
Original file line number Diff line number Diff line change
@@ -37,10 +37,10 @@
*/
public class BinaryLogClient extends AbstractBinaryLogClient {

private final Logger logger = Logger.getLogger(getClass().getName());
private final List<EventListener> eventListeners = new LinkedList<EventListener>();
private final List<LifecycleListener> lifecycleListeners = new LinkedList<LifecycleListener>();
private ThreadFactory threadFactory;
private final Logger logger = Logger.getLogger(getClass().getName());

/**
* Alias for BinaryLogClient("localhost", 3306, &lt;no schema&gt; = null, username, password).
@@ -90,12 +90,12 @@ public void setThreadFactory(ThreadFactory threadFactory) {
* Connect to the replication stream in a separate thread.
* @param timeoutInMilliseconds timeout in milliseconds
* @throws com.github.shyiko.mysql.binlog.network.AuthenticationException in case of failed authentication
* @throws java.io.IOException if anything goes wrong while trying to connect
* @throws java.util.concurrent.TimeoutException if client wasn't able to connect in the requested period of time
* @throws IOException if anything goes wrong while trying to connect
* @throws TimeoutException if client wasn't able to connect in the requested period of time
*/
public void connect(long timeoutInMilliseconds) throws IOException, TimeoutException {
final CountDownLatch countDownLatch = new CountDownLatch(1);
BinaryLogClient.AbstractLifecycleListener connectListener = new BinaryLogClient.AbstractLifecycleListener() {
AbstractLifecycleListener connectListener = new BinaryLogClient.AbstractLifecycleListener() {
@Override
public void onConnect(BinaryLogClient client) {
countDownLatch.countDown();