return instance;
}
public byte[] invoke(byte[] serializedRequest) {
Request request = (Request) Marshaller.deserialize(serializedRequest);
Response response = new Response();
int id = request.getAOR().getId();
String operation = request.getOperation();
Object[] arguments = request.getArguments();
Class<?>[] argTypes = new Class<?>[arguments.length];
for (int i = 0; i < arguments.length; i++)
argTypes[i] = arguments[i].getClass();
try {
Method method = objectList.get(id).getClass().getMethod(operation,
argTypes);
Object result = method.invoke(objectList.get(id), arguments);
response.setResult(result);
} catch (NoSuchMethodException | SecurityException |
IllegalAccessException | IllegalArgumentException |
InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();