Abstract:
Method for automatically selecting a software application being a program for execution on a virtual machine, including the steps of 
     receiving an exit status value from a terminating software application;
 
translating the exit status value to an identifier for the next software application to be executed, wherein a mapping table is used;
 
executing on the virtual machine the next software application (J 4 ) program that is represented by the identifier.

Description:
FIELD OF THE INVENTION 
       [0001]    This invention relates to a method for automatically selecting a software application. In particular, the invention relates to the lifecycle management of Java applications. 
       BACKGROUND 
       [0002]    Multimedia data on a pre-recorded optical storage medium, e.g. digital versatile disc (DVD), can belong to different applications, e.g. different video titles, games or the like. They are usually embedded into the programming structure of the medium as applications, which can be individually started. 
         [0003]    For pre-recorded optical media it is however desirable to have well defined content appearance and user experience, e.g. interactivity, as well as sophisticated authoring possibilities. Java technology can meet these requirements, as it is independent of the underlying hardware and operating system, and provides a full-fledged programming environment including e.g. graphics and network interfaces. Java technology uses an execution unit called Java Virtual Machine (JVM) to execute so-called bytecode, which is retrieved from files that are called class files. They may be organized in libraries or packages. The JVM is specified as an abstract machine and can be understood as a separate software layer that requires processing unit hardware to be executed. 
         [0004]    Different configurations and profiles exist for Java runtime environments within consumer electronics devices, wherein each profile is suitable for a certain type of devices. The main difference between different profiles is which libraries they support. Profiles like e.g. the “Personal Basis Profile” and the “Personal Profile” are more suitable for consumer electronics devices. 
         [0005]    In the classical application model an application is either in the active or inactive state. Beyond this basic model, the mentioned profiles define an enhanced application model, called the “Xlet” application model, which allows fine-grained control over the lifecycle of an application. The system encompasses an “Application Manager” (AM), which is a software entity that controls the lifecycle of all running applications through a specific interface. E.g. the AM can load an application into a JVM, start and stop it. 
         [0006]    Accordingly, an application is at any point in time in one of a number of lifecycle states, e.g. loaded, started or stopped. An application may change its lifecycle state by itself. The AM provides an application management interface (AMI), through which an application signals its state or state changes. Thus, the AM has at any time up-to-date information about the lifecycle state of all applications. 
       SUMMARY OF THE INVENTION 
       [0007]    A problem to be solved by the invention is the integration of Java into an existing system. In principle, a lifecycle model is needed that defines when and how an application is started and what happens when an application terminates or is terminated, i.e. a model that defines the system behavior, in order to improve the flexibility of interaction between AM and applications. 
         [0008]    The invention is based on employing for each application stored on a storage medium, e.g. a pre-recorded storage medium, a mapping table, which may be stored on the same or another storage medium and which is used to translate application exit status information (which is application specific) of the respective application into identifiers representing titles or Java applications that are also stored on a medium, e.g. the same medium, and therefore are disc specific, and that shall be executed next. Thus, when a Java application finishes, the player may apply the exit status information of a finishing application to the respective mapping table, read the mapping table return value and continue with the specified entity derived from the table. 
         [0009]    A common way for software applications to provide status information is to terminate with an exit code, which can be analyzed by superordinate or subsequent software layers. 
         [0010]    The invention allows usage of a particular mapping table for one, more than one or all applications stored on a storage medium. I.e. in one embodiment of the invention the storage medium contains as many mapping tables as it holds Java applications, while in another embodiment the storage medium contains less, but at least one mapping table that is shared by several or all applications stored on the medium. It is also possible that a storage medium contains one or more mapping tables according to the invention for only some, but not all of the applications that it holds. 
         [0011]    The present invention constitutes a flexible and robust method by which an author of e.g. a multimedia disc can control the system behavior of a playback device during playback of the disc, particularly in the case when a Java application lifecycle on a playback device ends. Thus, it is possible for a disc author to pre-define a flexible sequence of the different independently retrievable applications on the disc, thereby also enabling improved reaction on input during runtime, e.g. user input, input from the player (e.g. timer unit) or similar. 
         [0012]    An apparatus that utilizes the method is disclosed in claim  7 . 
         [0013]    Advantageous embodiments of the invention are disclosed in the dependent claims, the following description and the figures. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0014]    Exemplary embodiments of the invention are described with reference to the accompanying drawings, which show in 
           [0015]      FIG. 1  the structure of playback data stored on a multimedia disc, and related Java applications; 
           [0016]      FIG. 2  usage of mapping table for mapping exit status code to next title identifier; 
           [0017]      FIG. 3  usage of mapping table for mapping exit status code to next application identifier; 
           [0018]      FIG. 4  structure of a Java title menu; and 
           [0019]      FIG. 5  exemplary mapping tables, with different applications sharing a mapping table. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0020]      FIG. 1  depicts the structure of multimedia data and menu data stored on a pre-recorded storage medium, e.g. DVD or Blu-ray disc. When the storage medium is inserted into a player, i.e. a reproduction device, the player searches and detects the index table IT. Further, the player detects that the first entry IN_PB of the index table is a Java application JF. This can be detected e.g. when the first entry IN_PB is a file name with an extension that indicates a Java class file. The player will then set up a Java Application Manager (AM) and a Java Virtual Machine (JVM) to execute the program of the specified file. E.g. the specified application JF starts the playback of a specific audio-visual (AV) sequence or movie object, such as an intro sequence. 
         [0021]    When the AV sequence finished, the Java application JF terminates and the player continues to step through the index table IT. The next table entry T_menu contains a link to another Java application JT, which is executed in the JVM and results in displaying the top-level menu and a background video sequence. This may be displayed until the user selects an item. 
         [0022]    It may appear useful to measure the time during which the user gives no input, and after a certain time start an application automatically, e.g. one of the index table entries or an additional animation with following return to the top-level menu. 
         [0023]    When an item is selected, the running application JT is automatically terminated and returns an exit value. The player may use this exit value to identify the next application to start, e.g. a particular title Title_ 1 . According to the invention, a mapping table is used for this identifying of the next application to start. The mapping table provides a link between a return value of an application and an identifier for the next application to start. 
         [0024]    An advantage of using such mapping table is that, for each application, one or more individual successor applications can be provided. Thus, it is possible for a content author to define a flexible sequence of titles on a disc holding several titles, instead of either defining a fixed sequence or returning to the main menu after termination of an application. E.g. when an application J 1  playing back a particular selected title Title_ 1  is terminated, it returns an exit value that either can be mapped to a further title Title_ 3 , which starts another Java application J 3 , or to a third Java application J 5 , which may be not selectable from the top-level menu. In this case the previously activated title remains active, since no new title is selected from the index table IT. The previously selected title, i.e. index table entry, is active. Such index table entry may be a link to a Java application, but also another program. 
         [0025]    The mapping table according to the invention is context and application specific, i.e. each application may have its own mapping table for the current context, e.g. edition. In many cases however different applications may share the same mapping table. The identifier provided by the table may be a numeric or alphanumeric value, e.g. a title or application identifier (APPL_ID) that is associated with an application, and through which the application can be called. It may also be a parameter of a specified type or class, e.g. a file name. One or more Java applications can be assigned to a title by using the application identifiers (APPL_ID) that are associated with each Java application. 
         [0026]    In  FIG. 2 , the application manager using a mapping table MT determines from the exit status code ES of a terminating Java application J 1  an identifier that points to an entry Title_ 4  of the index table IT, which in turn specifies another Java application J 4  to be executed on the JVM. The mapping table MT provides for each possible exit status code ES of the application J 1  for which it is valid a valid identifier App_ID of the next application to execute. This is possible because the data type, and thus the bit width of a return value of applications are known. The mapping table MT of  FIG. 2  comprises an entry for the minimum value MIN, one entry for the values between the minimum value and zero, one entry each for exit status codes zero, one and two, an entry for exit status codes above two but below the maximum value, and finally an entry for the maximum value. The exit code values may be e.g. four bit wide, and thus can be interpreted as signed integer values −8, . . . , 7, as in the described example. The return values may as well be of the unsigned integer type, or any other type. 
         [0027]    In general, there are two ways of how to terminate Java applications: either the termination is initiated by the application manager, or by the application itself. For applications retrieved from a storage medium, this means in the earlier case that the user defines how to proceed, e.g. title search, while in the latter case the author of the medium defines what should happen next. Therefore, the invention enables a flexible means for content authors to provide information where to proceed when an application terminates. 
         [0028]    The mapping table is generally a data structure for associating an input value with an output value, i.e. a return value of one application on the disc with an identifier of another application on the disc. It serves the purpose of specifying the system behavior in the case when the Java application ends, and is processed by the Application Manager (AM). An example of a conceptual mapping table is illustrated in Tab.1. 
         [0000]    
       
         
               
             
               
               
               
               
             
           
               
                 TABLE 1 
               
             
             
               
                   
               
               
                 Exemplary conceptual mapping table 
               
             
          
           
               
                   
                 Exit Status 
                 Identifier 
                 request_resume_flag 
               
               
                   
                   
               
               
                   
                 Integer.MIN_VALUE 
                 Title 1 
                 0 
               
               
                   
                 . . . 
                 . . . 
                 . . . 
               
               
                   
                 0 
                 Title 1 
                 1 
               
               
                   
                 1 
                 Application 
                 0 
               
               
                   
                   
                 98765 
               
               
                   
                 . . . 
                 . . . 
                 . . . 
               
               
                   
                 Integer.MAX_VALUE 
                 Title 2 
                 0 
               
               
                   
                   
               
             
          
         
       
     
         [0029]    The first column in the table defines exit status values that may be passed from the application. In a preferred embodiment of the invention, this is an integer number. The table covers all values that the application may return, from a minimum value to a maximum value. In another embodiment, a default value is given instead of minimum and maximum values. This default value may also be used if e.g. a terminating application returns no value or the returned value matches no other table entry. 
         [0030]    The second column specifies identifiers representing titles or Java applications. State-of-the-art prerecorded optical discs are logically divided into so-called titles, where each title has an associated title number. The inventive mapping table allows specifying title numbers in the “identifier” column. This allows pre-defining or authoring a transition to another title. The transition may encompass a “Mode Change” of the player, in case that title is authored by known means other than Java, e.g. a script that defines pre-commands, AV playback commands and post-commands. The table also allows specifying in the identifier column a Java application instead of a title. In this case, the player may start the specified application within the current title, without title or mode transition. 
         [0031]    Further, in case of a transition to another title, the player may hold resume information at runtime for that title. In case an author wishes to resume to that title, thus requesting the player to evaluate the stored resume information, this can be expressed by setting the “request_resume_flag” in the associated field in the table. This can be used e.g. to control different behavior or different return values for an application that is called multiple times. 
         [0032]      FIG. 3  shows an application J 1  terminating with an exit status code ES being “2”. The AM looks this value up in the mapping table and finds in the related entry the associated application identifier App_ID “99”, which it recognizes as an identifier for a Java application J 99 . It loads the specified Java application J 99  to a JVM, which executes it. The specified Java application J 99  could in this case also be started directly from the index table IT. When the application J 99  terminates, the AM receives a return value ES 99  which it looks up in the mapping table MT, in order to determine the next application to execute. 
         [0033]      FIG. 4  shows how user input can be handled. A Java application JM executing a top-level menu returns an exit status value when a user has selected a menu item. The application JM has different exit status values, depending on which menu item the user has selected via an input device, e.g. remote control. The exit status value is mapped to one of the other entries of the index table IT using the above-described inventive mapping table. One of the selected index table entries Title_ 2  may start e.g. playback of a movie, controlled by the AM but not using a JVM, while another index table entry Title_ 3  starts another Java application JT on a JVM, which then plays back another video title. 
         [0034]    The exit status value that an application returns may also be influenced by the player or other factors beyond user input, e.g. a timer unit, a pseudo-random generator or another connected device like a personal computer. 
         [0035]      FIG. 5  depicts exemplarily a short menu for a storage medium with four titles Title_ 1 , . . . , Title_ 4 . When a player reads the storage medium, it evaluates the index table IT, and an AM steps through the entries. The first entry FirstPlayback contains an identifier for a Java application JF, which is loaded into a JVM and executed. Upon its termination, the application returns no exit code value, and no mapping table is associated with it. Therefore the AM will continue to step through the index table IT, and for the next entry find an identifier T_menu of another Java application JT. This application is also loaded into a JVM and executed, which results in displaying a menu for the user. But this application JT terminates only upon user input, or automatically after a predefined time if the user provides no input. A timer unit may control this. When the user e.g. selects Title_ 3  from the menu, the running application JT returns an exit code value of “3” to the AM. The AM will use a mapping table MT_JT that is associated with the terminating application to map the exit code value “3” to an application or title identifier “103”, which points e.g. to the respective index table entry Title_ 3 . If the user selects another menu item, the return value of the menu application JT may point to another index table entry, or directly to an application J 41 . The selected index table entry Title_ 3  represents another Java application J 3 , which is then loaded into the JVM and executed, e.g. a movie or game is played. 
         [0036]    Upon termination of this application, it returns an exit status value to the AM, which uses a mapping table MT_J 4  that is valid e.g. for two different applications J 3  and J 4 . The Java application J 3  may have been programmed actually for another storage medium, another version of the medium or the like, and may return exit code values between two and seven. The author may however have decided that exit code values of two, six and seven from the application J 3  should be ignored for this edition of the medium, while in another edition these codes may have another function. Therefore, the same mapping table MT_J 4  than for another application J 4  can be used. 
         [0037]    Generally, two or more applications may share a mapping table if they have the same relevant return values. Thus, mapping tables are medium-specific, while the return values of an application are application specific. 
         [0038]    There are manifold ways of associating an application with a mapping table according to the invention. Determination of the valid exit-code mapping table can be done at any time, but preferably while an application is running. The application can be any piece of executable program, and the mapping table any data structure that links an input value and an output value. Examples for the association between application and mapping table are via file name, via directory structure or via a separate mapping table. 
         [0039]    In the first case, the application program and the file that holds the mapping table have e.g. the same file name, with different file name extensions. 
         [0040]    In the second case, the application program and the file that holds the mapping table may be stored in the same directory, or folder, on the medium. 
         [0041]    In the third case, a separate mapping table for mapping the application identifier of a running application to an identifier for the respective exit-code mapping table may be stored on the medium. 
         [0042]    According to the present invention the following steps are performed when an application initiates its lifecycle end: First, an exit status value is provided. Second, the exit status value is translated to an identifier using a mapping table, and third the player continues with the entity that is represented by the identifier. These steps are explained in more detail in the following. 
         [0043]    For the “classical” application model, the exit status value is provided through the System.exit(int status) method, i.e. a terminating application returns an integer value representing its status to the next control layer, i.e. the AM. In case of the Xlet application model, the application signals only the end of its lifecycle to the AM through the AMI. In addition, according to the present invention, the terminating application provides an exit status to the AM. There are various methods how this can be achieved. In a preferred embodiment, the AMI is extended so that an application can directly pass the exit status value to the AM. In another embodiment of the invention, the exit status value is stored at a specified location that is known and available to both the application and the AM, before signaling the end of the lifecycle. For this purpose, any kind of volatile or non-volatile memory can be used. 
         [0044]    In case the application delivers no exit status information to the AM, e.g. when the state-of-the-art AMI is used, the table may provide a special entry to handle that case or a default value to be used. 
         [0045]    In the second step, the AM uses the information in the mapping table to translate the actual exit status into an identifier, i.e. table look-up. 
         [0046]    In the third step, the player continues with the entity that is represented by the identifier. As described above, this can be a transition to another title if a title number is specified, which may encompass a “Mode Change”. If the identifier represents a Java application, the player starts the specified application within the current title, i.e. no title or mode transition is necessary. 
         [0047]    The above-described Tab.1 is a conceptual table. The table can be stored more efficiently than illustrated above, e.g. by using default values, as shown in the following Tab.2. 
         [0000]    
       
         
               
             
               
               
               
             
               
               
               
             
           
               
                 TABLE 2 
               
             
             
               
                   
               
               
                 More efficiently coded mapping table 
               
             
          
           
               
                   
                 int status 
                 Title#/App_ID 
               
               
                   
                   
               
             
          
           
               
                   
                 0 
                 3781 
               
               
                   
                 1 
                 8273 
               
               
                   
                 2 
                 3922 
               
               
                   
                 default 
                 1 
               
               
                   
                   
               
             
          
         
       
     
         [0048]    In the preferred embodiment, the table covers the complete range of possible exit status values of the corresponding application. In another embodiment, the table needs not cover the complete range or leave some identifier fields empty. In this case, no transition is performed at all if a return value cannot be mapped to an application or title. 
         [0049]    For the values in the right-hand column of Tab.2 that identify applications or titles there can be value ranges reserved, e.g. a first range for title identifiers and a second range for application identifiers. 
         [0050]    Advantageously, the current invention provides very robust means to specify the system behavior at the end of a Java application lifecycle. In particular, the mapping table can easily be verified for consistency before public release of the disc, and thus ensures that at application runtime a valid title or application is launched for any exit status value. 
         [0051]    Another advantage of the invention is the easy reuse of Java applications. This comprises reusing an application in different configurations with the same disc, as described above, as well as using a particular application to author different discs. Since the system transition behavior is defined by the mapping table, and thus separately from the application itself, the same application can easily be reused in different contexts. For example, the same application can easily be integrated into different discs. Only the mapping table needs adaptation, but no programming is needed to change application code. 
         [0052]    Another advantage of the invention is the possibility to launch another Java application upon an application terminating, i.e. at the end of an application lifecycle. This provides a simple means to integrate a number of applications into one title. State-of-the-art solutions would require programming work to integrate the different applications into one single application. Therefore, the invention supports flexible and fine-grained structuring of titles. This improved modularity provides additional flexibility to content authors. 
         [0053]    Moreover, the invention can serve as a building block to integrate Java applications into state-of-the-art systems. 
         [0054]    In one embodiment of the invention, program data of the terminating software application and the next software application to be executed are retrieved from a read-only storage medium, and the data representing the mapping table are retrieved from a rewritable storage medium, e.g. hard-disk drive (HDD). This has the advantage that the mapping table can later be modified. Rules may be provided for the case that two mapping tables are available, one on the medium where the terminating application is stored and one on a local storage medium such as HDD, e.g. “mapping tables from HDD are higher prioritized” or similar. 
         [0055]    The general idea of the invention is a conceptual mapping table that is used to translate application exit status information (Application specific) into identifiers representing titles or Java applications (disc specific). When a Java application finishes, the player evaluates the mapping table and continues with the specified entity derived from the table. 
         [0056]    Main advantages of the invention are that it allows flexible transitions to other titles or Java applications, easier verification due to improved robustness, easy reuse of applications, and higher flexibility. Particularly, verification of the medium after authoring is easier because it can be performed modularly in steps, instead of having to verify the whole medium at once in different contexts. 
         [0057]    The invention can be used for data structures, particularly data structures stored on storage media, which contain data for applications to be executed on a virtual machine, such as Java applications to be executed on a JVM. The invention may be used with application programs written in the Java programming language, or with programs written in other languages that execute on a JVM, or a Virtual Machine in general.