These locks are typically spring loaded or contain another perpendicular and smaller hydraulic or pneumatic cylinder that is placed as a collar or an installable “head” on top of the cylinder rod end. The lock will fit around and actuate to clamp against the rod and lock it at points in travel.