There are 3 phases of gastric juice secretion; they overlap, and are named for location where stimuli act.
Cephalic (aka reflex) phase: Activated by thought, smell, sight of food, swallowing. In other words, before food reaches stomach, the secretions prep the stomach for activity. This phase is mediated via cholinergic/vagal mechanisms.
Cerebral cortex -> hypothalamus & medulla oblongata -> vagus nerve -> gastric secretions.
Gastric phase: Triggered by the chemical effects of food and stomach distention (so, when food reaches stomach). Lasts 3-4 hours, provides majority of gastric juice.
Distention -> short and long reflexes leading to parietal cell activation and HCL release.
Partially digested proteins, caffeine, and rising pH -> activate G cells -> gastrin is released.
Intestinal phase: There is a brief stimulatory sub-phase that begins when partially digested food fills duodenum and stimulates intestinal cells to release intestinal gastrin, which acts on stomach.
There is also an inhibitory sub-phase, where distention of duodenum adn the presence of acidic, fatty, or hypertonic chyme inhibit gastric secretions (and reduce gastric motility). Mediated via short and long reflexes, plus secretin and cholecystokinin.