GigaSpaces XAP 7.1 API

org.openspaces.remoting
Class SyncSpaceRemotingProxyFactoryBean

java.lang.Object
  extended by org.springframework.remoting.support.RemotingSupport
      extended by org.springframework.remoting.support.RemoteAccessor
          extended by org.openspaces.remoting.SyncSpaceRemotingProxyFactoryBean
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, RemotingInvoker, BeanClassLoaderAware, FactoryBean, InitializingBean

Deprecated. Use ExecutorSpaceRemotingProxyFactoryBean and executor based remoting instead.

public class SyncSpaceRemotingProxyFactoryBean
extends RemoteAccessor
implements FactoryBean, InitializingBean, MethodInterceptor, RemotingInvoker

A space sync remoting proxy that forward the service execution to a remote service with the space as the transport layer. Services are remotely exported in the "server side" using the SpaceRemotingServiceExporter. This proxy uses the fact that the service exporter is defined as a filter within the remote Space, causing the call to be sync. Either a takeMultiple (in case of an invocation with a result) or readMultiple (in case the invocation is one way) is invoked on the Space using a template (SyncSpaceRemotingEntry) that actually holds the invocation information. The service exporter traps the operation (in the "before" stage) using the filter and writes the result to the Space which is then read by the actual readMultuple/takeMultiple.

The proxy requires a setGigaSpace(org.openspaces.core.GigaSpace) interface to be set in order to write execute.

Allows for one way invocations (i.e. not waiting for a response). The one way invocation can be set globally for all of the service methods by setting setGlobalOneWay(boolean) or can be enabled only for methods that return void by setting setVoidOneWay(boolean). Note, if using one way invocation and an exception is raised by the remote service, it won't be raised by this proxy.

In case of remote invocation over a partitioned space the default partitioned routing index will be random (the hashCode of the newly created SyncSpaceRemotingEntry class). The proxy allows for a pluggable routing handler implementation by setting setRemoteRoutingHandler(RemoteRoutingHandler).

The proxy allows to perform broadcast the remote invocation to all different cluster members (partitions for example) by setting the broadcast flag to true/ In such cases, a custom setRemoteResultReducer(RemoteResultReducer) can be plugged to reduce the results of all different services into a single response (assuming that the service has a return value).

The actual remote invocation can be replaced with an aspect implementing RemoteInvocationAspect which can be set using setRemoteInvocationAspect(RemoteInvocationAspect). It is up the aspect to then call the actual remote invocation.

Author:
kimchy
See Also:
SpaceRemotingServiceExporter

Field Summary
static String DEFAULT_ASYNC_METHOD_PREFIX
          Deprecated.  
 
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
 
Constructor Summary
SyncSpaceRemotingProxyFactoryBean()
          Deprecated.  
 
Method Summary
 void afterPropertiesSet()
          Deprecated.  
 Object getObject()
          Deprecated.  
 Class<?> getObjectType()
          Deprecated.  
 Object invoke(MethodInvocation methodInvocation)
          Deprecated.  
 Object invokeRemote(MethodInvocation methodInvocation)
          Deprecated. This invocation will cause the actual remote invocation.
 boolean isSingleton()
          Deprecated.  
 void setBroadcast(boolean broadcast)
          Deprecated. If set the true (defaults to false) causes the remote invocation to be called on all active (primary) cluster members.
 void setGigaSpace(GigaSpace gigaSpace)
          Deprecated. Sets the GigaSpace interface that will be used to work with the space as the transport layer.
 void setGlobalOneWay(boolean globalOneWay)
          Deprecated. If set to true (defaults to false) all of the service methods will be invoked and the proxy will not wait for a return value.
 void setMetaArgumentsHandler(MetaArgumentsHandler metaArgumentsHandler)
          Deprecated. Allows to set a meta argument handler that will control SpaceRemotingInvocation.getMetaArguments().
 void setRemoteInvocationAspect(RemoteInvocationAspect remoteInvocationAspect)
          Deprecated. The actual remote invocation can be replaced with an aspect implementing RemoteInvocationAspect which can be set using setRemoteInvocationAspect(RemoteInvocationAspect).
 void setRemoteResultReducer(RemoteResultReducer remoteResultReducer)
          Deprecated. When using broadcast set to true, allows to plug a custom reducer that can reduce the array of result objects into another response object.
 void setRemoteRoutingHandler(RemoteRoutingHandler remoteRoutingHandler)
          Deprecated. In case of remote invocation over a partitioned space the default partitioned routing index will be random (the hashCode of the newly created SyncSpaceRemotingEntry class).
 void setReturnFirstResult(boolean returnFirstResult)
          Deprecated. When set to true (defaults to true) will return the first result when using broadcast.
 void setVoidOneWay(boolean voidOneWay)
          Deprecated. If set to true (defaults to false) service methods that return void will be invoked and the proxy will not wait for a return value.
 
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
 
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ASYNC_METHOD_PREFIX

public static final String DEFAULT_ASYNC_METHOD_PREFIX
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

SyncSpaceRemotingProxyFactoryBean

public SyncSpaceRemotingProxyFactoryBean()
Deprecated. 
Method Detail

setGigaSpace

public void setGigaSpace(GigaSpace gigaSpace)
Deprecated. 
Sets the GigaSpace interface that will be used to work with the space as the transport layer.


setRemoteRoutingHandler

public void setRemoteRoutingHandler(RemoteRoutingHandler remoteRoutingHandler)
Deprecated. 
In case of remote invocation over a partitioned space the default partitioned routing index will be random (the hashCode of the newly created SyncSpaceRemotingEntry class). This RemoteRoutingHandler allows for custom routing computation (for example, based on one of the service method parameters).


setGlobalOneWay

public void setGlobalOneWay(boolean globalOneWay)
Deprecated. 
If set to true (defaults to false) all of the service methods will be invoked and the proxy will not wait for a return value. Note, any exception raised by the remote service will be logged on the server side and not propagated to the client.


setVoidOneWay

public void setVoidOneWay(boolean voidOneWay)
Deprecated. 
If set to true (defaults to false) service methods that return void will be invoked and the proxy will not wait for a return value. Note, any exception raised by the remote service will be logged on the server side and not propagated to the client.


setBroadcast

public void setBroadcast(boolean broadcast)
Deprecated. 
If set the true (defaults to false) causes the remote invocation to be called on all active (primary) cluster members.


setRemoteResultReducer

public void setRemoteResultReducer(RemoteResultReducer remoteResultReducer)
Deprecated. 
When using broadcast set to true, allows to plug a custom reducer that can reduce the array of result objects into another response object.


setMetaArgumentsHandler

public void setMetaArgumentsHandler(MetaArgumentsHandler metaArgumentsHandler)
Deprecated. 
Allows to set a meta argument handler that will control SpaceRemotingInvocation.getMetaArguments().


setReturnFirstResult

public void setReturnFirstResult(boolean returnFirstResult)
Deprecated. 
When set to true (defaults to true) will return the first result when using broadcast. If set to false, an array of results will be retuned.

Note, this only applies if no reducer is provided.


setRemoteInvocationAspect

public void setRemoteInvocationAspect(RemoteInvocationAspect remoteInvocationAspect)
Deprecated. 
The actual remote invocation can be replaced with an aspect implementing RemoteInvocationAspect which can be set using setRemoteInvocationAspect(RemoteInvocationAspect). It is up the aspect to then call the actual remote invocation.


afterPropertiesSet

public void afterPropertiesSet()
Deprecated. 
Specified by:
afterPropertiesSet in interface InitializingBean

getObject

public Object getObject()
Deprecated. 
Specified by:
getObject in interface FactoryBean

getObjectType

public Class<?> getObjectType()
Deprecated. 
Specified by:
getObjectType in interface FactoryBean

isSingleton

public boolean isSingleton()
Deprecated. 
Specified by:
isSingleton in interface FactoryBean

invoke

public Object invoke(MethodInvocation methodInvocation)
              throws Throwable
Deprecated. 
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

invokeRemote

public Object invokeRemote(MethodInvocation methodInvocation)
                    throws Throwable
Deprecated. 
Description copied from interface: RemotingInvoker
This invocation will cause the actual remote invocation.

Specified by:
invokeRemote in interface RemotingInvoker
Throws:
Throwable

GigaSpaces XAP 7.1 API

Copyright © GigaSpaces.