Information processing apparatus, method of controlling the same and non-transitory computer readable medium

An information processing apparatus having a safe mode for operation restricting a function of a bundle more than in a normal operation mode, comprises: an installation unit that installs a host bundle, and inactivates, as a temporary install, a fragment bundle added to the host bundle in order to extend a function of the host bundle, and stores the fragment bundle in a first memory area; and a holding unit that holds a list defining whether the temporarily installed fragment bundle is activated or inactivated when the information processing apparatus starts in the safe mode, wherein the installation unit, when the information processing apparatus starts in the safe mode, moves a fragment bundle defined to be activated in the list, out of temporarily installed fragment bundles, to a second memory area to activate that fragment bundle.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to an information processing apparatus, a method of controlling the same, and a non-transitory computer readable medium.

Description of the Related Art

In recent years, in image forming apparatuses, application (hereinafter “app”) operation environments as typified by a Java (registered trademark) environment are provided. With the aim of improving the functions and usability of the image forming apparatus, apps that operate in an environment such as a Java (registered trademark) environment are created, and by installing them in the image forming apparatus, desired functions can be realized. As an app platform, there is OSGi (Open Service Gateway Initiative) which is a Java (registered trademark) app platform directed to embedded devices. In OSGi, a bundle is defined as a software module management unit, and specifications are defined for management of a life cycle comprising install/start/stop/update/uninstall.

Conventionally, in an operating system (OS) that operates in a personal computer (PC) or the like, there are cases in which the system itself crashes, or behavior becomes unstable due to an error in a setting of an app, a driver, or the like. For example, in the case where a plurality of drivers that use the same hardware resources are installed, there is the possibility of falling into these kinds of situations due to contention between drivers over hardware resources upon starting up. Further, the system itself cannot start without cancelling such a state, and so the system falls into a situation from which it cannot be recover.

In order to prevent falling into a situation as described above, an OS comprises a mode (hereinafter referred to as “safe mode”) which is separate from a normal operation mode (hereinafter referred to as “normal mode”) in which the system starts up which comprises only minimum drivers, system services, or the like. By starting up in the safe mode, the driver that is causing the malfunction is deleted, settings of driver, apps, or the like can be changed, and the cause of a system crash, an operation instability or the like can be avoided.

Meanwhile, in embedded devices such as image forming apparatuses, there are cases in which due to a user installing an app, a state of operation instability is fallen into caused by conflict between apps over resources, service registration, and usage order, or the like. As a means of recovery, an arrangement for starting up in a safe mode has been proposed (Japanese Patent Laid-Open No. 2010-009553). However, there is an arrangement in which for types of OSGi bundles there is a host bundle and a fragment bundle, and in a case where these apps are handled, it is necessary to consider restricting to fragment bundles as described below. A fragment bundle is a bundle of a format in which the bundle itself is added (attached) to a class loader space of a host bundle. The fragment bundle does not operate alone, but rather the fragment bundle can also be put into a started state when the host bundle enters a started state. Also, in order to put the fragment bundle in a stopped state, it is necessary to put the host bundle in a stopped state, or to uninstall the fragment bundle. These specifications are required as stipulations of OSGi, and a fragment bundle in a stopped state cannot be installed for a host bundle in a started state.

In the specifications described above, there was the problem that, in a case where there is a problem in the fragment bundle even where there is no problem in the host bundle itself, the starting of the host bundle would fail, and the system could not start normally, and therefore the system would fall into a situation from which it could not recover. For example, there are cases where for a host bundle started upon a safe mode start that is pre-installed in the system, a fragment bundle for which there is a problem is installed by a user.

SUMMARY OF THE INVENTION

In view of the above described problem, the present invention enables a system to start safely in a safe mode even in a case where a fragment bundle for which there is a problem is installed.

According to one aspect of the present invention, there is provided an information processing apparatus having a normal operation mode, and a safe mode for operation restricting a function of a bundle more than in the normal operation mode, the apparatus comprising: an installation unit configured to install a host bundle, and to inactivate, as a temporary install, a fragment bundle added to the host bundle in order to extend a function of the host bundle, and to store the fragment bundle in a first memory area; and a holding unit configured to hold a list defining whether the temporarily installed fragment bundle is activated or inactivated when the information processing apparatus starts in the safe mode, wherein the installation unit, when the information processing apparatus starts in the safe mode, moves a fragment bundle defined to be activated in the list, out of temporarily installed fragment bundles, to a second memory area to activate that fragment bundle.

According to another aspect of the present invention, there is provided a method for controlling an information processing apparatus having a normal operation mode, and a safe mode for operation restricting a function of a bundle more than in the normal operation mode, the apparatus comprising: installing a host bundle, and inactivating, as a temporary install, a fragment bundle added to the host bundle in order to extend a function of the host bundle, and storing the fragment bundle in a first memory area, wherein in the installing, when the information processing apparatus starts in the safe mode, a fragment bundle, out of temporarily installed fragment bundles, that is defined to be activated in a list defining whether to activate or inactivate when the information processing apparatus starts in the safe mode is caused to move to a second memory area to activate that fragment bundle.

According to another aspect of the present invention, there is provided a non-transitory computer-readable storage medium storing a program for causing a computer having a normal operation mode, and a safe mode for operation restricting a function of a bundle more than in the normal operation mode, to function as: an installation unit configured to install a host bundle, and to inactivate, as a temporary install, a fragment bundle added to the host bundle in order to extend a function of the host bundle, and to store the fragment bundle in a first memory area; and a holding unit configured to hold a list defining whether the temporarily installed fragment bundle is activated or inactivated when the computer starts in the safe mode, wherein the installation unit, when the computer starts in the safe mode, moves a fragment bundle defined to be activated in the list, out of temporarily installed fragment bundles, to a second memory area to activate that fragment bundle.

By virtue of the present invention, even in a case where a fragment bundle for which there is a problem is installed, the convenience of a user is not degraded, and it is possible to start the system safely in a safe mode start.

DESCRIPTION OF THE EMBODIMENTS

Hereinafter, embodiments for working the present invention are explained using drawings. Firstly, terms that will be used in the present specification will be defined.

A “host bundle” is a bundle which is a target of the addition of a fragment bundle. Note that a “bundle” indicates a Java (registered trademark) module, and in the present specification it will be used to means the same thing as an app.

A “fragment bundle” is a bundle that does not operate independently, but rather is added to a class loader space of a host bundle.

Adding a fragment bundle to a host bundle, i.e. attaching to a host bundle, is referred to as “installing a fragment bundle”. Furthermore, this state is referred to as “the fragment bundle is activated”.

Deleting a fragment bundle in a state in which it is added to a host bundle is referred to as “uninstalling a fragment bundle”.

Installing a fragment bundle in a state in which it is not attached to a host bundle is referred to as “temporarily installing a fragment bundle”. Furthermore, this state is referred to as “the fragment bundle is inactivated”.

A “general app” indicates a bundle installed by a user rather than a bundle that is pre-installed in the system.

A “system app” indicates a bundle that is pre-installed in the system.

First Embodiment

UsingFIG. 1toFIG. 7, explanation will be given for fragment bundle installation, and activation/inactivation which is common to each embodiment shown below. Also, usingFIG. 8andFIG. 9, explanation will be given for starting of a host bundle which is a basic form of a safe mode.

FIG. 1is a view for illustrating an example of a hardware configuration of an image forming apparatus130as an information processing apparatus. The image forming apparatus130comprises a print function, a scan function, a network communication function, or the like. A controller100is a controller of the image forming apparatus130. The controller100is connected electronically with a scanner unit113and a printer unit114, and is connected with an external device via a LAN116as well. A CPU101comprehensively controls access to various connected hardware based on a control program stored in a ROM102. Also, the CPU101comprehensively controls various processing performed within the controller100.

The ROM102is a read-only non-volatile storage area, and stores a boot program of the image forming apparatus130, or the like. A RAM103is a system work memory for the CPU101to operate, and is a memory for temporarily storing various data. The RAM103is configured by an FRAM and an SRAM capable of holding stored content even after a power supply is turned off, a DRAM whose storage contents are deleted after the power supply is turned off, or the like. An HDD104is a non-volatile storage area, and stores system apps, or the like. Firmware including installed apps that are explained inFIG. 3is stored in the HDD104.

An operation unit I/F105is an interface unit connecting a system bus119and an operation unit118. More specifically, the operation unit I/F105receives and displays data to be displayed on the operation unit118from the system bus119, and also outputs input information from the operation unit118to the system bus119. A user instruction to the image forming apparatus130, an information presentation, or the like, is performed via the operation unit118. A network I/F106is connected to the LAN116, a WAN117, and the system bus119, and performs input/output of information with an external unit. A scanner I/F108performs correction, processing, and editing of image data received from the scanner unit113.

An image forming unit109performs orientation conversion, image compression, decompression or the like on image data. A printer I/F110receives image data sent from the image forming unit109, and outputs to the printer unit114which performs a print operation. A USB interface (not shown) is a general purpose interface that connects various peripheral devices to the image forming apparatus130, and performs control of a connection USB (Universal Serial Bus). Here, a flash memory (not shown) is connected to the USB interface.

FIG. 2is a conceptual diagram of a software module hierarchy200of the image forming apparatus130. Note that, the software illustrated fromFIG. 2is saved in the ROM102or the HDD104and is executed by the CPU101. Also, various information used upon execution is held in the RAM103or the HDD104, and the exchange of various information between software functions is performed. Furthermore, communication with an external device is performed using the network I/F106.

Next, explanation is given for each software unit. The image forming apparatus130comprises an OS platform201, and a software platform202is configured on top of the OS platform201. The software platform202is configured as a runtime environment of a Java VM203which is a Java (registered trademark) virtual machine, and is configured by providing the Java VM203as an interpreter, and providing a framework group204, and a library205. The library205is configured to include standard API (Application Programming Interface) libraries. The framework group204is configured to include an OSGi206. The OSGi206causes a plurality of apps to operate on the single Java VM203. Furthermore, an OSGi extension unit211indicates that it is possible to extend a function as necessary with respect to the OSGi206. The OSGi206provides management of the life cycle of apps and an inter-app communication function. On the OSGi206, a plurality of system services are pre-installed. As a system service there is an app management service208for managing a plurality of app groups, adding new apps, updating, and deleting. The app management service208uses an installation control service207to perform app addition, updating, and deletion. Upon the starting up of the image forming apparatus130, the OSGi206, in accordance with a service start order list saved in the HDD104, sequentially starts services such as a log in app209, the installation control service207, and the app management service208. The service start order list in accordance with the present invention will be explained later.

The log in app209manages a logged in user. The log in app209has the characteristic that it cannot stop in consideration of the possibility of a login information query at an arbitrary timing from any app during login. Hypothetically, in a case where the log in app209was stopped, login information could not be obtained, and therefore, for example, in a case of an app that uses data associated with the login information, data obtainment would fail and a trouble would occur in that operation. Here, the login information indicates information such as a login name or a mail address of a user, or the like, who is currently logged-in to the image forming apparatus130. Because the log in app209has the characteristics described above, at least one operates when the image forming apparatus130starts up.

A general app210provides various functions to a user in the image forming apparatus130. As examples of the general app210, there are image processing and compression apps, apps that perform department management such as a printing restriction, or the like. The general app210operates under the management of the app management service208. The app management service208holds license information, app information, including version information of apps added as management targets, or the like. Furthermore, the app management service208responds to an instruction to uninstall an app in the image forming apparatus130, and removes the general app210from the management target. The general app210and the log in app209can be provided in the form of a host bundle or a fragment bundle as is described inFIG. 4.

FIG. 3is the view for illustrating a flow for when a user installs an app in the image forming apparatus130from a PC300.

An app installation UI301configured by a WEB page illustrated in an installation screen530ofFIG. 5is displayed on a WEB browser (not shown) of the PC300. A user designates an app they wish to install from the installation UI301, and makes an instruction for installation. The app management service208receives the instruction for installation of the app designated by the installation UI301, and passes it to the installation control service207. The installation control service207obtains an app file based on the received instruction, and makes a request for installation to the OSGi206. The OSGi206, using the obtained app file, performs an app installation. The installed app is managed by the app management service208.

FIG. 4is a view for explaining a configuration and a relationship of bundles. Here, an example in which for a host bundle400,2fragment bundles401and402comprising language localization resources (JP and CN) are installed is illustrated. In order to install the fragment bundles in the host bundle, the following manifest files and bundle permissions designation are necessary under the stipulations of the OSGi206.a manifest file403of the host bundle Bundle-ManifestVersion is designated to be “2”

To Bundle-SymbolicName a unique name is added in the frameworka manifest file405of the fragment bundle Bundle-ManifestVersion is designated to be “2”

For Fragment-Host <host bundle symbolic name> recited in the manifest file403of the host bundle is designated. The fact that these values match indicates that the host bundle and the fragment bundle are components of the same app.a permission404of the host bundle BundlePermission [bundle symbolic name, HOST]a permission406of the fragment bundle BundlePermission [bundle symbolic name, FRAGMENT]

In a state in which the above described conditions are satisfied, when installing a fragment bundle, based on the manifest information of the fragment bundle, the OSGi206identifies the corresponding host bundle, and adds a class path of the fragment bundle to the class path of the host bundle. A “class path” is information for designating from what location the Java VM203should read the class file when executing a Java app. A class file includes Java byte code which can be executed on the Java VM203. Furthermore, by a class loader (not shown) of the host bundle, all classes and resources in the fragment bundle are loaded. A “class loader” is an object that handles the loading of classes and the searching for resources, and all classes are loaded in the Java VM203by the class loader, and can be used from the app. Execution of the loading by the class loader of the host bundle is performed upon the start of the host bundle, and therefore it is always necessary to load after having first stopped the host bundle, and added the class path. Accordingly, in a case where the host bundle is not stopped, installation of the fragment bundle fails. After the fragment bundle is installed, it can be used as a portion of the host bundle.

In the present example, a Japanese resource and a Chinese resource are installed in the host bundle400which is the main unit as the fragment bundles401and402, and thereafter, the host bundle400can switch the language of the UI display using these language resources. In other words, while the standard display on the UI of the host bundle400is in English, it is possible to extend the functions of the host bundle400so as to display in Japanese or Chinese by installing new language resources, and designating the switching of the resources on the UI.

An example of a case where the host bundle is a log in app is given. In such a case, a configuration in which the host bundle handles basic processing related to authentication, and, for example, and the fragment bundle adds a UI function for logging in by information that an IC card holds when the IC card is held up is possible.

UsingFIG. 5toFIG. 7, explanation will be given for a host bundle and fragment bundle management method in an app management screen that the app management service208provides. Also, explanation will be given for temporarily installing a fragment bundle, and for activation/inactivation of a fragment bundle.

FIG. 5is a view for illustrating an example configuration of a management screen500and the installation screen530for a general app in the app management service208. Here, explanation is given with a general app management screen, but a similar screens is assumed for a log in app management screen.

Firstly, explanation will be given for the management screen500for general apps. An application name501displays a name of a general app that is managed. In the case of the example illustrated inFIG. 5, an application A505and an application B506are managed. Furthermore, the application A505is assumed to be a host bundle, and a fragment bundle A507and a fragment bundle B508are managed. Also, display is performed so that it can be seen that the fragment bundles are associated with the host bundle. Here, the fragment bundle A507and the fragment bundle B508are displayed in association with the application A505.

