|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackboard.platform.BbServiceManager
public class BbServiceManager
Central manager and broker for platform services. This object is responsible for initialization of all other services, and is used by all Blackboard and third party code to locate service instances.
Currently defined services:
For brokering, all services are registered via a Class
"key"
that corresponds to their service interface. In addition, only the base
service interface is returned, so a cast is required. Thus, requests for a
service instance typically follow the idiom
LogService log = (LogService)BbServiceManager.lookupService( LogManager.class )
.
For several services, however, there are well-defined, strongly typed
accessors. E.g., getSessionManagerService()
.
Constructor Summary | |
---|---|
BbServiceManager()
|
Method Summary | |
---|---|
static BundleManager |
getBundleManager()
Convenience wrapper to return BundleManager . |
static ConfigurationService |
getConfigurationService()
Convenience wrapper to return ConfigurationService . |
static ContextManager |
getContextManager()
Convenience wrapper to return ContextManager . |
static DataValidationService |
getDataValidationService()
Deprecated. DataValidationService implementation is incomplete
and unstable at this time. |
static FileSystemService |
getFileSystemService()
Convenience wrapper to return FileSystemService . |
java.lang.Throwable |
getInitFailReason()
Returns the exception that was thrown on startup, causing the service manager to abort initialization. |
static JdbcService |
getJdbcService()
Convenience wrapper to return JdbcService . |
static LicenseManager |
getLicenseManager()
Method to access the LicenseManager . |
static LocaleManager |
getLocaleManager()
Convenience wrapper to return LocaleManager . |
static LogService |
getLogService()
Convenience wrapper to return LogService . |
static PersistenceService |
getPersistenceService()
Convenience wrapper to return PersistenceService . |
static PlugInManager |
getPluginManager()
Convenience wrapper to return PlugInManager . |
static BbSessionManagerService |
getSessionManagerService()
Convenience wrapper to return BbSessionManagerService . |
static VirtualInstallationManager |
getVirtualInstallationManager()
Convenience wrapper to return VirtualInstallationManager . |
static void |
init(java.io.File blackboardRootDir,
java.util.Properties config)
Init method that does not depend on file system structure. |
static void |
init(java.io.File blackboardRootDir,
java.util.Properties config,
boolean validateReleaseLevel)
|
static void |
init(java.lang.String serviceConfigFilePath)
Standard init method that should be called by bootstrap mechanism. |
static void |
init(java.lang.String serviceConfigFilePath,
boolean validateReleaseLevel)
|
static void |
init(java.lang.String serviceConfigFilePath,
java.util.Properties config)
Standard init method that overloads default properties for configuration service. |
static void |
init(java.lang.String serviceConfigFilePath,
java.util.Properties config,
boolean validateReleaseLevel)
|
static void |
initFromSystemProps()
Called internally to bootstrap service manager from the "bbservices_config" system property if services are accessed without being pre-initialized by a standard bootstrap class. |
static boolean |
isServiceInitialized(java.lang.String serviceName)
|
static CorePlatformService |
lookupService(java.lang.Class serviceInterface)
Principal brokering method for use by third party programmers; takes the service interface and locates the correct service implementation. |
static CorePlatformService |
lookupService(java.lang.String serviceInterfaceName)
Actual broker method for service lookups. |
static void |
registerService(java.lang.Class serviceInterface,
java.lang.Class implClass)
Registers service, binding it to the specified service name. |
static void |
registerService(java.lang.Class serviceInterface,
java.lang.Object implementationInstance)
Not implemented. |
static void |
registerService(java.lang.String serviceInterfaceName,
java.lang.String implClassName)
Registers service, binding it to the specified service name. |
static CorePlatformService |
safeLookupService(java.lang.Class serviceInterface)
This method is functional identical to lookupService( Class ) , but throws runtime exceptions instead of
checked exceptions. |
static void |
shutdown()
Initiates a graceful shutdown of all services. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BbServiceManager()
Method Detail |
---|
public static boolean isServiceInitialized(java.lang.String serviceName)
public static void initFromSystemProps() throws InitializationException
InitializationException
public static void init(java.lang.String serviceConfigFilePath) throws InitializationException
InitializationException
public static void init(java.lang.String serviceConfigFilePath, boolean validateReleaseLevel) throws InitializationException
InitializationException
public static void init(java.lang.String serviceConfigFilePath, java.util.Properties config) throws InitializationException
InitializationException
public static void init(java.lang.String serviceConfigFilePath, java.util.Properties config, boolean validateReleaseLevel) throws InitializationException
InitializationException
public static void init(java.io.File blackboardRootDir, java.util.Properties config) throws InitializationException
InitializationException
public static void init(java.io.File blackboardRootDir, java.util.Properties config, boolean validateReleaseLevel) throws InitializationException
InitializationException
public java.lang.Throwable getInitFailReason()
public static CorePlatformService lookupService(java.lang.Class serviceInterface) throws BbServiceException, InitializationException
serviceInterface
- Class representing the interface to find.
lookupService( String )
BbServiceException
- Thrown if a service corresponding to the
requested service interface cannot be found.
InitializationException
- Thrown if the system has not fully
initialized for any reason.public static CorePlatformService lookupService(java.lang.String serviceInterfaceName) throws BbServiceException, InitializationException
serviceInterfaceName
- Name of the service interface to look up
CorePlatformService
instance if service is found. Result must be cast to service desired.
BbServiceException
- Thrown if the requested service cannot be found
InitializationException
- Thrown if the system has failed to initialize for any reason.public static void registerService(java.lang.String serviceInterfaceName, java.lang.String implClassName) throws BbServiceException, InitializationException
serviceInterfaceName
- Name to bind the service as. Typically the fully qualified class name is used.implClassName
- Class name that implements the service.
BbServiceException
InitializationException
public static void registerService(java.lang.Class serviceInterface, java.lang.Class implClass) throws BbServiceException, InitializationException
serviceInterface
- Class that wraps the service interfaceimplClass
- Class that implements the service interface.
BbServiceException
InitializationException
public static void registerService(java.lang.Class serviceInterface, java.lang.Object implementationInstance) throws BbServiceException, InitializationException
BbServiceException
InitializationException
public static LicenseManager getLicenseManager()
LicenseManager
. Note that the LicenseManager
is not
brokered via the standard mechanism, but is always initialized and available. Thus, calls to
lookupService( LicenseManager.class )
will fail.
LicenseManager
public static ConfigurationService getConfigurationService() throws RuntimeBbServiceException
ConfigurationService
. Delegates to
safeLookupService( ConfigurationService.class )
ConfigurationService
RuntimeBbServiceException
public static BbSessionManagerService getSessionManagerService() throws RuntimeBbServiceException
BbSessionManagerService
. Delegates to
safeLookupService( BbSessionManagerService.class )
BbSessionManagerService
RuntimeBbServiceException
public static JdbcService getJdbcService() throws RuntimeBbServiceException
JdbcService
. Delegates to
safeLookupService( JdbcService.class )
JdbcService
RuntimeBbServiceException
public static PersistenceService getPersistenceService() throws RuntimeBbServiceException
PersistenceService
. Delegates to
safeLookupService( PersistenceService.class )
PersistenceService
RuntimeBbServiceException
public static LogService getLogService() throws RuntimeBbServiceException
LogService
. Delegates to
safeLookupService( LogService.class )
LogService
RuntimeBbServiceException
public static LocaleManager getLocaleManager() throws RuntimeBbServiceException
LocaleManager
. Delegates to
safeLookupService( LocaleManager.class )
LocaleManager
RuntimeBbServiceException
public static BundleManager getBundleManager() throws RuntimeBbServiceException
BundleManager
. Delegates to
safeLookupService( BundleManager.class )
BundleManager
RuntimeBbServiceException
public static PlugInManager getPluginManager() throws RuntimeBbServiceException
PlugInManager
. Delegates to
safeLookupService( PlugInManager )
PlugInManager
RuntimeBbServiceException
public static FileSystemService getFileSystemService() throws RuntimeBbServiceException
FileSystemService
. Delegates to
safeLookupService( FileSystemService )
FileSystemService
RuntimeBbServiceException
public static ContextManager getContextManager() throws RuntimeBbServiceException
ContextManager
. Delegates to
safeLookupService( ContextManager )
ContextManager
RuntimeBbServiceException
public static DataValidationService getDataValidationService() throws RuntimeBbServiceException
DataValidationService
implementation is incomplete
and unstable at this time.
DataValidationService
. Delegates to
safeLookupService( DataValidationService.class )
DataValidationService
RuntimeBbServiceException
public static VirtualInstallationManager getVirtualInstallationManager()
VirtualInstallationManager
.
Delegates to
safeLookupService( VirtualInstallationManager.class )
VirtualInstallationManager
public static void shutdown()
public static CorePlatformService safeLookupService(java.lang.Class serviceInterface) throws RuntimeBbServiceException
lookupService( Class )
, but throws runtime exceptions instead of
checked exceptions.
serviceInterface
- Service to lookup
RuntimeBbServiceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |