The source code for the alarm clock is in the Android source code. AlarmClock is gone, but has been replaced by DeskClock. Source code is here. I glanced over the code real quick, and their receiver seems to use the KeyguardManager. Check out the docs, that seems to be what you want.
EDIT: I'll add your findings here. This code should do:
final Window win = getWindow();
win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…