Barrel Adjuster hard to use and loose
Inline barrel adjusters shouldn't need be glued or anything -- they're held where they are due to friction. 

Depending on the adjuster, you put ferrules on both ends of the housing and then stick it in the ends of the adjuster, or you put some ferrule-like adjuster on one side of the housing and then a ferrule on the other and stick both ends into the adjuster or similar. All of them will do something like this if you remove the tension and pull them apart. And you normally hold one part and turn the other. 

Other barrel adjusters like the ones on frame stops will thread in or have some other locking mechanism. 

As for the particular adjuster you have, that seems to be a Jagwire inline adjuster which is normally installed in the middle of a cable -- normally, the STI shifters come with something like this installed as the adjuster (Shimano Y6UM98010, see this EV for example):



After market options include Jagwire BSA035 and Ritchey STI Barrel Adjusters and what not.