if (request instanceof List) {
List<Object> params = CastUtils.cast((List<?>) request);
parameters = params.toArray(new Object[params.size()]);
} else if (request != null) {
List<Object> params = new MessageContentsList(request);
parameters = params.toArray(new Object[params.size()]);
} else {
parameters = new Object[0];
}
// injecting context parameters