Your goal is to build a simple controller that will know which model and function to run, and then return a JSON object as a response that is usable on the far end of the transaction.
The EJB object stub (the part that executes in the context of the caller), the EJB protocol (RMI over IIOP), and the skeleton objecton the remote end all conspire to make this happen transparently.
A process that calls this method on an object implementing the ChannelInput interface will block until an object is actually written on the channel by a process at the other end of the channel.