* @param parameterTypes The types of the parameters for this operation
* @return An operation with the specified name and parameter types
*/
private static Operation newOperation(String name, Class<?> operationInterface, Class<?>... parameterTypes) {
// Create and set the operation name
Operation operation = new OperationImpl();
operation.setName(name);
// Make the operation remotable
Interface iface = new InterfaceImpl();
iface.setRemotable(true);
operation.setInterface(iface);
// Construct the parameters
List<DataType> types = new ArrayList<DataType>();
DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
for (Class<?> parameterType : parameterTypes) {
DataType type = new DataTypeImpl<Class>(parameterType, Object.class);
types.add(type);
}
operation.setInputType(inputType);
// Return the created operation
return operation;
}