org.springframework.remoting.support
Class RemoteExporter

java.lang.Object
  extended byorg.springframework.remoting.support.RemoteExporter
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
BurlapServiceExporter, HessianServiceExporter, RmiServiceExporter

public abstract class RemoteExporter
extends java.lang.Object
implements InitializingBean

Abstract base class for classes that export a remote service. Provides a "serviceInterface" bean property.

Note that the service interface being used will show some signs of remotability, like the granularity of method calls that it offers. Furthermore, it has to require serializable arguments etc.

Since:
26.12.2003
Author:
Juergen Hoeller

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
RemoteExporter()
           
 
Method Summary
 void afterPropertiesSet()
          Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  java.lang.Object getProxyForService()
          Get a proxy for the given service object, implementing the specified service interface.
protected  java.lang.Object getService()
          Return the service to export.
protected  java.lang.Class getServiceInterface()
          Return the interface of the service to export.
 void setService(java.lang.Object service)
          Set the service to export.
 void setServiceInterface(java.lang.Class serviceInterface)
          Set the interface of the service to export.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

RemoteExporter

public RemoteExporter()
Method Detail

setServiceInterface

public void setServiceInterface(java.lang.Class serviceInterface)
Set the interface of the service to export. Typically optional: If not set, all implement interfaces will be exported. The interface must be suitable for the particular service and remoting tool.


getServiceInterface

protected java.lang.Class getServiceInterface()
Return the interface of the service to export.


setService

public void setService(java.lang.Object service)
Set the service to export. Typically populated via a bean reference.


getService

protected java.lang.Object getService()
Return the service to export.


afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
java.lang.Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

getProxyForService

protected java.lang.Object getProxyForService()
Get a proxy for the given service object, implementing the specified service interface.

Used to export a proxy that does not expose any internals but just a specific interface intended for remote access. Only applied if the remoting tool itself does not offer such means itself.

Returns:
the proxy
See Also:
setServiceInterface(java.lang.Class)


Copyright (C) 2003-2004 The Spring Framework Project.