The was a law promulgated by the Tokugawa Shogunate in 1825 to the effect that all foreign vessels should be driven away from Japanese waters.
An example of the law being put into practice was the Morrison Incident of 1837, in which an American merchant vessel attempting to use the return of Japanese castaways as leverage to initiate trading was fired upon.
The law was repealed in 1842.