com.mmoui.manager.services
Interface Service

All Known Subinterfaces:
ConfigurationService, ExtractorFactoryService, NewsService, UpdateService

public interface Service

Defines a generic OSGi service for the MMOUI Manager. All types of providable services must be based on this interface. Modules should not implement the Service interface directly, but should rather implement one of its derived classes, such as UpdateService or NewsService.

Version:
$Id: Service.java 206 2009-05-12 07:07:27Z mpdelbuono $
Author:
Matthew P. Del Buono
See Also:
UpdateService, NewsService

Method Summary
 java.net.URL[] getAdvertisements()
          Gets a listing of URL objects which point to locations at which an advertisement can be obtained to display to the user.
 java.lang.String getFullProviderName()
          Gets the full name of this news service's provider.
 PermissionsManager getPermissions()
          Gets a PermissionsManager object which specifies the permissions that this Service requests.
 java.lang.String getShortProviderName()
          Gets the name of the provider of this news service as it should be displayed on the service's tab.
 

Method Detail

getShortProviderName

java.lang.String getShortProviderName()
Gets the name of the provider of this news service as it should be displayed on the service's tab. This name should be short and concise so as to ensure the tab size is not too large.

Returns:
the short name of this service provider

getFullProviderName

java.lang.String getFullProviderName()
Gets the full name of this news service's provider. This should be the full name as the provider wishes to be known, and will be displayed whenever the provider's tab is selected. This is generally a good place to identify a website where the user can go to obtain more information about any news that might have been found.

Returns:
the full name of this service provider

getAdvertisements

java.net.URL[] getAdvertisements()

Gets a listing of URL objects which point to locations at which an advertisement can be obtained to display to the user. The advertisement must be a 300x250 pixel HTML webpage and may contain any components typically accessed within a web browser (including Java applets or Flash).

Advertisements will be selected randomly from the currently displayed modules. Each advertisement has an equal chance of receiving display time. Module advertisements will be held in a rotation; a new advertisement will be selected periodically, so this method must be able to be called repeatedly. If desired, modules may change the list in between requests.

If no currently displayed modules wish to show an advertisement, then the advertisement box will be hidden from the user, extending the news panel horizontally.

Returns:
the list of URLs to advertisements which can be selected to display, or null if no advertisements are desired for this module

getPermissions

PermissionsManager getPermissions()

Gets a PermissionsManager object which specifies the permissions that this Service requests. This method is called every time the module violates its current permissions to get an updated list of requested permissions. The returned PermissionsManager object will be used to determine if the access should be granted.

While returns from this method are optional, as modules do not need to request permissions if not desired, it should be noted that returning null from this method will always result in a SecurityException being thrown by the SecurityManager because this method is only called when an access violation has already occurred.

Returns:
the PermissionsManager object specifying the current access requests, or null if this module has no PermissionsManager object through which it wishes to request permissions
Since:
1.0.4
See Also:
PermissionsManager