-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add LifeCycle component and refactor some code. (#113) * Make getAfterRun un-block avoid deadlock. (#107) (#109) * update readme * update version to 1.6.0-SNAPSHOT * 修改RpcClientDemoByMain 和RpcServerDemoByMain 的logger引用对象 (#112) * 修改日志引用的对象 * add lifecycle component * fix NPE in ReconnectManager and refactor some code * Refactor some components with LifeCycle interface. (#114) Refactor some components with LifeCycle interface. * Refactor RpcClient with LifeCycle interface and add option module. (#116) Refactor RpcClient with LifeCycle interface and add option module. * fix #131 (#132) * refactor DefaultConnectionManager to fix issue: #131 * refactory ConnectionManager to support start/shutdown operations (#135) * 重构ScheduledDisconnectStrategy实现 (#136) * refactory ConnectionManager to support start/shutdown operations * Reconnector class is used instead of ReconnectManager class * refactor ScheduledDisconnectStrategy * Support config strategy (#138) * support config user ConnectionSelectStrategy impl * add LifeCycle interface to RemotingServer * fix some code according to CR * fix #137 (#141) * update version 1.6.0-SNAPSHOT->1.6.0
- Loading branch information
Showing
51 changed files
with
2,186 additions
and
1,292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.alipay.remoting; | ||
|
||
/** | ||
* @author chengyi (mark.lx@antfin.com) 2018-11-05 14:43 | ||
*/ | ||
public abstract class AbstractLifeCycle implements LifeCycle { | ||
|
||
private volatile boolean isStarted = false; | ||
|
||
@Override | ||
public void startup() throws LifeCycleException { | ||
if (!isStarted) { | ||
isStarted = true; | ||
return; | ||
} | ||
|
||
throw new LifeCycleException("this component has started"); | ||
} | ||
|
||
@Override | ||
public void shutdown() throws LifeCycleException { | ||
if (isStarted) { | ||
isStarted = false; | ||
return; | ||
} | ||
|
||
throw new LifeCycleException("this component has closed"); | ||
} | ||
|
||
@Override | ||
public boolean isStarted() { | ||
return isStarted; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.