How does the prostate prevent urine from entering the ejaculatory ducts?



I read that the prostate is a muscle-driven switch. It stops semen from entering the bladder, but how does it prevent urine from entering the ejaculatory ducts? I have searched on Google and Microsoft and I found nothing about this. Is there a valve in the ejaculatory ducts or what?


“During ejaculation, the prostate and the bladder’s sphincter muscle close the urethra up to the bladder to prevent semen from entering the bladder. Closing of the seminal ducts during urination: During urination, the central zone muscles close the prostate’s ducts so that urine cannot enter” [“How does the prostate work?“, National Library of Medicine, 15 February 2011].

Sphincter muscles surround a tube, such as the urinary duct or the ejaculatory duct. When the muscles contract, they squeeze the duct close.