Commit 4fa01369 by huangfusuper

增加部分注释 删除多余代码

parent 2e83f196
......@@ -39,7 +39,7 @@ public class AdminRegisterConfig {
return invokerFactory;
}
@Bean
/*@Bean
public RpcSpringProviderFactory rpcSpringProviderFactory() {
RpcSpringProviderFactory providerFactory = new RpcSpringProviderFactory();
//providerFactory.setPort(port);
......@@ -52,6 +52,6 @@ public class AdminRegisterConfig {
log.info(">>>>>>>>>>>>>>> byit-myth-admin 向注册中心注册config初始化完成");
return providerFactory;
}
}*/
}
......@@ -87,7 +87,7 @@ public class RpcSpringInvokerFactory extends InstantiationAwareBeanPostProcessor
null,
rpcInvokerFactory
);
//获取一个代理对象
Object serviceProxy = referenceBean.getObject();
// set bean
......
......@@ -136,9 +136,7 @@ public class RpcReferenceBean {
public Object getObject() {
return Proxy.newProxyInstance(Thread.currentThread()
.getContextClassLoader(), new Class[] { iface },
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
(proxy, method, args) -> {
// method param
String className = method.getDeclaringClass().getName(); // iface.getName()
......@@ -232,23 +230,23 @@ public class RpcReferenceBean {
} else if (CallType.FUTURE == callType) {
// future-response set
RpcFutureResponse futureResponse = new RpcFutureResponse(invokerFactory, rpcRequest, null);
try {
try {
// invoke future set
RpcInvokeFuture invokeFuture = new RpcInvokeFuture(futureResponse);
RpcInvokeFuture.setFuture(invokeFuture);
// do invoke
client.asyncSend(finalAddress, rpcRequest);
// do invoke
client.asyncSend(finalAddress, rpcRequest);
return null;
} catch (Exception e) {
return null;
} catch (Exception e) {
logger.info(">>>>>>>>>>> myth-rpc, invoke error, address:{}, RpcRequest{}", finalAddress, rpcRequest);
// future-response remove
futureResponse.removeInvokerFuture();
throw (e instanceof RpcException)?e:new RpcException(e);
}
}
} else if (CallType.CALLBACK == callType) {
......@@ -277,13 +275,12 @@ public class RpcReferenceBean {
return null;
} else if (CallType.ONEWAY == callType) {
client.asyncSend(finalAddress, rpcRequest);
return null;
} else {
client.asyncSend(finalAddress, rpcRequest);
return null;
} else {
throw new RpcException("myth-rpc callType["+ callType +"] invalid");
}
}
});
}
......
......@@ -82,7 +82,7 @@ public abstract class ConnectClient {
if (connectClient!=null && connectClient.isValidate()) {
return connectClient;
}
//获取对应地址的锁对象
// lock
Object clientLock = connectClientLockMap.get(address);
if (clientLock == null) {
......
......@@ -19,7 +19,7 @@ public class AddComplexPy {
runNode.setNodeId("2");
runNode.setNodeName("lijkki");
runNode.setRunCmd("python ${biz_file}");
JobUtils.setRequestUrl("http://127.0.0.1:8081/myth-job-admin");
JobUtils.setRequestUrl("http://10.0.120.208:8081/myth-job-admin/");
JobUtils.setTOKEN("test");
JobUtils.realExectNode(runNode);
/* PluginPackage pluginPackage = new PluginPackage();
......
......@@ -16,7 +16,7 @@ public class AddComplexPy1 {
PluginPackage pluginPackage = new PluginPackage();
pluginPackage.setWorkspaceName("test");
pluginPackage.setFlow(createFlow());
JobUtils.setRequestUrl("http://127.0.0.1:8081/myth-job-admin");
JobUtils.setRequestUrl("http://10.0.120.208:8081/myth-job-admin");
JobUtils.setTOKEN("test");
JobUtils.publish(pluginPackage);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment