com.interface21.remoting.support
Class RemoteProxyFactoryBean

java.lang.Object
  |
  +--com.interface21.remoting.support.RemoteProxyFactoryBean
All Implemented Interfaces:
FactoryBean, InitializingBean
Direct Known Subclasses:
AuthorizableRemoteProxyFactoryBean, RmiProxyFactoryBean

public abstract class RemoteProxyFactoryBean
extends java.lang.Object
implements FactoryBean, InitializingBean

Abstract base class for factory beans proxying a remote service. Exposes the proxy when used as bean reference. Used e.g. by the Caucho and RMI proxy factory implementations.

Subclasses just need to implement createProxy, using the properties of the factory instance.

Since:
13.05.2003
Author:
Juergen Hoeller
See Also:
createProxy()

Constructor Summary
RemoteProxyFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
          Creates and validates the proxy, and keeps the reference.
protected abstract  java.lang.Object createProxy()
          Create the proxy instance.
 java.lang.Object getObject()
          Return the singleton serviceProxy proxy.
 PropertyValues getPropertyValues()
          Property values to pass to new bean instances created by this factory.
protected  java.lang.Class getServiceInterface()
           
protected  java.lang.String getServiceUrl()
           
 boolean isSingleton()
          Is the bean managed by this factory a singleton or a prototype?
 void setServiceInterface(java.lang.Class serviceInterface)
          Set the interface of the serviceProxy that this factory should create a proxy for.
 void setServiceUrl(java.lang.String serviceUrl)
          Set the URL of the serviceProxy that this factory should create a proxy for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteProxyFactoryBean

public RemoteProxyFactoryBean()
Method Detail

setServiceInterface

public void setServiceInterface(java.lang.Class serviceInterface)
Set the interface of the serviceProxy that this factory should create a proxy for.

getServiceInterface

protected java.lang.Class getServiceInterface()

setServiceUrl

public void setServiceUrl(java.lang.String serviceUrl)
Set the URL of the serviceProxy that this factory should create a proxy for.

getServiceUrl

protected java.lang.String getServiceUrl()

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.net.MalformedURLException,
                               RemoteAccessException
Creates and validates the proxy, and keeps the reference. Delegates to createProxy.
Specified by:
afterPropertiesSet in interface InitializingBean
See Also:
createProxy()

createProxy

protected abstract java.lang.Object createProxy()
                                         throws java.net.MalformedURLException,
                                                RemoteAccessException
Create the proxy instance. Can use the properties of this factory, although the actually used settings will vary. For example, certain protocols do not support authentication.
Returns:
the new proxy instance

getObject

public java.lang.Object getObject()
Return the singleton serviceProxy proxy.
Specified by:
getObject in interface FactoryBean
Following copied from interface: com.interface21.beans.factory.FactoryBean
Returns:
an instance of the bean

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the bean managed by this factory a singleton or a prototype? That is, will getBean() always return the same object?
The singleton status of a FactoryBean will generally be provided by the owning BeanFactory.
Specified by:
isSingleton in interface FactoryBean
Following copied from interface: com.interface21.beans.factory.FactoryBean
Returns:
is this bean a singleton

getPropertyValues

public PropertyValues getPropertyValues()
Description copied from interface: FactoryBean
Property values to pass to new bean instances created by this factory. Mapped directly onto the bean instance using reflection. This occurs after any configuration of the instance performed by the factory itself, and is an optional step within the control of the owning BeanFactory.
Specified by:
getPropertyValues in interface FactoryBean
Following copied from interface: com.interface21.beans.factory.FactoryBean
Returns:
PropertyValues to pass to each new instance, or null (the default) if there are no properties to pass to the instance.


Rod Johnson and Spring contributors 2001-2003.