Simulate spring to implement package scanner function