Can it be considered as a scheduled Java agent? From what I've found so far, it seems like it's a better way (best practice?) if you want to go the Java path.
Of course your admin need to install the OpenSocial component (if you're on 9.0.1) but if it can satisfy your requirement then it's at least better than the XAgent method (which is more of a hack?).