In the 1600’s both China and Japan closed off trade to:

Foreigners

Middle eastern countries

Western countries

Each other