As I have pointed out before completely stopping the pirates is complicated, but containment is possible. In fact:
Containment involves limiting the damage that can be caused by pirates. This can be carried out by naval patrols, convoys, establishing safe routes and blockades of pirate ports, the very sort of activity we now see by naval units in the area.So far, with the use of armed helicopters as "quick reaction forces" the time period the pirates have to act to grab a ship is lessened and more attacked ships are escaping capture. That the pirates are sometimes "caught and released" is almost irrelevant to the greater goal of suppressing their activities in the major sea lanes of the Gulf of Aden and offshore Somalia.
In the future, private ship escort "navies" or other techniques may be employed by ship owners to control the safety of their ships. If poor shipping companies can't afford protection, then the pirate targets will be limited to ships that probably can't pay much in the way of ransom. This will affect the pirates' bottom line and screw up their business model.
Containing the level of piracy, while guarding against complete sea line of communication disruption, allows time for something to happen internally in Somalia that may allow that failed nation to regroup and control its own territorial waters and the operational areas of the pirates.