Oh, yes, I forgot to add that twist.
You can just create a simple scheduled agent that calls your "XAgent" through a url. If you need to pass data to your XAgent you can add them as url arguments :-)
Looking a little further ahead I think we will start to use OSGi for such tasks. But most of us would still need to learn a lot more about OSGi before doing that. Specifically, I am thinking of deployment and daily operations - and of course some best practices for development :-)
/John