|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.application.support.DefaultApplicationServices
public class DefaultApplicationServices
A default implementation of the ApplicationServices (service locator) interface. This implementation allows for the
direct registration of service implementations by using various setter methods (like
setImageSource(ImageSource)
). Service registry entries can also be added in bulk using the
setRegistryEntries(Map)
method.
Except in testing environments, this class will typically be instantiated in the application context and the various service implementations will be set BY ID. The use of service bean ids instead of direct bean references is to avoid numerous problems with cyclic dependencies and other order dependent operations. So, a typical incarnation might look like this:
<bean id="applicationServices" class="org.springframework.richclient.application.support.DefaultApplicationServices"> <property name="applicationObjectConfigurerId"><idref bean="applicationObjectConfigurer" /></property> <property name="imageSourceId"><idref bean="imageSource"/></property> <property name="rulesSourceId"><idref bean="rulesSource"/></property> <property name="conversionServiceId"><idref bean="conversionService"/></property> <property name="formComponentInterceptorFactoryId"><idref bean="formComponentInterceptorFactory"/></property> </bean>Note the use of the
idref
form instead of just using a string value. This is the preferred syntax in
order to avoid having misspelled bean names go unreported.
Which service implementation is returned by getService(Class)
will be determined through the following
steps:
org.springframework.richclient.factory.MenuFactory
the bean name
menuFactory
will be used to find the bean
Nested Class Summary | |
---|---|
protected static interface |
DefaultApplicationServices.ImplBuilder
Internal interface used to provide default implementation builders. |
Constructor Summary | |
---|---|
DefaultApplicationServices()
Default Constructor. |
|
DefaultApplicationServices(ApplicationContext applicationContext)
Constuct using the given application context. |
Method Summary | |
---|---|
protected boolean |
containsDefaultImplementation(Class serviceType)
Tests if a default implementation for the requested service type is available |
boolean |
containsService(Class serviceType)
Determine if a service of the requested type is available. |
protected boolean |
containsServiceForClassType(Class serviceType)
Tests if the application context contains a bean definition by using the decapitalized shortname of the serviceType class name |
ApplicationContext |
getApplicationContext()
|
protected Object |
getDefaultImplementation(Class serviceType)
Get the default implementation of a service according to the service type. |
Object |
getService(Class serviceType)
Get a service of the indicated type. |
protected Object |
getServiceForClassType(Class serviceType)
Get the implementation of a service by using the decapitalized shortname of the serviceType class name. |
void |
setApplicationContext(ApplicationContext applicationContext)
Set the application context. |
void |
setApplicationObjectConfigurer(ApplicationObjectConfigurer applicationObjectConfigurer)
Set the application object configurer service implementation. |
void |
setApplicationObjectConfigurerId(String applicationObjectConfigurerId)
Set the application object configurer service implementation bean id |
void |
setApplicationPageFactory(ApplicationPageFactory factory)
Set the ApplicationPage factory service implementation |
void |
setApplicationPageFactoryId(String factoryId)
Set the ApplicationPage factory service implementation bean id |
void |
setApplicationSecurityManager(ApplicationSecurityManager applicationSecurityManager)
Set the application security manager service implementation. |
void |
setApplicationSecurityManagerId(String applicationSecurityManagerId)
Set the application security manager service implementation bean id |
void |
setApplicationWindowFactory(ApplicationWindowFactory factory)
Set the ApplicationWindow factory service implementation |
void |
setApplicationWindowFactoryId(String factoryId)
Set the ApplicationWindow factory service implementation bean id |
void |
setBinderSelectionStrategy(BinderSelectionStrategy binderSelectionStrategy)
Set the binder selection strategy service implementation |
void |
setBinderSelectionStrategyId(String binderSelectionStrategyId)
Set the binder selection strategy service implementation bean id |
void |
setBindingFactoryProvider(BindingFactoryProvider bindingFactoryProvider)
Set the binding factory provider service implementation |
void |
setBindingFactoryProviderId(String bindingFactoryProviderId)
Set the binding factory provider service implementation bean id |
void |
setButtonFactory(ButtonFactory buttonFactory)
Set the button factory service implementation |
void |
setButtonFactoryId(String buttonFactoryId)
Set the button factory service implementation bean id |
void |
setCommandConfigurer(CommandConfigurer commandConfigurer)
Set the command configurer service implementation |
void |
setCommandConfigurerId(String commandConfigurerId)
Set the command configurer service implementation bean id |
void |
setCommandServices(CommandServices commandServices)
Set the command services service implementation |
void |
setCommandServicesId(String commandServicesId)
Set the command services service implementation bean id |
void |
setComponentFactory(ComponentFactory componentFactory)
Set the component factory service implementation |
void |
setComponentFactoryId(String componentFactoryId)
Set the component factory service implementation bean id |
void |
setConversionService(org.springframework.binding.convert.ConversionService conversionService)
Set the conversion service service implementation |
void |
setConversionServiceId(String conversionServiceId)
Set the conversion service service implementation bean id |
void |
setFieldFaceSource(FieldFaceSource fieldFaceSource)
Set the field face descriptor source service implementation |
void |
setFieldFaceSourceId(String fieldFaceSourceId)
Set the field face descriptor source service implementation bean id |
void |
setFormComponentInterceptorFactory(FormComponentInterceptorFactory formComponentInterceptorFactory)
Set the form component interceptor factory service implementation |
void |
setFormComponentInterceptorFactoryId(String formComponentInterceptorFactoryId)
Set the form component interceptor factory service implementation bean id |
void |
setIconSource(IconSource iconSource)
Set the icon source service implementation |
void |
setIconSourceId(String iconSourceId)
Set the icon source service implementation bean id |
void |
setImageSource(ImageSource imageSource)
Set the image source service implementation |
void |
setImageSourceId(String imageSourceId)
Set the image source service implementation bean id |
void |
setLabeledEnumResolver(LabeledEnumResolver labeledEnumResolver)
Set the labeled enum resolver service implementation |
void |
setLabeledEnumResolverId(String labeledEnumResolverId)
Set the labeled enum resolver service implementation bean id |
void |
setMenuFactory(MenuFactory menuFactory)
Set the menu factory service implementation |
void |
setMenuFactoryId(String menuFactoryId)
Set the menu factory service implementation bean id |
void |
setMessageSource(MessageSource messageSource)
Set the message source service implementation |
void |
setMessageSourceAccesor(MessageSourceAccessor messageSourceAccessor)
Set the message source accessor service implementation |
void |
setMessageSourceAccesorId(String messageSourceAccessorId)
Set the message source accessor service implementation bean id |
void |
setMessageSourceId(String messageSourceId)
Set the message source service implementation bean id |
void |
setMessageTranslatorFactory(MessageTranslatorFactory messageTranslatorFactory)
Set the message translator registry service implementation |
void |
setMessageTranslatorFactoryId(String messageTranslatorFactoryId)
Set the message translator registry service implementation bean id |
void |
setPageComponentPaneFactory(PageComponentPaneFactory factory)
Set the PageComponentPane factory service implementation bean |
void |
setPageComponentPaneFactoryId(String factoryId)
Set the PageComponentPane factory service implementation bean id |
void |
setPageDescriptorRegistry(PageDescriptorRegistry pageDescriptorRegistry)
Set the page descriptor registry service implementation |
void |
setPageDescriptorRegistryId(String pageDescriptorRegistryId)
Set the page descriptor registry service implementation bean id |
void |
setRegistryEntries(Map entryMap)
Add entries to the service registry. |
void |
setRulesSource(RulesSource rulesSource)
Set the rules source service implementation |
void |
setRulesSourceId(String rulesSourceId)
Set the rules source service implementation bean id |
void |
setSecurityControllerManager(SecurityControllerManager securityControllerManager)
Set the security controller manager service implementation |
void |
setSecurityControllerManagerId(String securityControllerManagerId)
Set the security controller manager service implementation bean id |
void |
setValueChangeDetector(ValueChangeDetector valueChangeDetector)
Set the value change detector service imlpementation. |
void |
setValueChangeDetectorId(String valueChangeDetectorId)
Set the value change detector service imlpementation bean id |
void |
setViewDescriptorRegistry(ViewDescriptorRegistry viewDescriptorRegistry)
Set the view descriptor registry service implementation |
void |
setViewDescriptorRegistryId(String viewDescriptorRegistryId)
Set the view descriptor registry service implementation bean id |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final DefaultApplicationServices.ImplBuilder applicationContextImplBuilder
protected static final DefaultApplicationServices.ImplBuilder menuFactoryImplBuilder
protected static final DefaultApplicationServices.ImplBuilder buttonFactoryImplBuilder
protected static final DefaultApplicationServices.ImplBuilder commandServicesImplBuilder
protected static final DefaultApplicationServices.ImplBuilder componentFactoryImplBuilder
protected static final DefaultApplicationServices.ImplBuilder formComponentInterceptorFactoryImplBuilder
protected static final DefaultApplicationServices.ImplBuilder applicationObjectConfigurerImplBuilder
protected static final DefaultApplicationServices.ImplBuilder commandConfigurerImplBuilder
protected static final DefaultApplicationServices.ImplBuilder imageSourceImplBuilder
protected static final DefaultApplicationServices.ImplBuilder iconSourceImplBuilder
protected static final DefaultApplicationServices.ImplBuilder rulesSourceImplBuilder
protected static final DefaultApplicationServices.ImplBuilder conversionServiceImplBuilder
protected static final DefaultApplicationServices.ImplBuilder binderSelectionStrategyImplBuilder
protected static final DefaultApplicationServices.ImplBuilder FieldFaceSourceImplBuilder
protected static final DefaultApplicationServices.ImplBuilder bindingFactoryProviderImplBuilder
protected static final DefaultApplicationServices.ImplBuilder valueChangeDetectorImplBuilder
protected static final DefaultApplicationServices.ImplBuilder applicationSecurityManagerImplBuilder
protected static final DefaultApplicationServices.ImplBuilder SecurityControllerManagerImplBuilder
protected static final DefaultApplicationServices.ImplBuilder viewDescriptorRegistryImplBuilder
protected static final DefaultApplicationServices.ImplBuilder pageDescriptorRegistryImplBuilder
protected static final DefaultApplicationServices.ImplBuilder messageTranslatorFactoryImplBuilder
protected static final DefaultApplicationServices.ImplBuilder labeledEnumResolverImplBuilder
protected static final DefaultApplicationServices.ImplBuilder messageSourceImplBuilder
protected static final DefaultApplicationServices.ImplBuilder messageSourceAccessorImplBuilder
protected static final DefaultApplicationServices.ImplBuilder applicationWindowFactoryImplBuilder
protected static final DefaultApplicationServices.ImplBuilder applicationPageFactoryImplBuilder
protected static final DefaultApplicationServices.ImplBuilder pageComponentPaneFactoryImplBuilder
Constructor Detail |
---|
public DefaultApplicationServices()
public DefaultApplicationServices(ApplicationContext applicationContext)
applicationContext
- to use for locating named services (beans)Method Detail |
---|
public void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext
in interface ApplicationContextAware
public ApplicationContext getApplicationContext()
public Object getService(Class serviceType)
getService
in interface ApplicationServices
serviceType
- Type of service being requested
ServiceNotFoundException
- if the service is not found and no suitable
default implementation is available.public boolean containsService(Class serviceType)
ApplicationServices
containsService
in interface ApplicationServices
serviceType
- Type of service to locate
public void setRegistryEntries(Map entryMap)
entryMap
- Map of entriespublic void setApplicationObjectConfigurer(ApplicationObjectConfigurer applicationObjectConfigurer)
applicationObjectConfigurer
- public void setApplicationObjectConfigurerId(String applicationObjectConfigurerId)
applicationObjectConfigurerId
- bean idpublic void setApplicationSecurityManager(ApplicationSecurityManager applicationSecurityManager)
applicationSecurityManager
- instance to usepublic void setApplicationSecurityManagerId(String applicationSecurityManagerId)
applicationSecurityManagerId
- bean idpublic void setApplicationWindowFactory(ApplicationWindowFactory factory)
ApplicationWindow
factory service implementation
factory
- public void setApplicationWindowFactoryId(String factoryId)
ApplicationWindow
factory service implementation bean id
factoryId
- bean idpublic void setApplicationPageFactory(ApplicationPageFactory factory)
ApplicationPage
factory service implementation
factory
- public void setApplicationPageFactoryId(String factoryId)
ApplicationPage
factory service implementation bean id
factoryId
- bean idpublic void setPageComponentPaneFactory(PageComponentPaneFactory factory)
PageComponentPane
factory service implementation bean
factory
- bean idpublic void setPageComponentPaneFactoryId(String factoryId)
PageComponentPane
factory service implementation bean id
factoryId
- bean idpublic void setBinderSelectionStrategy(BinderSelectionStrategy binderSelectionStrategy)
binderSelectionStrategy
- public void setBinderSelectionStrategyId(String binderSelectionStrategyId)
binderSelectionStrategyId
- bean idpublic void setBindingFactoryProvider(BindingFactoryProvider bindingFactoryProvider)
bindingFactoryProvider
- public void setBindingFactoryProviderId(String bindingFactoryProviderId)
bindingFactoryProviderId
- bean idpublic void setCommandServices(CommandServices commandServices)
commandServices
- public void setCommandServicesId(String commandServicesId)
commandServicesId
- bean idpublic void setCommandConfigurer(CommandConfigurer commandConfigurer)
commandConfigurer
- public void setCommandConfigurerId(String commandConfigurerId)
commandConfigurerId
- bean idpublic void setButtonFactory(ButtonFactory buttonFactory)
buttonFactory
- public void setButtonFactoryId(String buttonFactoryId)
buttonFactoryId
- bean idpublic void setMenuFactory(MenuFactory menuFactory)
menuFactory
- public void setMenuFactoryId(String menuFactoryId)
menuFactoryId
- bean idpublic void setComponentFactory(ComponentFactory componentFactory)
componentFactory
- public void setComponentFactoryId(String componentFactoryId)
componentFactoryId
- bean idpublic void setConversionService(org.springframework.binding.convert.ConversionService conversionService)
conversionService
- public void setConversionServiceId(String conversionServiceId)
conversionServiceId
- bean idpublic void setFormComponentInterceptorFactory(FormComponentInterceptorFactory formComponentInterceptorFactory)
formComponentInterceptorFactory
- public void setFormComponentInterceptorFactoryId(String formComponentInterceptorFactoryId)
formComponentInterceptorFactoryId
- bean idpublic void setFieldFaceSource(FieldFaceSource fieldFaceSource)
fieldFaceSource
- public void setFieldFaceSourceId(String fieldFaceSourceId)
fieldFaceSourceId
- bean idpublic void setIconSource(IconSource iconSource)
iconSource
- public void setIconSourceId(String iconSourceId)
iconSourceId
- bean idpublic void setImageSource(ImageSource imageSource)
imageSource
- public void setImageSourceId(String imageSourceId)
imageSourceId
- bean idpublic void setLabeledEnumResolver(LabeledEnumResolver labeledEnumResolver)
labeledEnumResolver
- public void setLabeledEnumResolverId(String labeledEnumResolverId)
labeledEnumResolverId
- bean idpublic void setMessageSource(MessageSource messageSource)
messageSource
- public void setMessageSourceId(String messageSourceId)
messageSourceId
- bean idpublic void setMessageSourceAccesor(MessageSourceAccessor messageSourceAccessor)
messageSourceAccessor
- public void setMessageSourceAccesorId(String messageSourceAccessorId)
messageSourceAccessorId
- bean idpublic void setRulesSource(RulesSource rulesSource)
rulesSource
- public void setRulesSourceId(String rulesSourceId)
rulesSourceId
- bean idpublic void setSecurityControllerManager(SecurityControllerManager securityControllerManager)
securityControllerManager
- instance to usepublic void setSecurityControllerManagerId(String securityControllerManagerId)
securityControllerManagerId
- bean idpublic void setValueChangeDetector(ValueChangeDetector valueChangeDetector)
valueChangeDetector
- instance to usepublic void setValueChangeDetectorId(String valueChangeDetectorId)
valueChangeDetectorId
- bean idpublic void setViewDescriptorRegistry(ViewDescriptorRegistry viewDescriptorRegistry)
viewDescriptorRegistry
- public void setPageDescriptorRegistry(PageDescriptorRegistry pageDescriptorRegistry)
pageDescriptorRegistry
- public void setMessageTranslatorFactory(MessageTranslatorFactory messageTranslatorFactory)
messageTranslatorFactory
- public void setMessageTranslatorFactoryId(String messageTranslatorFactoryId)
messageTranslatorFactory
- public void setViewDescriptorRegistryId(String viewDescriptorRegistryId)
viewDescriptorRegistryId
- bean idpublic void setPageDescriptorRegistryId(String pageDescriptorRegistryId)
pageDescriptorRegistryId
- bean idprotected Object getServiceForClassType(Class serviceType)
serviceType
- the service class to lookup the bean definition
ClassUtils.getShortNameAsProperty(Class)
protected Object getDefaultImplementation(Class serviceType)
serviceType
- Type of service requested
protected boolean containsServiceForClassType(Class serviceType)
serviceType
- the service class to lookup the bean definition
ClassUtils.getShortNameAsProperty(Class)
protected boolean containsDefaultImplementation(Class serviceType)
serviceType
- the requested service type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |