ch.elca.el4j.services.remoting.protocol.loadbalancing.protocol
Class LoadBalancingProtocol

java.lang.Object
  extended by ch.elca.el4j.services.remoting.AbstractRemotingProtocol
      extended by ch.elca.el4j.services.remoting.protocol.loadbalancing.protocol.LoadBalancingProtocol
All Implemented Interfaces:
DisposableBean, InitializingBean, ApplicationContextAware

public class LoadBalancingProtocol
extends AbstractRemotingProtocol

This class implements a load balancer on the protocol level. It composes multiple protocols and selects a particular protocol instance according to some policy in order to perform the remote call. This policy can be passed as a configuration parameter -- random policy is used as default policy.

Upon failure in the first instantiation of protocol proxies the load balancer automatically tries another protocol. Once a protocol is successfully proxied the load balancer behaves similarly to any protocol instance. In particular, connection exceptions are escalated to the user.

Author:
Stefan Pleisch (SPL)
See Also:
AbstractPolicy, ch.elca.el4j.services.remoting.protocol.loadbalancing.policy.LoadBalancingProtcolConfiguration, AbstractRemotingProtocol
File-location:
LoadBalancingProtocol
Last check-in date:
2009-08-04 15:17:52 +0200 (Di, 04. Aug 2009) by swismer for revision 3880

Field Summary
 
Fields inherited from class ch.elca.el4j.services.remoting.AbstractRemotingProtocol
m_parentApplicationContext
 
Constructor Summary
LoadBalancingProtocol()
           
 
Method Summary
 void afterPropertiesSet()
          
 Object createExporterBean(RemotingServiceExporter exporterBean, Class serviceInterfaceWithContext, Object serviceProxy)
          Method to create the exporter bean.
 Object createProxyBean(RemotingProxyFactoryBean proxyBean, Class serviceInterfaceWithContext)
          Method to create the proxy bean.
 Class getExporterObjectType()
          Method to get the class type of the exporter object.
 Class getProxyObjectType()
          Method to get the class type of the proxy object.
 
Methods inherited from class ch.elca.el4j.services.remoting.AbstractRemotingProtocol
checkRemotingExporter, checkRemotingProxy, destroy, finalizeExporterDependentBeans, getChlidApplicationContexts, getClientContextInvocationHandler, getImplicitContextPassingRegistry, getProtocolSpecificConfiguration, getProtocolSpecificContextPassing, getProxyInterface, isDoNotForcePreInstantiationOfExporterObject, prepareExporterDependentBeans, registerChildApplicationContext, setApplicationContext, setDoNotForcePreInstantiationOfExporterObject, setImplicitContextPassingRegistry, setProtocolSpecificConfiguration, setProtocolSpecificContextPassing, unregisterChildApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoadBalancingProtocol

public LoadBalancingProtocol()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception

Throws:
Exception

createProxyBean

public Object createProxyBean(RemotingProxyFactoryBean proxyBean,
                              Class serviceInterfaceWithContext)
Method to create the proxy bean.

Specified by:
createProxyBean in class AbstractRemotingProtocol
Parameters:
proxyBean - Is the bean where the method gets information about the proxy bean.
serviceInterfaceWithContext - Is the modified interface.
Returns:
Returns the created proxy bean.

createExporterBean

public Object createExporterBean(RemotingServiceExporter exporterBean,
                                 Class serviceInterfaceWithContext,
                                 Object serviceProxy)
Method to create the exporter bean.

Specified by:
createExporterBean in class AbstractRemotingProtocol
Parameters:
exporterBean - Is the bean where the method gets information about the exporter bean.
serviceInterfaceWithContext - Is the modified interface.
serviceProxy - Is the bean which has to wrapped.
Returns:
Returns the generated exporter bean.

getProxyObjectType

public Class getProxyObjectType()
Method to get the class type of the proxy object.

Specified by:
getProxyObjectType in class AbstractRemotingProtocol
Returns:
Returns the class type.

getExporterObjectType

public Class getExporterObjectType()
Method to get the class type of the exporter object.

Specified by:
getExporterObjectType in class AbstractRemotingProtocol
Returns:
Returns the class type.


Copyright © 2005-2011 ELCA. All Rights Reserved.