Familyman ---
WHY are you using bones for animating this? I suppose there may be something to be gained from using bone weights to alter the actual shapes of the barrel sections in a cartoony way, but there's no need for bones at all, from what I can tell.
You've got two sections of the barrel that actually move --- the middle section and the muzzle section. Simply parent the middle section to the base section, and parent the muzzle section to the middle section. This way, the middle and muzzle sections will "track" any motion the base and/or middle sections make, respectively. Then, since it's primarily linear (rather than rotational) motion you need, you can keyframe along the appropriate (X-, Y-, or Z-) axis for the middle and/or muzzle sections.
I rarely, if EVER, use bones for any of the animations I've created (which, if you're interested, you can se at
www.rudyschneider.com). Bones are primarily meant for objects with organic qualities, where the object surfaces must change shape --- such as the folding and/or twisting of skin when a character moves its head up and down, and left and right. As Kubajzz, pointed out, another way to do this is with morph targets. The only possible down-side I can think of for your application would be controlling the "tracking" of the morphs.
By the way, guns (or cannons) don't actually recoil in this fashion. In general, the entire length of the barrel, through which the projectile travels, cannot change in shape between the firing chamber and the muzzle. Instead, the barrel is usually suspended on a sliding mechanism fitted with springs and/or hydraulic shocks, which absorb a portion of the energy from the projectile as it accelerates through the barrel.