That would be the logical way to me. But, if you are writing these yourself(which is what I assume, as the twincat Mx library is still in beta anyway) why don't you just let the plc handle the TCP and the java only handle the motion. Otherwise it seems illogical(hence spoc issues).
Or run the Java app through the PLC(I do this, but with a .NET app). Twincat ADS is very easy /robust, though I am not sure if there will be hoops to jump through to use Java with it.
As a side note, if all you want to do is change the tcp, Mx is probably overkill. I just map bytes from the PLC and use the submit to update a global frame. But this may not give you the same functionality, as you then need to "assign" the tool to activate this frame.