updating run method in UrsusNIOApplication to support generics