An installation day502indicates a date that a respective app was installed. An application ID503displays an application ID (identification information) assigned uniquely to a respective app. A state504indicates a state of a respective app. If the app is in a started state, “started” is displayed; if the state is a stopped state, “stopped” is displayed. Also, in a case where a target is a fragment bundle, in a case where the fragment bundle is installed in a host bundle “active” is displayed in the state504, and in a case of temporary install state indicated inFIG. 6, “inactive” is displayed. A start button516and a stop button513are instruction buttons for switching start/stop of an app. The stop button is displayed for an app in the started state, and the start button is displayed for an app in the stopped state. An activation button515and an inactivation button514are buttons for instructing the switching of active/inactive of a fragment bundle. When the stop button513of an app in the started state (the present example, the application A505″) is pressed, the state504is changed to “stopped”. On the other hand, when the start button516of an app in the stopped state (the present example, the application B506″) is pressed, the state504is changed to “started”. When the inactivation button514of an app in the active state (the present example, the fragment bundle A507″) is pressed, the state504is changed to “inactive”. On the other hand, when the activation button515of an app in the inactive state (the present example, the fragment bundle B508″) is pressed, the state504is changed to “active”.

Uninstall buttons517to520are buttons for instructing to uninstall respective apps. In an uninstallation of a fragment bundle, only the fragment bundle is the target of the uninstallation. For example, in a case where an uninstall button518of the fragment bundle A507is pressed, only the fragment bundle A507is uninstalled. On the other hand, when an uninstall button517of the application A505which is a host bundle is pressed, in addition to the application A505, the fragment bundle A507and the fragment bundle B508which are associated are also simultaneously uninstalled.

Next, explanation will be given for the installation screen530. When a reference button533is pressed, a screen (not shown) for selecting a file path is displayed. When an app file is designated on this selection screen, the path to the app file is input in a path531for the application file. There are cases where for an app a license file for decoding the app is necessary in the install process from the perspective of security, business, or the like. When a reference button534is pressed, a screen (not shown) for selecting a file path is displayed. When a license file is designated on this selection screen, the path to the license file is input in a path532for the license file. When an install button535is pressed, an installation of the app designated in the path531of the application file is started. In a case where a fragment bundle is designated for installation, the fragment bundle is first temporarily installed.

FIG. 6is a view for explaining a temporary install state of a fragment bundle. A case in which for a general app A600which is a host bundle a fragment bundle X601which is a fragment bundle is temporarily installed is illustrated.

The installation control service207, using a simultaneously designated license file, decodes the fragment bundle X601, and lays out an install work folder602. Thereafter, the installation control service207identifies, based on host bundle information recited in the manifest file of a fragment bundle X605which is decoded, that the associated host bundle is the general app A600. On top of this, the installation control service207lays out a fragment bundle X606in a temporary install folder604which is a memory area. A fragment bundle laid out in the temporary install folder604is in a temporary install state, and is not under the management of the OSGi206. Also, as is denoted by reference numeral607, the fragment bundle X606is laid out under a folder whose folder name is the unique app ID of the general app A600which is the host bundle.

FIG. 7is a view for explaining activation/inactivation of the fragment bundle X606which is temporarily installed inFIG. 6. By an activation instruction701of the user, the installation control service207performs activation processing for the fragment bundle X606which is temporarily installed in the inactive state. The installation control service207activates the fragment bundle X606, i.e. installs by moving it into an app folder603which is a memory area by installing in the host bundle (here, the general app A600). In this state it is under the management of the OSGi206, and the OSGi206holds a relationship between the general app A600and the fragment bundle X606. Note that after the fragment bundle X606is activated, the fragment bundle X606can be used as a portion of the general app A600. In this state, by starting the general app A600, the fragment bundle X606enters the started state.

On the other hand, by an inactivation instruction702of the user, the installation control service207performs inactivation processing for a fragment bundle X700which is installed in the active state. By inactivation processing, the fragment bundle X700once again is caused to be moved into the temporary install folder604, and is laid out in the inactive state. Because in this state it is not under the management of the OSGi206, the OSGi extension unit211holds a relationship between the general app A600and the fragment bundle X606. Note that after the fragment bundle X700is inactivated, the fragment bundle X700cannot be used as a portion of the general app A600. That is, in this state, even if the general app A600is started, the fragment bundle X606is in the stopped state. Note that in the present specification, for convenience, the temporary install folder604is referred to as the first memory area and the app folder603is recited as “the second memory area”.

FIG. 8illustrates an example of content of a service start order list800. An item801is a name for identifying an app. Note that in place of the name, a unique app ID (identification information) may be designated in order to uniquely identify an app. An item802is a setting for designating that an initial state of an app is started/stopped. A host bundle is the target of started/stopped. An item803indicates a start level of an app, and the OSGi206installs bundles laid out in firmware in order from the smallest numerical value, and controls to the initial state in accordance with the setting of the item802. An item804is a setting for designating that the state of the app upon a safe mode start is started/stopped; in a case where on is designated, the app is started, and in a case where “off” is designated, the app is stopped. Host bundles are the targets of started/stopped, and fragment bundles are non-targets of the designation. Also, a general app that a user installs, is handled as set to “off” upon the safe mode start.

FIG. 9is a flowchart for explaining starting a host bundle in a safe mode start. This processing is realized by the CPU101reading a program stored in the HDD104, or the like, and executing it.

When safe mode start processing is started, in step S901, the OSGi206reads the service start order list800, and starts the processing in order from a head line in the list. In step S902, the OSGi206obtains the type of the bundle. In step S903, the OSGi206confirms whether or not the type of the bundle obtained in step S902corresponds to a fragment bundle. In a case where it corresponds to a fragment bundle (YES in step S903), the processing proceeds to step S906, and in a case where it does not correspond to a fragment bundle, i.e. in a case where it is a host bundle (NO in step S903), the processing proceeds to step S904. In step S904, the OSGi extension unit211confirms whether or not the item804of the bundle of interest is on (i.e. whether or not safemode=on). In a case where safemode=off (NO in step S904), the processing proceeds to step S906, and in a case where safemode=on (YES in step S904), the processing proceeds to step S905. In step S905, the OSGi206starts the target bundle (i.e., the host bundle). In step S906, the OSGi206confirms whether or not it is the final line of the list. In a case where it is not the final line (NO in step S906), the processing returns to step S902, and the processing is repeated making the next line (the next bundle) the target of processing. In a case where processing has completed for all of the bundles in the service start order list (YES in step S906), the processing for the safe mode start terminates.

Above, explanation was given for a safe mode start whose target is host bundles. Next, an embodiment in which the safe mode start includes fragment bundles will be illustrated.

FIG. 10illustrates an example of content of a service start order list1000. Items1001-1004in the service start order list1000are the same as the items801-804illustrated inFIG. 8, and explanation thereof will be omitted. An item1005is a name for identifying a fragment bundle. Note that in place of the name, a unique app ID may be designated in order to uniquely identify a fragment bundle. An item1006is a setting for designating that the initial state of the fragment bundle is active/inactive. An item1007is a setting for designating that a state of a fragment bundle upon the safe mode start is active/inactive, and in a case where on is designated, the fragment bundle is activated, and in a case where “off” is designated, the fragment bundle is inactivated. Also, a general app that a user installs, is handled as set to “off” upon the safe mode start.

FIG. 11is a flowchart for explaining processing for when a safe mode start including a host bundle and a fragment bundle.

When the safe mode start processing is started, in step S1101, the OSGi206reads the service start order list1000, and starts the processing in order from a head line in the list. In step S1102, the OSGi extension unit211obtains the type of the bundle. In step S1103, the OSGi extension unit211confirms whether or not the type of the bundle obtained in step S1102corresponds to a fragment bundle. In a case where it does not correspond to a fragment bundle (NO in step S1103), the processing proceeds to step S1110, and in a case where it does correspond to a fragment bundle (YES in step S1103), the processing proceeds to step S1104.

In step S1104, the OSGi extension unit211obtains the activated/inactivated state of the fragment bundle. In step S1105, the OSGi extension unit211confirms whether or not the item1007is on (i.e. whether or not safemode=on). In a case where safemode=off (NO in step S1105), the processing proceeds to step S1106, and in a case where safemode=on (YES in step S1105), the processing proceeds to step S1108. In step S1106, the OSGi extension unit211confirms whether or not the state of the fragment bundle obtained in step S1104is activated. More specifically, in a case where the fragment bundle is stored in the temporary install folder604, it is determined that it is inactivated, and in a case where the fragment bundle is stored in the app folder603, it is determined that it is activated. In the case where it is not activated (NO in step S1106), the processing proceeds to step S1110, and in a case where it is activated (YES in step S1106), the processing proceeds to step S1107. In step S1107, the OSGi extension unit211performs inactivation processing. After that, the processing proceeds to step S1110.

In step S1108, the OSGi extension unit211confirms whether or not the state of the fragment bundle obtained in step S1104is inactivated. In the case where it is not inactivated (NO in step S1108), the processing proceeds to step S1110, and in a case where it is inactivated (YES in step S1108), the processing proceeds to step S1109. In step S1109, the OSGi extension unit211performs activation processing. After that, the processing proceeds to step S1110.

In step S1110, the OSGi extension unit211confirms whether or not it is the final line of the list. In a case where it is not the final line (NO in step S1110), the processing returns to step S1102, and the processing is repeated making the next line (the next bundle) the target of processing. In a case where processing has completed for all of the bundles in the service start order list (YES in step S1110), the processing proceeds to step S1111. For processing of step S1111, because it is the same explanation as for step S901to step S906illustrated inFIG. 9, explanation is omitted. Next, the processing of the safe mode start terminates.

FIG. 12is a view for illustrating a flow of processing of each service, and a flow of data for a case when the image forming apparatus130starts in the safe mode until the fragment bundle is temporarily installed.

In step S1200, when a user1250turns ON a power supply of the image forming apparatus130in a safe mode start, the safe mode start processing of step S1201starts. In step S1202, the image forming apparatus130calls framework start processing of the OSGi206. In step S1203, the OSGi extension unit211reads the service start order list1000. In step S1204, the OSGi extension unit211obtains the type of the bundle. In a case where the type of the bundle is a fragment bundle, the OSGi extension unit211obtains information of the state of the bundle in step S1205. In a case where the item1007is on and the state of the fragment bundle is the inactivated state, the OSGi extension unit211, in step S1206, performs an installation of the fragment bundle. In step S1207, the OSGi extension unit211copies an app file1251laid out in the temporary install folder604to the app folder603as an app file1252. In step S1208, the OSGi extension unit211deletes the app file1251laid out in the temporary install folder604. By the foregoing flow, the fragment bundle in the inactivated state enters the activated state.

