package com.ikasoa.rpc.service;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import com.ikasoa.rpc.RpcException;
import com.ikasoa.rpc.handler.ProtocolHandler;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * IKASOA服务端服务实现
 * 
 * @author <a href="mailto:larry7696@gmail.com">Larry</a>
 * @version 0.1
 */
@Slf4j
public class IkasoaServerService extends AbstractGetService<Object[], Object> {

	@Getter
	@Setter
	private Object classObj;

	@Getter
	@Setter
	private Method method;

	public IkasoaServerService(Object classObj, Method method, ProtocolHandler<Object[], Object> protocolHandler) {
		this.classObj = classObj;
		this.method = method;
		this.protocolHandler = protocolHandler;
	}

	@Override
	public Object get(Object[] args) throws RpcException {
		if (method == null)
			throw new RpcException("'method' is null !");
		if (classObj == null)
			throw new RpcException("'classObj' is null !");
		if (args == null) {
			log.debug("'args' is null , Will create default args object .");
			args = new Object[] {};
		}
		log.debug("Execute class '{}' function '{}' , parameters is '{}' .", classObj.getClass().getName(),
				method.getName(), args.toString());
		method.setAccessible(Boolean.TRUE);
		try {
			return method.invoke(classObj, args);
		} catch (IllegalAccessException e) {
			throw new RpcException("'GET' reflect exception !", e);
		} catch (IllegalArgumentException e) {
			throw new RpcException("'GET' reflect exception !", e);
		} catch (InvocationTargetException e) {
			log.debug(e.getTargetException().toString());
			return e.getTargetException();
		}
	}

}
@@ -1416,85 +1416,10 @@
 ion 
-e) %7B%0D%0A%09%09%09throw new RpcException(%22'GET' reflect exception !%22, e);%0D%0A%09%09%7D catch (
+%7C 
 Ille
@@ -1645,8 +1645,10 @@
 %0A%09%7D%0D%0A%0D%0A%7D
+%0D%0A

Update IkasoaServerService.java