//
public void init() throws RsfException {
//1.获取MetaData
this.metaData = this.rsfContext.getService(requestMsg.getServiceName());
if (this.metaData == null) {
throw new RsfException(ProtocolStatus.NotFound, "service was not found.");
}
//2.反序列化
String[] pTypes = this.requestMsg.getParameterTypes();
try {
SerializeFactory serializeFactory = this.rsfContext.getSerializeFactory();
this.parameterObjects = this.requestMsg.toParameters(serializeFactory);
//
this.parameterTypes = new Class<?>[pTypes.length];
for (int i = 0; i < pTypes.length; i++) {
this.parameterTypes[i] = ProtocolUtils.toJavaType(pTypes[i], Thread.currentThread().getContextClassLoader());
}
} catch (RsfException e) {
throw e;
} catch (Throwable e) {
throw new RsfException(ProtocolStatus.SerializeError, e);
}
//3.check Forbidden
this.targetMethod = this.metaData.getServiceMethod(this.requestMsg.getTargetMethod(), pTypes, this.parameterTypes);
if (this.targetMethod == null) {
throw new RsfException(ProtocolStatus.Forbidden, "undefined service.");
}
}