Meanwhile, in a case where the item1007is “off” and the state of the fragment bundle is the activated state, the OSGi extension unit211, in step S1209, performs a file retraction instruction. In step S1210, the OSGi extension unit211copies an app file1253laid out in the app folder603to the temporary install folder604as an app file1254. In step S1211, the OSGi206performs uninstallation processing and deletes the app file1253laid out in the app folder603. By the foregoing flow, the fragment bundle in the activated state enters the inactivated state.

By virtue of the present embodiment, it is possible to increase convenience by, upon the safe mode start, inactivating a fragment bundle for which there is a possibility that a problem is included and thereby starting the system safely and activating necessary fragment bundles.

Second Embodiment

In the present embodiment, a case is considered in which upon the safe mode start, after inactivating or activating a fragment bundle, once again, the image forming apparatus is started in a normal operation mode (normal mode). There is a problem in that in a case where upon the safe mode start a fragment bundle cannot be used, a fragment bundle for which usage is stopped by the system cannot be used in the subsequent normal mode start either. With respect to this, for example, it can be considered that there is demand for being able to resume usage upon the subsequent normal mode start even in a case where usage of a fragment bundle that a user installed and started to use is stopped in a safe mode start.

FIG. 13is a view for illustrating an example of content of a safe mode activation/inactivation management file1300according to the present embodiment. An item1301is a name for identifying a fragment bundle. Note that in place of the name, a unique app ID may be designated in order to uniquely identify an app. An item1302records an original state of a fragment bundle (a state prior to the safe mode start); “effective” indicates that the original state is the active state, and “invalid” indicates that the original state is the inactive state. Based on the content recorded upon the above described safe mode start, a determination is performed as to which state to return the fragment bundle to upon the subsequent normal mode start.

Note that in a case where during the safe mode start the activation button515/the inactivation button514of the fragment bundle is pressed on the management screen500, the OSGi extension unit211deletes information of the fragment bundle which is the operation target from the safe mode activation/inactivation management file. This is performed to prioritize a user operation performed during the safe mode start. Also, in a case where uninstall buttons518and519are pressed on the management screen500, the OSGi extension unit211deletes information of the fragment bundle which is the operation target from the safe mode activation/inactivation management file1300. Furthermore, the same is true for a case where uninstall buttons517and520of host bundles are pressed. In other words, by the information being deleted from the safe mode activation/inactivation management file1300, each bundle is started in a state designated in the service start order list1000upon the subsequent normal mode start.

FIG. 14is a flowchart for processing upon a safe mode start according to the present embodiment. Note that the processing of step S1401to S1407, step S1409to S1410, and step S1412to S1413is the respectively the same as that of step S1101to S1107, and step S1108to S1111illustrated inFIG. 11of the first embodiment, and therefore explanation thereof will be omitted. In other words, here, the processing of step S1408and step S1411is added newly.

In step S1408, the OSGi extension unit211records the name of the inactivated fragment bundle and “effective” indicating the original state in the safe mode activation/inactivation management file1300.

On the other hand, in step S1411, the OSGi extension unit211records the name of the activated fragment bundle and “invalid” indicating the original state in the safe mode activation/inactivation management file1300.

FIG. 15is a flowchart for processing upon a normal mode start according to the present embodiment.

When the normal mode start processing is started, in step S1501, the OSGi extension unit211reads the safe mode activation/inactivation management file1300, and starts the processing in order from a head line in the list. In step S1502, the OSGi extension unit211obtains the activated/inactivated state of the fragment bundle corresponding to the item1301. In step S1503, the OSGi extension unit211confirms the value of the item1302, and determines whether or not it is “invalid”. In a case where original_status=invalid (YES in step S1503), the processing proceeds to step S1504, and in a case where original_status=effective, (NO in step S1503), the processing proceeds to step S1506.

In step S1504, the OSGi extension unit211confirms whether or not the state of the fragment bundle obtained in step S1502is activated. In a case where a fragment bundle is not activated (NO in step S1504), the processing proceeds to step S1508, and in a case where the fragment bundle is activated (YES in step S1504), the processing proceeds to step S1505. In step S1505, the OSGi extension unit211performs inactivation processing. After that, the processing proceeds to step S1508.

In step S1506, the OSGi extension unit211confirms whether or not the state of the fragment bundle obtained in step S1502is inactivated. In a case where a fragment bundle is not inactivated (NO in step S1506), the processing proceeds to step S1508, and in a case where the fragment bundle is inactivated (YES in step S1506), the processing proceeds to step S1507. In step S1507, the OSGi extension unit211performs activation processing. After that, the processing proceeds to step S1508.

In step S1508, the OSGi extension unit211confirms whether or not it is the final line of the list. In a case where it is not the final line (NO in step S1508), the processing returns to step S1502, and the processing is repeated setting the next line in the safe mode activation/inactivation management file1300as the target of processing. In a case where the processing has completed for all fragment bundles in the safe mode activation/inactivation management file1300(YES in step S1508), the processing proceeds to step S1509.

