1. A method, in a data processing system, for runtime based application security, the method comprising: receiving, by an application runtime environment executing within a virtual machine on the data processing system, notification of a change in execution environment for the virtual machine; and responsive to determining the virtual machine is being migrated to a virtualized environment based on the notification of a change in execution environment, dynamically modifying, by the application runtime environment, execution of an application in the application runtime environment, wherein the application comprises a set of application modules.