com.mmoui.manager.services
Interface UpdateService

All Superinterfaces:
Service

public interface UpdateService
extends Service

An update service provided to the MMOI Manager via the OSGi framework. This is the main interface through which modules provide update services to the MMOI Manager application.

Version:
$Id: UpdateService.java 213 2009-05-13 01:25:37Z mpdelbuono $
Author:
Matthew P. Del Buono

Method Summary
 UpdateElement[] enumerateItems()
          Generates a list of UpdateElement items to be displayed in the main window and then updated as needed.
 java.lang.String getBundleName()
          Obtains the bundle's name.
 void initialize(UpdateController controller)
          Requests that the UpdateService initialize itself.
 boolean isSearchAvailable()
          Called whenever this service becomes the active tab to determine whether or not this module supports searching.
 void search(java.lang.String searchString, java.awt.Frame parent)
          Called whenever the user types a search phrase into the search box and presses "enter." This is always called from the Swing thread, so the module must be certain to either process this event quickly or pass off to another thread for processing.
 
Methods inherited from interface com.mmoui.manager.services.Service
getAdvertisements, getFullProviderName, getPermissions, getShortProviderName
 

Method Detail

initialize

void initialize(UpdateController controller)

Requests that the UpdateService initialize itself. This is called by the manager framework instead of the OSGi framework (which called start() on the BundleActivator object at some point before this call). The service should expect configuration data to be available soon after this call if a ConfigurationService is also provided by the module. Note that this is only called once the bundle has been verified as valid, so a call to initialize() is where service initialization should be done, as this verifies that the module will not be immediately shut down.

Parameters:
controller - The UpdateController through which the module can feed information back to the core. Use of this parameter is not necessary if not desired, however it provides a standard means through which users can supply log files for bug reports if necessary as well as supply additional control information.
See Also:
ConfigurationService, UpdateController

enumerateItems

UpdateElement[] enumerateItems()
Generates a list of UpdateElement items to be displayed in the main window and then updated as needed. Querying the list should not begin the update process - it should only generate a list of items that could be updated at a future point in time at the request of the manager.

Returns:
The list of updatable components (which may or may not be a combination of different types of UpdateElements) provided by this service

getBundleName

java.lang.String getBundleName()

Obtains the bundle's name. This is to provide a level of abstraction at the manager level. The return value of this method should ALWAYS be equal to the value specified by the Bundle-Name element of the bundle's manifest.

This method must be callable before initialize()

Returns:
The name of this bundle

isSearchAvailable

boolean isSearchAvailable()
Called whenever this service becomes the active tab to determine whether or not this module supports searching. If it does not, the UI Manager takes appropriate actions to ensure that search() is never called and that the user cannot interact with the search box.

Returns:
true if this service supports searching, or false if the UI should block the user from trying to search
Since:
1.0.2
See Also:
search(java.lang.String, java.awt.Frame)

search

void search(java.lang.String searchString,
            java.awt.Frame parent)
Called whenever the user types a search phrase into the search box and presses "enter." This is always called from the Swing thread, so the module must be certain to either process this event quickly or pass off to another thread for processing. The UI cannot continue to update until this method has returned.

Parameters:
searchString - the string the user has entered, with any leading or trailing whitespace removed
parent - the main UI frame which can be used for parenting of any new dialogs to display. This frame should be controlled in no other way than being used as a reference to parent. If the module does not create any new dialogs, this parameter should be discarded.
Since:
1.0.2