===== 3.4 Contexts ===== Each applet running on a Java Card virtual machine is associated with an execution **//context//**. The Java Card virtual machine uses the **//context//** of the current frame to enforce security policies for inter-applet operations. There is a one-to-one mapping between contexts and packages in which applets are defined. An easy way to think of a context is as the runtime equivalent of a package, since Java packages are compile-time constructs and have no direct representation at runtime. As a consequence, all applet instances from the same package will share the same context. The Java Card Runtime Environment also has its own context. Framework objects execute in this **//Java Card RE context//**. The context of the currently executing method is known as the **//current context//**. Every object in a Java Card virtual machine is owned by a particular context. The **//owning context//** is the context that was current when the object was created. When a method in one context successfully invokes a method on an object in another context, the Java Card virtual machine performs a **//context switch//**. Afterwards the invoked method's context becomes the current context. When the invoked method returns, the current context is switched back to the previous context.