Interfaces extending the Shareable tagging interface have this special property: Calls to the interface methods take place across Java Card platform's applet firewall boundary by means of a context switch.
The Shareable interface serves to identify all shared objects. Any object that needs to be shared through the applet firewall shall directly or indirectly implement this interface. Only those methods specified in a shareable interface are available through the firewall.
Implementation classes can implement any number of shareable interfaces and can extend other shareable implementation classes.
Like any Java platform interface, a shareable interface simply defines a set of service methods. A service provider class declares that it “implements” the shareable interface and provides implementations for each of the service methods of the interface. A service client class accesses the services by obtaining an object reference, casting it to the shareable interface type, and invoking the service methods of the interface.
The shareable interfaces within the Java Card technology shall have the following properties: