@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws RemoteException {
		try {
			Class<?>[] parameterTypes = method.getParameterTypes();
			// compose a message to invoke method from remote object
			RMIMessage msg = new RMIMessage(serviceName, method.getName(),
					parameterTypes, args, serverHost, serverPort);
			// send it over socket and get return value
			RMIMessage ret = (RMIMessage) commModule.send(msg);
			if (ret.getContent() instanceof Exception) {
				throw new RemoteException(((RemoteException)ret.getContent()).getMessage());
			}
			return ret.getContent();
		} catch (RemoteException e) {
			throw new RemoteException(e.getMessage());
		}
	}