In step S1509, the OSGi extension unit211deletes the safe mode activation/inactivation management file1300. In step S1510, the OSGi206reads the service start order list1000, and starts the processing in order from a head line in the list. In step S1511, the OSGi206obtains the type of the bundle. In step S1512, the OSGi206confirms whether or not the type of the bundle obtained in step S1511corresponds to a fragment bundle. In a case where it does correspond to a fragment bundle (YES in step S1512) the processing proceeds to step S1514, and in a case where it does not correspond to a fragment bundle (NO in step S1512), the processing proceeds to step S1513. In step S1513, the OSGi206starts the bundle. In step S1514, the OSGi206confirms whether or not it is the final line of the list. In a case where it is not the final line (NO in step S1514), the processing returns to step S1511, and the processing is repeated setting the next line in the service start order list1000as the target of processing. In a case where it is the final line, i.e. in a case where processing has completed for all of the bundles in the service start order list1000(YES in step S1514), the normal mode start up processing terminates.

By virtue of the present embodiment, even when a fragment bundle is inactivated or activated upon the safe mode start, it becomes possible to return to a state prior to the safe mode start when starting in the normal mode thereafter.

Third Embodiment

In the present embodiment, a case in which a fragment bundle that is installed by a user is activated upon the safe mode start is considered. There is a problem in that in a case where in the safe mode start all of the fragment bundles that a user installed are inactivated, even when there is a fragment bundle desired to be activated, it cannot be used, and usability is degraded. For example, in a case where a fragment bundle that localizes a display language of a user interface for a host bundle which is a system app that is started in the safe mode start is inactivated, it can be considered that the operability of the user will be degraded.

FIG. 16is a view for illustrating an example of content of a manifest file1600of an app according to the present embodiment. An item1601is a setting for designating that the state upon the safe mode start is active/inactive for a fragment bundle that the user installed. In the case of activation on is designated, and in the case of inactivation “off” is designated. In a case where the item1601is omitted, it is treated as though “off” were designated. Also, even if the item1601is designated for a system app, if the designation of the item804of the service start order list800is “on”, the designation of the item804is prioritized.

FIG. 17illustrates an example of file configuration of an app, here it illustrates a configuration in a Jar file. A file1701is a manifest file of an app. A file1702is a setting file. A file1703is an image file. A file1704is an HTML (Hyper Text Markup Language) file. A file1705is a script file described in JavaScript (registered trademark). A file1706is a class file including Java (registered trademark) byte code that can be executed on the Java VM203. That is, the class file is a program file including byte code in which processing to be executed is defined. Meanwhile, an image file, or the like, is a resource file used in processing. Note that the file configuration ofFIG. 17is only an example, and so long as the requirements as a JavaArchive file format are satisfied, there is no particular restriction on the configuration of file. Also, in the present embodiment, while the class file is assumed to be the target of the file of a predetermined format, limitation is not made to this.

FIG. 18is a flowchart for processing upon a safe mode start according to the present embodiment.

When the safe mode start processing is started, in step S1801, the OSGi extension unit211reads the service start order list1000, and starts the processing in order from a head line in the list. In step S1802, the OSGi extension unit211obtains the type of the bundle. In step S1803, the OSGi extension unit211confirms whether or not the type of the bundle obtained in step S1802corresponds to a fragment bundle. In a case where it does not correspond to a fragment bundle (NO in step S1803), the processing proceeds to step S1813, and in a case where it does correspond to a fragment bundle (YES in step S1803), the processing proceeds to step S1804.

In step S1804, the OSGi extension unit211confirms whether or not the designation of the item804of the service start order list800is “on”. In a case where safemode=off (NO in step S1804), the processing proceeds to step S1805, and in a case where safemode=on (YES in step S1804), the processing proceeds to step S1811.

In step S1805, the OSGi extension unit211obtains the activated/inactivated state of the fragment bundle. In step S1806, the OSGi extension unit211obtains information of the fragment bundle. More specifically, the item1601of the file1701and information related to whether or not a class file including Java (registered trademark) byte code exists in files1702to1706are obtained. In step S1807, the OSGi extension unit211confirms whether or not the item1601obtained in step S1806is “on”. In a case where safemode=off (NO in step S1807), the processing proceeds to step S1809, and in a case where safemode=on (YES in step S1807), the processing proceeds to step S1808.

In step S1808, the OSGi extension unit211confirms whether or not a class file including Java (registered trademark) byte code exists in a file obtained in step S1806. In a case where it does exist (YES in step S1808), the processing proceeds to step S1809, and in a case where it does not exist (NO in step S1808), the processing proceeds to step S1811. A reason for checking whether or not a class file (file of a predetermined format) exists is to avoid a later described host bundle start failing by a class file having a problem being read by the class loader of the host bundle. That is, in a case where it is comprised of files other than a class file (for example, only resource files), even though the fragment bundle is installed the starting of the host bundle failing can be avoided.

The processing of step S1809to step S1814is the same as step S1106to step S1111ofFIG. 11illustrated in the first embodiment respectively, and so explanation will be omitted.

