public boolean isDeclaredException(Class<?> cls) { return findDeclaredException(cls) >= 0; }
public DynamicMethodMarshallerImpl(Method method) { this.method = method; ehandler = new ExceptionHandlerImpl(method.getExceptionTypes()); needsArgumentCopy = false; Class<?>[] argTypes = method.getParameterTypes(); hasArguments = argTypes.length > 0; if (hasArguments) { argRWs = new ReaderWriter[argTypes.length]; for (int ctr = 0; ctr < argTypes.length; ctr++) { // This could be further optimized to avoid copying if argTypes contains at most one immutable object // type. if (!argTypes[ctr].isPrimitive()) needsArgumentCopy = true; argRWs[ctr] = makeReaderWriter(argTypes[ctr]); } } Class<?> resultType = method.getReturnType(); needsResultCopy = false; hasVoidResult = resultType.equals(void.class); if (!hasVoidResult) { needsResultCopy = !resultType.isPrimitive(); resultRW = makeReaderWriter(resultType); } }
public DynamicMethodMarshallerImpl(Method method) { this.method = method; ehandler = new ExceptionHandlerImpl(method.getExceptionTypes()); needsArgumentCopy = false; Class<?>[] argTypes = method.getParameterTypes(); hasArguments = argTypes.length > 0; if (hasArguments) { argRWs = new ReaderWriter[argTypes.length]; for (int ctr = 0; ctr < argTypes.length; ctr++) { // This could be further optimized to avoid copying if argTypes contains at most one immutable object // type. if (!argTypes[ctr].isPrimitive()) needsArgumentCopy = true; argRWs[ctr] = makeReaderWriter(argTypes[ctr]); } } Class<?> resultType = method.getReturnType(); needsResultCopy = false; hasVoidResult = resultType.equals(void.class); if (!hasVoidResult) { needsResultCopy = !resultType.isPrimitive(); resultRW = makeReaderWriter(resultType); } }
public boolean isDeclaredException(Class<?> cls) { return findDeclaredException(cls) >= 0; }
public void writeException(OutputStream os, Exception ex) { int index = findDeclaredException(ex.getClass()); if (index < 0) throw wrapper.writeUndeclaredException(ex, ex.getClass().getName()); rws[index].write(os, ex); }
public void writeException(OutputStream os, Exception ex) { int index = findDeclaredException(ex.getClass()); if (index < 0) throw wrapper.writeUndeclaredException(ex, ex.getClass().getName()); rws[index].write(os, ex); }
public Exception readException(ApplicationException ae) { // Note that the exception ID is present in both ae // and in the input stream from ae. The exception // reader must actually read the exception ID from // the stream. InputStream is = (InputStream) ae.getInputStream(); String excName = ae.getId(); int index = findDeclaredException(excName); if (index < 0) { excName = is.read_string(); Exception res = new UnexpectedException(excName); res.initCause(ae); return res; } return rws[index].read(is); }
public Exception readException(ApplicationException ae) { // Note that the exception ID is present in both ae // and in the input stream from ae. The exception // reader must actually read the exception ID from // the stream. InputStream is = (InputStream) ae.getInputStream(); String excName = ae.getId(); int index = findDeclaredException(excName); if (index < 0) { excName = is.read_string(); Exception res = new UnexpectedException(excName); res.initCause(ae); return res; } return rws[index].read(is); }