def stop { ignoreException(()=>DeviceService.exit) ignoreException(()=>FriendRelationService.exit) ignoreException(()=>EventService.exit) ignoreException(()=>UserService.exit) } private def ignoreException(f : ()=>unit) { try { f(); } catch { case e:Exception => println("Caught") } }