1. A method, in a data processing system, for runtime based application security, the method comprising: receiving, by an application runtime environment executing within an operating system in a virtual machine executing within a first execution environment on a 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 second execution 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 by querying a service registry for an alternate version of a given software module with enhanced security and deploying the alternate version of the given software module in the application runtime environment, wherein the application comprises a set of software modules.