com.atlassian.seraph.ioc
Class ApplicationServicesRegistry

java.lang.Object
  extended by com.atlassian.seraph.ioc.ApplicationServicesRegistry

public class ApplicationServicesRegistry
extends Object

This class represents an extension point for Seraph. Applications that use Seraph library can register implementations of service interfaces defined by Seraph. To register an implementation host application must call an appropriate setter method eg. setRememberMeService(RememberMeService) Once host application registers a service Seraph will use the registered service. Host application may chose not to register a service, in such case Seraph will use default Noop implementation of it. E.g. if a host application does not set a RememberMeService through setRememberMeService(RememberMeService) Seraph will use a NoopRememberMeService implementation of RememberMeService. If in the future Seraph defines new SPIs and expects host application to provide implementations for them then this class will have to add setters and getters definitions for new interfaces.

Author:
anatoli

Constructor Summary
ApplicationServicesRegistry()
           
 
Method Summary
static RememberMeService getRememberMeService()
          Returns a RememberMeService that was set by an application via setRememberMeService(RememberMeService) or a NoopRememberMeService if application has not set one.
static void setRememberMeService(RememberMeService rememberMeService)
          This method provides the ability for a host application to set an implementation of RememberMeService for Seraph to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationServicesRegistry

public ApplicationServicesRegistry()
Method Detail

setRememberMeService

public static void setRememberMeService(RememberMeService rememberMeService)
This method provides the ability for a host application to set an implementation of RememberMeService for Seraph to use. If host application does not set its implementation of RememberMeService Seraph will use a NoopRememberMeService.

Parameters:
rememberMeService -
Throws:
IllegalArgumentException - if argument is null

getRememberMeService

public static RememberMeService getRememberMeService()
Returns a RememberMeService that was set by an application via setRememberMeService(RememberMeService) or a NoopRememberMeService if application has not set one. Will never return null.

Returns:


Copyright © 2013 Atlassian. All Rights Reserved.