Class RemotingSupport
- java.lang.Object
- org.springframework.remoting.support.RemotingSupport
- All Implemented Interfaces:
Aware,BeanClassLoaderAware
- Direct Known Subclasses:
RemoteAccessor,RemoteExporter
public abstract class RemotingSupport extends Object implements BeanClassLoaderAware
Generic support base class for remote accessor and exporters, providing common bean ClassLoader handling.- Since:
- 2.5.2
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description RemotingSupport()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClassLoadergetBeanClassLoader()Return the ClassLoader that this accessor operates in, to be used for deserializing and for generating proxies.protected ClassLoaderoverrideThreadContextClassLoader()Override the thread context ClassLoader with the environment's bean ClassLoader if necessary, i.e.protected voidresetThreadContextClassLoader(ClassLoader original)Reset the original thread context ClassLoader if necessary.voidsetBeanClassLoader(ClassLoader classLoader)Callback that supplies the beanclass loaderto a bean instance.
Constructor Detail
RemotingSupport
public RemotingSupport()
Method Detail
setBeanClassLoader
public void setBeanClassLoader(ClassLoader classLoader)
Description copied from interface:BeanClassLoaderAwareCallback that supplies the beanclass loaderto a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as
InitializingBean'sInitializingBean.afterPropertiesSet()method or a custom init-method.- Specified by:
setBeanClassLoaderin interfaceBeanClassLoaderAware- Parameters:
classLoader- the owning class loader; may benullin which case a defaultClassLoadermust be used, for example theClassLoaderobtained viaClassUtils.getDefaultClassLoader()
getBeanClassLoader
protected ClassLoader getBeanClassLoader()
Return the ClassLoader that this accessor operates in, to be used for deserializing and for generating proxies.
overrideThreadContextClassLoader
protected ClassLoader overrideThreadContextClassLoader()
Override the thread context ClassLoader with the environment's bean ClassLoader if necessary, i.e. if the bean ClassLoader is not equivalent to the thread context ClassLoader already.- Returns:
- the original thread context ClassLoader, or
nullif not overridden
resetThreadContextClassLoader
protected void resetThreadContextClassLoader(ClassLoader original)
Reset the original thread context ClassLoader if necessary.- Parameters:
original- the original thread context ClassLoader, ornullif not overridden (and hence nothing to reset)