Caffeine has kind of two main mechansims of action. Like ions said it is a purine, and it acts as an antagonist of the adenosine A2A receptors. These receptors normally mediate feelings of tiredness when activated, so blocking them causes wake fullness (this is different than stimulation, which comes from increased dopamine and norepinephrine signalling, which is the primary mechanism of action of all the drugs you listed.
Second caffeine is a phosphodiesterase inhibitor. When G alpha coupled g protein coupled receptors (such as beta adrenergic receptors or D1 dopamine receptors), the molecule adenosine mono phosphate (AMP) gets converted to cyclic adenosine mono phosphate(cAMP) by the enzyme adenylyl cyclase. cAMP acts as a second messenger sequential to (Gs) receptor activation, which activates many enzyme targets in the cell to exert it's effects. cAMP is broken down by phosphodiesterase, to terminate this signal (cells have loads of phosphodiesterases to break down a wave of cAMP, so that its timing is precise).
Caffeine inhibits phosphodiesterases that break down cAMP, so the effects of any Gs coupled receptor will be magnified. Some of the actual stimulation works through increasing the "gain" on existing norepinephrine and dopamine signaling.