Class LazyServiceFactoryBean
java.lang.Object
org.kuali.rice.ksb.api.bus.support.LazyServiceFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<Object>,org.springframework.beans.factory.InitializingBean
public class LazyServiceFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<Object>, org.springframework.beans.factory.InitializingBean
Loads a lazy proxy to a service from the
ServiceBus. This proxy is created based on either the
proxy interfaces that are injected into this bean, or derived from the objectType which is injected into this bean.
If neither of these are injected, then an exception will be through during bean initialization.
The attempt to fetch the resource from the ServiceBus won't be attempted until a method on the resulting
proxy is invoked. If it fails to locate the resource, it will throw a ResourceLoaderException indicating the service
could not be loaded.
This allows for referencing of a potentially remote service in the spring context during startup which won't get used until after startup. If the remote service gets used *during* startup, then it must be available from the GRL during startup or else the ResourceLoaderException will be thrown.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected Class<?>[]Class<?>Class<?>[]booleanvoidsetApplicationId(String applicationId) voidsetObjectType(Class<?> objectType) voidsetProxyInterfaces(Class<?>[] proxyInterfaces) voidsetServiceName(String serviceName) voidsetServiceNamespace(String serviceNamespace)
-
Constructor Details
-
LazyServiceFactoryBean
public LazyServiceFactoryBean()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
detectProxyInterfaces
-
getObject
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<Object>
-
setObjectType
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<Object>
-
getServiceNamespace
-
setServiceNamespace
-
getServiceName
-
setServiceName
-
getApplicationId
-
setApplicationId
-
getProxyInterfaces
-
setProxyInterfaces
-