Could go the opposite way and welcome everyone and everything in, and have situations like your ports being bought by China, as is happening in African nations.
AFAIK, China has invested considerably in controlling African port infrastructure and operations, not trade policy in the abstract. While owning a port often implies direct control over what goes through it, the converse is not true: a government can still control its own port infrastructure while being completely laissez-faire about what goes through it.
They are building the ports to control the policy, it ain’t altruistic.
China owned port can be shut down on a whim, thus giving its owner political power because closing the port would effect the nations livelihood via exports/imports.