Merge pull request #542 from FrankBian/feature/read-api
Correct typos and Remove unnecessary method modifier in Interface
This commit is contained in:
commit
c5e18804ae
@ -49,21 +49,14 @@ public class ConfigFactory {
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public interface IConfigContext {
|
||||
* @param key
|
||||
* @return context
|
||||
*/
|
||||
public Object getParameter(String key);
|
||||
Object getParameter(String key);
|
||||
|
||||
/**
|
||||
* set context
|
||||
@ -35,5 +35,5 @@ public interface IConfigContext {
|
||||
* @param key key
|
||||
* @param value value
|
||||
*/
|
||||
public void setParameter(String key, Object value);
|
||||
void setParameter(String key, Object value);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import com.alibaba.nacos.api.exception.NacosException;
|
||||
*/
|
||||
public interface IConfigFilter {
|
||||
/**
|
||||
* Init Fuction
|
||||
* Init Function
|
||||
*
|
||||
* @param filterConfig Filter Config
|
||||
*/
|
||||
|
@ -24,12 +24,12 @@ import com.alibaba.nacos.api.exception.NacosException;
|
||||
*/
|
||||
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;
|
||||
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public interface IFilterConfig {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getFilterName();
|
||||
String getFilterName();
|
||||
|
||||
/**
|
||||
* get param
|
||||
@ -35,6 +35,6 @@ public interface IFilterConfig {
|
||||
* @param name
|
||||
* @return param
|
||||
*/
|
||||
public Object getInitParameter(String name);
|
||||
Object getInitParameter(String name);
|
||||
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ package com.alibaba.nacos.api.config.listener;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
* Listner Adapter,use default notify thread
|
||||
* Listener Adapter,use default notify thread
|
||||
*
|
||||
* @author water.lyl
|
||||
*/
|
||||
@ -28,6 +28,7 @@ public abstract class AbstractListener implements Listener {
|
||||
/**
|
||||
* use default Executor
|
||||
*/
|
||||
@Override
|
||||
public Executor getExecutor() {
|
||||
return null;
|
||||
}
|
||||
|
@ -25,16 +25,16 @@ import java.util.concurrent.Executor;
|
||||
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);
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class ConfigExample {
|
||||
configService.addListener(dataId, group, new Listener() {
|
||||
@Override
|
||||
public void receiveConfigInfo(String configInfo) {
|
||||
System.out.println("recieve:" + configInfo);
|
||||
System.out.println("receive:" + configInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user