github-code-scanning[bot] commented on code in PR #14776: URL: https://github.com/apache/dolphinscheduler/pull/14776#discussion_r1299992459
########## dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/client/ClientMethodInvoker.java: ########## @@ -0,0 +1,26 @@ +/* + * 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 org.apache.dolphinscheduler.extract.base.client; + +import java.lang.reflect.Method; + +public interface ClientMethodInvoker { + + Object invoke(Object proxy, Method method, Object[] args) throws Throwable; Review Comment: ## Useless parameter The parameter 'proxy' is never used. [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/3050) ########## dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/server/ServerMethodInvokerImpl.java: ########## @@ -15,38 +15,37 @@ * limitations under the License. */ -package org.apache.dolphinscheduler.rpc; +package org.apache.dolphinscheduler.extract.base.server; -import org.apache.dolphinscheduler.rpc.base.RpcService; +import java.lang.reflect.Method; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +public class ServerMethodInvokerImpl implements ServerMethodInvoker { -/** - * UserService - */ -@RpcService("IUserService") -public class UserService implements IUserService { + private final Object serviceBean; - private static final Logger logger = LoggerFactory.getLogger(UserService.class); + private final Method method; - @Override - public Boolean say(String s) { + private final String methodIdentify; - logger.info("Kris UserService say-------------------------------Synchronous call msg{}", s); - return true; + public ServerMethodInvokerImpl(Object serviceBean, Method method) { + checkMethodValid(method); + this.serviceBean = serviceBean; + this.method = method; + this.methodIdentify = method.toGenericString(); } @Override - public Integer hi(int num) { + public Object invoke(Object... args) throws Throwable { + // todo: check the request param when register + return method.invoke(serviceBean, args); + } - logger.info("Kris UserService hi-------------------------------async call msg{}", num); - return ++num; + private void checkMethodValid(Method method) { Review Comment: ## Useless parameter The parameter 'method' is never used. [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/3051) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
