Add runtime validation support for port connections
To ensure a correct connection of the ports between two stages, we need a validation mechanism that is independent of using Generics, e.g., in situations where raw types are used or the stages are connected in a GUI at runtime.