By virtue of the present embodiment, it becomes possible to prevent a degradation in the convenience of the user upon the safe mode start, by starting the system safely even when a fragment bundle that the user installed is activated.

Fourth Embodiment

In the present embodiment, a case in which there is a problem in a fragment bundle when the fragment bundle that is installed by a user is activated is considered. In the third embodiment, in a case where there exists a class file including Java (registered trademark) byte code that can be executed on a Java VM, it is not activated. However, the user desires activation in a case where a class file including Java (registered trademark) byte code is included, but it is known that there is no influence on the safe mode start. Accordingly, in the present embodiment, a fragment bundle for which a problem does not occur, and a host file thereof are activated. On the other hand, on top of inactivating a fragment bundle for which a problem does occur, control is performed to activate the host bundle thereof.

FIGS. 19A and 19Bare flowcharts for processing upon a safe mode start according to the present embodiment.

Firstly, inFIG. 19A, when the safe mode start processing is started, in step S1901, the OSGi extension unit211reads the service start order list1000, and starts the processing in order from a head line in the list. In step S1902, the OSGi extension unit211obtains the type of the bundle. In step S1903, the OSGi extension unit211confirms whether or not the type of the bundle obtained in step S1902corresponds to a fragment bundle. In a case where it does not correspond to a fragment bundle (NO in step S1903), the processing proceeds to step S1912, and in a case where it does correspond to a fragment bundle (YES in step S1903), the processing proceeds to step S1904.

In step S1904, the OSGi extension unit211obtains the activated/inactivated state of the fragment bundle. In step S1905, the OSGi extension unit211obtains the item1601of the manifest file1600of the fragment bundle. In step S1906, the OSGi extension unit211confirms whether or not the designation of the item804of the service start order list800is “on”. In a case where safemode=off (NO in step S1906), the processing proceeds to step S1907, and in a case where safemode=on (YES in step S1906), the processing proceeds to step S1910.

In step S1907, the OSGi extension unit211confirms whether or not the item1601obtained in step S1905is “off”. In a case where safemode=off (NO in step S1907), the processing proceeds to step S1908, and in a case where safemode=on (YES in step S1907), the processing proceeds to step S1910.

The processing of step S1908to step S1912is the same as step S1106to step S1110ofFIG. 11illustrated in the first embodiment respectively, and so explanation will be omitted. For step S1913, detailed explanation is given usingFIG. 19B.

Firstly, inFIG. 19B, when the host bundle start processing is started, in step S1951, the OSGi extension unit211reads the service start order list800, and starts the processing in order from a head line in the list. Note that the processing of step S1951to step S1955is the same as step S901to step S905ofFIG. 9illustrated in the first embodiment respectively, and so explanation will be omitted.

In step S1956, the OSGi extension unit211confirms whether or not the start of the bundle performed in step S1955succeeded. In a case where it does succeed (YES in step S1956), the processing proceeds to step S1964, and in a case where it fails (NO in step S1956), the processing proceeds to step S1957. In step S1957, the OSGi extension unit211obtains information of a fragment bundle related to the host bundle for which starting failed. In step S1958, the OSGi extension unit211confirms whether or not a fragment bundle exists from the information obtained in step S1957. In a case where one does not exist (NO in step S1958), the processing proceeds to step S1964, and in a case where one does exist (YES in step S1958), the processing proceeds to step S1959.

In step S1959, the OSGi extension unit211obtains a list (not shown) of fragment bundles related to the host bundle for which starting failed, and starts processing from the head line of the list. In step S1960, the OSGi extension unit211obtains the activated/inactivated state of the fragment bundle. In step S1961, the OSGi extension unit211confirms whether or not the state of the fragment bundle obtained in step S1960is activated. In a case where a fragment bundle is not activated (NO in step S1961), the processing proceeds to step S1963, and in a case where the fragment bundle is activated (YES in step S1961), the processing proceeds to step S1962. In step S1962, the OSGi extension unit211performs inactivation processing. After that, the processing proceeds to step S1963.

In step S1963, the OSGi extension unit211confirms whether or not it is the final line of the list. In a case where it is not the final line (NO in step S1963), the processing returns to step S1960, and the processing is repeated making the next line (the next fragment bundle) the target of processing. In a case where it is the final line, i.e. inactivation processing has completed for all of the fragment bundles related to the host bundle for which starting failed (YES in step S1963), the processing proceeds to step S1955. Then, in step S1955, the OSGi extension unit211attempts to start once again the host bundle for which starting failed.

In step S1964, the OSGi206confirms whether or not it is the final line of the service start order list. In a case where it is not the final line (NO in step S1964), the processing returns to step S1952, and the processing is repeated making the next line the target of processing. In a case where it is the final line, i.e. in a case where processing has completed for all of the bundles in the service start order list (YES in step S1964), the processing for starting the host bundle terminates, and the processing returns to the processing ofFIG. 19A.

By the present embodiment, upon the safe mode start, it becomes possible to start the system safely without degrading the convenience of the user even in a case where there is a problem with a fragment bundle that a user installed.

Other Embodiments

This application claims the benefit of Japanese Patent Application No. 2014-248420, filed Dec. 8, 2014, which is hereby incorporated by reference herein in its entirety.