Patent ID: 8032872

Claim:
A method for supporting a legacy application in a multi-threaded runtime environment comprising: executing a plurality of multi-threaded applications in the multi-threaded runtime environment on a smart card; detecting a request to open the legacy application on the smart card, wherein the legacy application is a single-threaded application designed to run in a single-threaded environment, and wherein the legacy application is accessible to the plurality of multi-threaded applications through a shareable interface object; generating, in response to the request and in the multi-threaded runtime environment, a specialized environment for the legacy application to execute, wherein the specialized environment is configured to execute the legacy application, and wherein the specialized environment comprises a proxy object, wherein the proxy object encapsulates the shareable interface object to control access by the plurality of multi-threaded applications to the shareable interface object such that only one multi-threaded application is allowed to access code in the legacy application at a time; and executing the legacy application in the specialized environment on the smart card, wherein during execution of the legacy application: detecting that the legacy application is accessing an existing instantiation of an object in memory, wherein the existing instantiation of the object is intended by the legacy application to be shared between applications executing in the single-threaded environment; and creating, in response to the detecting that the legacy application is accessing the existing instantiation of the object, a new copy of the object in memory to cause the existing instantiation of the object to not be shared.