If you look in your server/default/deploy/scheduler-service.xml you'll see the two ways in which you can set up a scheduled task.
The quickest way is to implement the first method. In the declaration you'll notice that it references org.jboss.varia.scheduler.example.SchedulableExample - if you look at the source code for that class you'll see how to do yours.
This method will lock you in to JBoss so if you really need portability then this may not help you. The second method will make your code more portable but requires writing your own MBean - this is how I prefer to do them. (I think portability is the only difference between the two)