org.softamis.cluster4spring.rmi.support
Class AbstractRmiShortFormProxyFactoryBean<SI extends ServiceMoniker>

java.lang.Object
  extended by org.springframework.remoting.support.RemoteAccessor
      extended by org.softamis.cluster4spring.support.RemoteInvocationBasedAccessor
          extended by org.softamis.cluster4spring.support.RemoteClientInterceptor<RmiEndpoint<SI>,SI>
              extended by org.softamis.cluster4spring.rmi.support.RmiClientInterceptor<SI>
                  extended by org.softamis.cluster4spring.rmi.AbstractRmiProxyFactoryBean<SI>
                      extended by org.softamis.cluster4spring.rmi.support.AbstractRmiShortFormProxyFactoryBean<SI>
Type Parameters:
SI - type of data used to invoke remote service (such as remote service URL)
All Implemented Interfaces:
java.util.EventListener, org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationListener
Direct Known Subclasses:
RmiDiscoveringProxyFactoryBean, RmiSingleUrlProxyFactoryBean, RmiUrlListProxyFactoryBean

public abstract class AbstractRmiShortFormProxyFactoryBean<SI extends ServiceMoniker>
extends AbstractRmiProxyFactoryBean<SI>

Base abstract class to implement RMI proxy factory beans that allows compact form of bean definition in application context. These providers does not accept EndpointProviders set externally during configuration. Instread, they create appropriate EndpointProviders internally. To configure create endpoint providers, such factory beans have additional set of properties needed by endpoint provider.

While factories extended from this class may be considered less flexible comparing to usual combination (RmiProxyFactoryBean/EndpointsProvider), they can be defined in configuration files in more compact form.

Author:
Andrew Sazonov

Field Summary
protected  boolean fCacheEndpoints
          Indicates whether endpoints provider should cache obtained endpoints
 
Fields inherited from class org.softamis.cluster4spring.rmi.AbstractRmiProxyFactoryBean
fBeanFactory, fInterceptorNames, fRegisterTraceInterceptor, fRemoteInvocationTraceInterceptor, fServiceProxy
 
Fields inherited from class org.softamis.cluster4spring.rmi.support.RmiClientInterceptor
PROTOCOL_RMI
 
Fields inherited from class org.softamis.cluster4spring.support.RemoteClientInterceptor
fBeanName, fEndpointFactory, fEndpointProvider, fRefreshEndpointsOnConnectFailure, fRefreshEndpointsOnStartup, fSwitchEndpointOnFailure
 
Fields inherited from class org.softamis.cluster4spring.support.RemoteInvocationBasedAccessor
fRemoteInvocationFactory
 
Fields inherited from class org.springframework.remoting.support.RemoteAccessor
logger
 
Constructor Summary
protected AbstractRmiShortFormProxyFactoryBean()
           
 
Method Summary
 boolean isCacheEndpoints()
          Returns option which specifies that discovered endpoints should cached for later use
 void setCacheEndpoints(boolean aCacheEndpoints)
          Sets option which specifies that discovered endpoints should cached for later use
protected  void setEndpointProvider(EndpointProvider<RmiEndpoint<SI>,SI> aEndpointProvider)
          Sets provider for endpoints used for remote services invocation.
 
Methods inherited from class org.softamis.cluster4spring.rmi.AbstractRmiProxyFactoryBean
addSpecifiedAdvices, afterPropertiesSet, createDefaultRemoteInvocationTraceInterceptor, getEndpointFactory, getInterceptorNames, getObject, getObjectType, getProxyName, getRemoteInvocationTraceInterceptor, isRegisterTraceInterceptor, isSingleton, obtainRemoteInvocationTraceInterceptor, setBeanFactory, setEndpointFactory, setInterceptorNames, setRegisterTraceInterceptor, setRemoteInvocationTraceInterceptor
 
Methods inherited from class org.softamis.cluster4spring.rmi.support.RmiClientInterceptor
convertRmiAccessException, createDefaultEndpointFactory, doInvoke, getProtocol, isConnectFailure, isConnectFailureOnRemoteException, throwRmiAccessException
 
Methods inherited from class org.softamis.cluster4spring.support.RemoteClientInterceptor
doInvoke, doPreprocessApplicationEvent, getBeanName, handleRemoteConnectFailure, invoke, isRefreshEndpointsOnConnectFailure, isRefreshEndpointsOnStartup, isSwitchEndpointOnFailure, markServiceInvalid, obtainEndpointToExecute, onApplicationEvent, onContextClosed, onContextRefreshed, prepare, refreshAndRetry, refreshEndpointProvider, retry, setBeanName, setRefreshEndpointsOnConnectFailure, setRefreshEndpointsOnStartup, setSwitchEndpointOnFailure, throwRemoteLookupFailureException, throwServiceException
 
Methods inherited from class org.softamis.cluster4spring.support.RemoteInvocationBasedAccessor
getRemoteInvocationFactory, setRemoteInvocationFactory
 
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fCacheEndpoints

protected boolean fCacheEndpoints
Indicates whether endpoints provider should cache obtained endpoints

Constructor Detail

AbstractRmiShortFormProxyFactoryBean

protected AbstractRmiShortFormProxyFactoryBean()
Method Detail

setCacheEndpoints

public void setCacheEndpoints(boolean aCacheEndpoints)
Sets option which specifies that discovered endpoints should cached for later use

Parameters:
aCacheEndpoints - true if endpoints should be cached
See Also:
BaseEndpointProvider.setCacheEndpoints(boolean)

isCacheEndpoints

public boolean isCacheEndpoints()
Returns option which specifies that discovered endpoints should cached for later use

Returns:
true if endpoints should be cached

setEndpointProvider

protected void setEndpointProvider(EndpointProvider<RmiEndpoint<SI>,SI> aEndpointProvider)
Sets provider for endpoints used for remote services invocation. Current implementation throws IllegalArgumetException on attempt to specify endpoint provider externally, since it's assumed that factories for more compact declaration will create all providers internally.

Overrides:
setEndpointProvider in class RemoteClientInterceptor<RmiEndpoint<SI extends ServiceMoniker>,SI extends ServiceMoniker>
Parameters:
aEndpointProvider - provider