added private method for cache invalidation
removed usage of ResourceFactory in Application resource

replaced saving of Application in setDefaultAccountStore and setDefaultGroupStore to application cache invalidation