Remoting works by intercepting calls to certain objects (MarshalByRefObject
), and by performing an RPC call instead; essentially the object at the caller is just a lightweight proxy to the real object at the originating AppDomain/machine/etc. The arguments and results are transferred (again, taking MarshalByRefObject
into account - otherwise by using BinaryFormatter
to serialize the values).
Reflection is built deep into the core runtime, and provides access to the underlying type definitions. This is possibly in part because the IL underneath .NET languages is quite expressive in terms of the original code.
However, I am not personally aware of any way to talk via remoting to java. It may be possible, but the formats used are (AFAIK) proprietary. In general, such calls are more likely to take the form of SOA calls, such as web-services (on SOAP or POX), or other open standards such as messages serialized with JSON or "protocol buffers" (an open-source wire format with variants for both C# and java).