Skip to content

Commit

Permalink
Merge pull request alibaba#542 from FrankBian/feature/read-api
Browse files Browse the repository at this point in the history
Correct typos and Remove unnecessary method modifier in Interface
  • Loading branch information
hxy1991 authored Jan 4, 2019
2 parents 6c83ec9 + b7e0f34 commit c5e1880
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,14 @@ public static ConfigService createConfigService(Properties properties) throws Na
/**
* Create Config
*
* @param ServerAddr serverlist
* @param serverAddr serverList
* @return Config
* @throws NacosException Exception
*/
public static ConfigService createConfigService(String serverAddr) throws NacosException {
Properties properties = new Properties();
properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);
try {
Class<?> driverImplClass = Class.forName("com.alibaba.nacos.client.config.NacosConfigService");
Constructor constructor = driverImplClass.getConstructor(Properties.class);
ConfigService vendorImpl = (ConfigService)constructor.newInstance(properties);
return vendorImpl;
} catch (Throwable e) {
throw new NacosException(-400, e.getMessage());
}
return createConfigService(properties);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public interface IConfigContext {
* @param key
* @return context
*/
public Object getParameter(String key);
Object getParameter(String key);

/**
* set context
*
* @param key key
* @param value value
*/
public void setParameter(String key, Object value);
void setParameter(String key, Object value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
public interface IConfigFilter {
/**
* Init Fuction
* Init Function
*
* @param filterConfig Filter Config
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
*/
public interface IConfigFilterChain {
/**
* Filter aciton
* Filter action
*
* @param request request
* @param response response
* @throws NacosException NacosException
*/
public void doFilter(IConfigRequest request, IConfigResponse response) throws NacosException;
void doFilter(IConfigRequest request, IConfigResponse response) throws NacosException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public interface IConfigRequest {
* @param key key
* @return value
*/
public Object getParameter(String key);
Object getParameter(String key);

/**
* get config context
*
* @return
*/
public IConfigContext getConfigContext();
IConfigContext getConfigContext();

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public interface IConfigResponse {
* @param key key
* @return value
*/
public Object getParameter(String key);
Object getParameter(String key);

/**
* get context
*
* @return configContext
*/
public IConfigContext getConfigContext();
IConfigContext getConfigContext();

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public interface IFilterConfig {
*
* @return
*/
public String getFilterName();
String getFilterName();

/**
* get param
*
* @param name
* @return param
*/
public Object getInitParameter(String name);
Object getInitParameter(String name);

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.concurrent.Executor;

/**
* Listner Adapter,use default notify thread
* Listener Adapter,use default notify thread
*
* @author water.lyl
*/
Expand All @@ -28,6 +28,7 @@ public abstract class AbstractListener implements Listener {
/**
* use default Executor
*/
@Override
public Executor getExecutor() {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
public interface Listener {

/**
* Executor to excute this receive
* Executor to execute this receive
*
* @return Executor
*/
public Executor getExecutor();
Executor getExecutor();

/**
* 接收配置信息
*
* @param configInfo 配置值
*/
public void receiveConfigInfo(final String configInfo);
void receiveConfigInfo(final String configInfo);
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void main(String[] args) throws NacosException, InterruptedExcepti
configService.addListener(dataId, group, new Listener() {
@Override
public void receiveConfigInfo(String configInfo) {
System.out.println("recieve:" + configInfo);
System.out.println("receive:" + configInfo);
}

@Override
Expand Down

0 comments on commit c5e1880

Please sign in to comment.