You use org.springframework.scheduling.timer.ScheduledTime rTask to launch a timerTask bean. The timerTask bean typically is an extension of java.util.TimerTaskm which provides a public void run(); method. You put your logic into run().
As you're using Acegi Security, you can modify which username and password to run under quite easily. Try this code (0.8.2 specific, from 0.9.0 and current CVS you'll need to change the class name used for the ContextHolder as per the upgrade-080-090.txt file that will be in the root of the Acegi Security distribution):
Code:
public void run() {
Authentication auth = new UsernamePasswordAuthenticationToken(username, password);
SecureContext sc = new SecureContextImpl();
sc.setAuthentication(auth);
ContextHolder.setContext(sc);
try {
// I now have security identity, so run my protected bean
runCode();
} catch (Exception ignored) {}
} finally {
ContextHolder.setContext(null);
}
}
private void runCode() {
this.myCollaboratingBean.doSomethingUseful();
}
HTH get you on the right track.