Class SpaceProxyImpl
java.lang.Object
com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy
com.gigaspaces.internal.client.spaceproxy.AbstractDirectSpaceProxy
com.gigaspaces.internal.client.spaceproxy.SpaceProxyImpl
- All Implemented Interfaces:
IPojoSpace,IDirectSpaceProxy,ISpaceProxy,IClusterInfoChangedListener,SecuredService,IDotnetProxyAssociated,SmartExternalizable,ActionMaker,IJSpace,Service,MarshalPivotProvider,Externalizable,Serializable,Remote,Administrable,ReferentUuid,SameProxyVersionProvider,JavaSpace
public class SpaceProxyImpl
extends AbstractDirectSpaceProxy
implements SameProxyVersionProvider, MarshalPivotProvider, IClusterInfoChangedListener
Provides the functionality of clustered proxy.
- Since:
- 2.0
- Version:
- 1.3
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThis class is only used by the engine to verify that the proxy is alive. -
Field Summary
Fields inherited from class com.gigaspaces.internal.client.spaceproxy.AbstractDirectSpaceProxy
_proxySettings -
Constructor Summary
ConstructorsConstructorDescriptionSpaceProxyImpl(DirectSpaceProxyFactoryImpl factory, ProxySettings proxySettings) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterClusterInfoChange(SpaceClusterInfo clusterInfo) Updates server side components that holds SpaceClusterInfo instances when SpaceClusterInfo changes (i.e horizontal scale event)static voidafterExecute(SpaceOperationRequest<?> spaceRequest, IRemoteSpace targetSpace, int partitionId, boolean isRejected) booleanbeforeExecute(SpaceOperationRequest<?> spaceRequest, IRemoteSpace targetSpace, int partitionId, String clusterName, boolean isEmbedded) voidvoidclose()Close the proxy and execute necessary cleanup logic.protected AbstractSpaceProxyActionManager<SpaceProxyImpl>Generate a unique operation IDvoiddemote(long maxSuspendTime, TimeUnit timeUnit, CredentialsProvider credentialsProvider) Internal demote API for swapping from primary to backup Space.voidvoiddirectDropClass(String className) booleanoverrides implementation of equals() method in AbstractSpaceProxyprotected voidfinalize()getAdmin()Returns the admin object to the remote part of this space.longReturns a clustered view of this proxy.Returns the container proxy this space resides in.Returns the transaction associated with the current context, if any.returns itself in case of a direct proxy or the real proxy in case of a local cache or a view.Returns theSpaceURLobject which was used as the argument forSpaceFinder.find(SpaceURL)while looking for the space.getName()Returns the name of this space.Returns a proxy of the specified space.returns itself in case of a direct proxy or the real proxy in case of a local cache or a view.intgetPartitionId(Object routingValue) Get remote admin object for this space.intGets the proxy ReadModifiers.Returns the uniqueUuidof this space instance.Returns the reference to initial remote spaceReturns the StubHandler of this space.getTypeDescFromServer(String typeName) intGets the proxyUpdateModifiers.getURL()Returns theSpaceURLinstance which was used to initialize the space.voidinitProxyRouter(int partitionId) intinitWriteModifiers(int modifiers) booleanreturns true if the proxy is ClusteredbooleanChecks whether proxy is connected to embedded or remote space.booleanisFifo()Returnstrueif this proxy FIFO enabled, otherwisefalse.booleanbooleanReturns status of Optimistic Lock protocol.booleanReturns an indication : is this space secured.booleanIf a security model is defined will returntrue.booleanReturns true if the space started within a GSC.Class<?>loadRemoteClass(String className) Loads a remote class from the space, the class will be loaded locally into a corresponding LRMIClassLoaderlogin(CredentialsProvider credentialsProvider) Login to a secured service using the providedcredentialsProvider.prepareTemplate(Object template) voidvoidregisterTypeDescInServers(ITypeDesc typeDesc) replaceContextTransaction(Transaction.Created transaction, ActionListener actionListener, boolean delegatedXa) voidsetActionListener(ActionListener actionListener) Sets a newActionListenerto receive events.voidsetFifo(boolean enabled) Sets FIFO mode for proxy.voidsetFinderURL(SpaceURL _finderurl) voidvoidsetMVCCGenerationsState(MVCCGenerationsState generationsState) voidsetOptimisticLocking(boolean enabled) Enable/Disable Optimistic Lock protocol.voidsetQuiesceToken(QuiesceToken token) intsetReadModifiers(int readModifiers) Sets the read mode modifiers for proxy level.intsetUpdateModifiers(int newModifiers) Sets the update mode modifiers for proxy level.voidshutdown()voidupdateProxyRouter(SpaceProxyRouter oldRouter, ClusterTopology chunksMap) Used in client side to update all proxy components with the new mapvoidMethods inherited from class com.gigaspaces.internal.client.spaceproxy.AbstractDirectSpaceProxy
getProxySettings, hashCode, toStringMethods inherited from class com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy
aggregate, applyNotifyInfoDefaults, asyncAddIndexes, asyncChange, asyncRead, asyncTake, change, checkIfConnected, clear, clear, count, count, dropClass, execute, execute, getAppDomainId, getContainerName, getDotnetProxyHandleId, getLocalSpace, getRemoteSpace, getSpaceHealthStatus, getTypeDescriptor, hasAssociatedAppDomain, isCacheContainer, isLocalCacheCacheContainer, isLocalViewContainer, isTargetOfADotnetProxy, notify, ping, read, read, read, read, readById, readById, readByIds, readByIds, readByIds, readByUid, readEntriesUids, readIfExists, readIfExists, readIfExists, readMultiple, readMultiple, readMultiple, readMultiple, registerTypeDescriptor, registerTypeDescriptor, setAppDomainId, setDotnetProxyHandleId, snapshot, snapshot, take, take, take, take, takeById, takeById, takeByIds, takeByIds, takeByIds, takeByUid, takeIfExists, takeIfExists, takeIfExists, takeMultiple, takeMultiple, takeMultiple, takeMultiple, unregisterTypeDescriptor, update, update, updateMultiple, updateMultiple, write, write, write, writeMultiple, writeMultiple, writeMultiple, writeMultiple, writeMultipleMethods inherited from interface com.gigaspaces.serialization.pbs.IDotnetProxyAssociated
getAppDomainId, getDotnetProxyHandleId, hasAssociatedAppDomain, isTargetOfADotnetProxy, setAppDomainId, setDotnetProxyHandleIdMethods inherited from interface com.j_spaces.core.IJSpace
dropClass, getContainerName, pingMethods inherited from interface com.gigaspaces.client.IPojoSpace
clear, clear, count, count, read, read, readIfExists, readIfExists, readMultiple, readMultiple, snapshot, take, take, takeIfExists, takeMultiple, takeMultiple, update, update, updateMultiple, updateMultiple, write, write, writeMultiple, writeMultiple, writeMultipleMethods inherited from interface com.gigaspaces.internal.client.spaceproxy.ISpaceProxy
aggregate, applyNotifyInfoDefaults, asyncAddIndexes, asyncChange, asyncRead, asyncTake, change, checkIfConnected, execute, execute, getSpaceHealthStatus, getTypeDescriptor, read, readById, readById, readByIds, readByIds, readByIds, readByUid, readEntriesUids, readMultiple, readMultiple, registerTypeDescriptor, registerTypeDescriptor, take, takeById, takeById, takeByIds, takeByIds, takeByIds, takeByUid, takeMultiple, takeMultiple, unregisterTypeDescriptor, writeMultipleMethods inherited from interface net.jini.space.JavaSpace
notify, read, readIfExists, snapshot, take, takeIfExists, writeMethods inherited from interface com.gigaspaces.serialization.SmartExternalizable
enabledSmartExternalizableWithReference
-
Constructor Details
-
SpaceProxyImpl
-
-
Method Details
-
getThreadPool
- Specified by:
getThreadPoolin interfaceIDirectSpaceProxy
-
getDirectProxy
Description copied from interface:IJSpacereturns itself in case of a direct proxy or the real proxy in case of a local cache or a view.- Specified by:
getDirectProxyin interfaceIJSpace- Returns:
- IDirectSpaceProxy
-
getCacheTypeName
- Specified by:
getCacheTypeNamein interfaceIJSpace
-
getNotificationsDirectProxy
Description copied from interface:ISpaceProxyreturns itself in case of a direct proxy or the real proxy in case of a local cache or a view.- Specified by:
getNotificationsDirectProxyin interfaceISpaceProxy
-
getQueryManager
- Specified by:
getQueryManagerin interfaceIDirectSpaceProxy
-
getDataEventsManager
- Specified by:
getDataEventsManagerin interfaceIDirectSpaceProxy
-
getSecurityManager
- Specified by:
getSecurityManagerin interfaceIDirectSpaceProxy
-
getTypeManager
- Specified by:
getTypeManagerin interfaceIDirectSpaceProxy
-
setActionListener
Description copied from interface:ActionMakerSets a newActionListenerto receive events. Replaces any formerActionListenerif exists.- Specified by:
setActionListenerin interfaceActionMaker
-
getContextTransaction
Description copied from interface:ISpaceProxyReturns the transaction associated with the current context, if any.- Specified by:
getContextTransactionin interfaceISpaceProxy
-
replaceContextTransaction
- Specified by:
replaceContextTransactionin interfaceISpaceProxy
-
replaceContextTransaction
public Transaction.Created replaceContextTransaction(Transaction.Created transaction, ActionListener actionListener, boolean delegatedXa) - Specified by:
replaceContextTransactionin interfaceISpaceProxy
-
getReferentUuid
Description copied from interface:IJSpaceReturns the uniqueUuidof this space instance.- Specified by:
getReferentUuidin interfaceIJSpace- Specified by:
getReferentUuidin interfaceReferentUuid- Returns:
- the
Uuidassociated with the resource this proxy represents. Will not returnnull.
-
getName
Description copied from interface:IJSpaceReturns the name of this space. -
isEmbedded
public boolean isEmbedded()Description copied from interface:IJSpaceChecks whether proxy is connected to embedded or remote space.- Specified by:
isEmbeddedin interfaceIJSpace
-
isSecured
public boolean isSecured()Description copied from interface:IJSpaceReturns an indication : is this space secured. If for this space defined Security Filter, the space will be secured. -
isServiceSecured
Description copied from interface:SecuredServiceIf a security model is defined will returntrue.- Specified by:
isServiceSecuredin interfaceSecuredService- Returns:
trueif secured;falseotherwise.- Throws:
RemoteException- communication-related exceptions that may occur during the execution of a remote method call.
-
isStartedWithinGSC
Description copied from interface:IJSpaceReturns true if the space started within a GSC.- Specified by:
isStartedWithinGSCin interfaceIJSpace- Throws:
RemoteException
-
getAdmin
Description copied from interface:IJSpaceReturns the admin object to the remote part of this space.// get a list of classes and the number of entries of each classIRemoteJSpaceAdminremoteAdmin = (IRemoteJSpaceAdmin)serverAdmin.getAdmin(); Object classList[] = remoteAdmin.getRuntimeInfo().m_ClassNames.toArray(); List numOFEntries = remoteAdmin.getRuntimeInfo().m_NumOFEntries;- Specified by:
getAdminin interfaceAdministrable- Specified by:
getAdminin interfaceIJSpace- Returns:
- the remoteAdmin object to the remote part of this space.
- Throws:
RemoteException- if a communication error occurs- See Also:
-
getPrivilegedAdmin
Get remote admin object for this space. No security checks are performed since this is for internal use only- Specified by:
getPrivilegedAdminin interfaceISpaceProxy- Throws:
RemoteException- See Also:
-
getNonClusteredProxy
Description copied from interface:IDirectSpaceProxyReturns a proxy of the specified space. When the proxy is not part of a cluster, it returns itself as the only member.- Specified by:
getNonClusteredProxyin interfaceIDirectSpaceProxy- Returns:
- IJSpace space proxy.
-
getClusteredProxy
Description copied from interface:IDirectSpaceProxyReturns a clustered view of this proxy. When the proxy is not part of a cluster, it returns itself as the clustered view.- Specified by:
getClusteredProxyin interfaceIDirectSpaceProxy- Returns:
- IJSpace space proxy.
-
getStubHandler
Description copied from interface:IDirectSpaceProxyReturns the StubHandler of this space.- Specified by:
getStubHandlerin interfaceIDirectSpaceProxy- Returns:
- StubHandler of this space.
-
getContainer
Description copied from interface:IDirectSpaceProxyReturns the container proxy this space resides in.
The container holds information and attributes of neighboring spaces, and exposes API for creating and destroying of spaces.- Specified by:
getContainerin interfaceIDirectSpaceProxy- Returns:
- Returns the container proxy.
-
shutdown
- Specified by:
shutdownin interfaceIDirectSpaceProxy- Throws:
RemoteException
-
getContainerConfig
- Specified by:
getContainerConfigin interfaceIDirectSpaceProxy- Throws:
RemoteException
-
getContainerURL
- Specified by:
getContainerURLin interfaceIDirectSpaceProxy- Throws:
RemoteException
-
getFinderURL
Description copied from interface:IJSpaceReturns theSpaceURLobject which was used as the argument forSpaceFinder.find(SpaceURL)while looking for the space. If a client uses thisSpaceURLwhen it calls toSpaceFinder.find(SpaceURL)it should be able to find that space. Notice: TheSpaceURLreturned when calling getURL() is different since in that case it returns theSpaceURLused to initialize the space (a java:// protocol to start an embedded space).- Specified by:
getFinderURLin interfaceIJSpace- Returns:
SpaceURLobject which can be used to find the space proxy while callingSpaceFinder.find(SpaceURL)
-
setFinderURL
-
getURL
Description copied from interface:IJSpaceReturns theSpaceURLinstance which was used to initialize the space. -
isOptimisticLockingEnabled
public boolean isOptimisticLockingEnabled()Description copied from interface:IJSpaceReturns status of Optimistic Lock protocol.- Specified by:
isOptimisticLockingEnabledin interfaceIJSpace
-
setOptimisticLocking
public void setOptimisticLocking(boolean enabled) Description copied from interface:IJSpaceEnable/Disable Optimistic Lock protocol.- Specified by:
setOptimisticLockingin interfaceIJSpace
-
isFifo
public boolean isFifo()Description copied from interface:IJSpaceReturnstrueif this proxy FIFO enabled, otherwisefalse. -
setFifo
public void setFifo(boolean enabled) Description copied from interface:IJSpaceSets FIFO mode for proxy. -
getReadModifiers
public int getReadModifiers()Description copied from interface:IJSpaceGets the proxy ReadModifiers.- Specified by:
getReadModifiersin interfaceIJSpace
-
setReadModifiers
public int setReadModifiers(int readModifiers) Description copied from interface:IJSpaceSets the read mode modifiers for proxy level.- Specified by:
setReadModifiersin interfaceIJSpace
-
getUpdateModifiers
public int getUpdateModifiers()Description copied from interface:IJSpaceGets the proxyUpdateModifiers.- Specified by:
getUpdateModifiersin interfaceIJSpace
-
setUpdateModifiers
public int setUpdateModifiers(int newModifiers) Description copied from interface:IJSpaceSets the update mode modifiers for proxy level.- Specified by:
setUpdateModifiersin interfaceIJSpace
-
isGatewayProxy
public boolean isGatewayProxy()- Specified by:
isGatewayProxyin interfaceIDirectSpaceProxy
-
setGatewayProxy
public void setGatewayProxy() -
getVersion
- Specified by:
getVersionin interfaceSameProxyVersionProvider
-
createActionManager
- Specified by:
createActionManagerin classAbstractSpaceProxy
-
createNewOperationID
Description copied from interface:ISpaceProxyGenerate a unique operation ID- Specified by:
createNewOperationIDin interfaceISpaceProxy- Returns:
- Unique operation ID
-
getClientID
public long getClientID()- Specified by:
getClientIDin interfaceIDirectSpaceProxy
-
directClean
public void directClean()- Specified by:
directCleanin interfaceIDirectSpaceProxy
-
directDropClass
-
login
Description copied from interface:SecuredServiceLogin to a secured service using the providedcredentialsProvider.- Specified by:
loginin interfaceSecuredService- Parameters:
credentialsProvider- provides credentials to be used for authentication.- Throws:
RemoteException- communication-related exceptions that may occur during the execution of a remote method call.
-
beforeSpaceAction
-
beforeSpaceAction
-
beforeSpaceAction
-
equals
overrides implementation of equals() method in AbstractSpaceProxy- Overrides:
equalsin classAbstractDirectSpaceProxy
-
getRemoteMemberName
- Specified by:
getRemoteMemberNamein interfaceIDirectSpaceProxy
-
getRemoteJSpace
Description copied from interface:IDirectSpaceProxyReturns the reference to initial remote space- Specified by:
getRemoteJSpacein interfaceIDirectSpaceProxy
-
getSpaceImplIfEmbedded
- Specified by:
getSpaceImplIfEmbeddedin interfaceIDirectSpaceProxy
-
isClustered
public boolean isClustered()Description copied from interface:ISpaceProxyreturns true if the proxy is Clustered- Specified by:
isClusteredin interfaceISpaceProxy- Returns:
- true when the proxy is Clustered
-
finalize
-
close
public void close()Description copied from interface:ISpaceProxyClose the proxy and execute necessary cleanup logic.- Specified by:
closein interfaceISpaceProxy
-
getMarshalPivot
- Specified by:
getMarshalPivotin interfaceMarshalPivotProvider- Throws:
RemoteException
-
getTypeDescFromServer
- Specified by:
getTypeDescFromServerin interfaceIDirectSpaceProxy
-
registerTypeDescInServers
- Specified by:
registerTypeDescInServersin interfaceIDirectSpaceProxy
-
loadRemoteClass
Description copied from interface:ISpaceProxyLoads a remote class from the space, the class will be loaded locally into a corresponding LRMIClassLoader- Specified by:
loadRemoteClassin interfaceISpaceProxy- Throws:
ClassNotFoundException
-
initWriteModifiers
public int initWriteModifiers(int modifiers) - Specified by:
initWriteModifiersin interfaceISpaceProxy
-
getPartitionId
- Specified by:
getPartitionIdin interfaceIDirectSpaceProxy
-
getFactory
- Specified by:
getFactoryin interfaceIDirectSpaceProxy
-
getSpaceClusterInfo
- Specified by:
getSpaceClusterInfoin interfaceIDirectSpaceProxy
-
getProxyRouter
- Specified by:
getProxyRouterin interfaceIDirectSpaceProxy
-
initProxyRouter
public void initProxyRouter(int partitionId) -
updateProxyRouter
Used in client side to update all proxy components with the new map- Parameters:
chunksMap-
-
afterClusterInfoChange
Description copied from interface:IClusterInfoChangedListenerUpdates server side components that holds SpaceClusterInfo instances when SpaceClusterInfo changes (i.e horizontal scale event)- Specified by:
afterClusterInfoChangein interfaceIClusterInfoChangedListener
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classAbstractDirectSpaceProxy- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classAbstractDirectSpaceProxy- Throws:
IOExceptionClassNotFoundException
-
beforeExecute
public boolean beforeExecute(SpaceOperationRequest<?> spaceRequest, IRemoteSpace targetSpace, int partitionId, String clusterName, boolean isEmbedded) throws RemoteException - Throws:
RemoteException
-
afterExecute
public static void afterExecute(SpaceOperationRequest<?> spaceRequest, IRemoteSpace targetSpace, int partitionId, boolean isRejected) -
setQuiesceToken
- Specified by:
setQuiesceTokenin interfaceIDirectSpaceProxy
-
prepareTemplate
- Specified by:
prepareTemplatein interfaceIDirectSpaceProxy
-
demote
public void demote(long maxSuspendTime, TimeUnit timeUnit, CredentialsProvider credentialsProvider) throws DemoteFailedException, RemoteException Description copied from interface:IDirectSpaceProxyInternal demote API for swapping from primary to backup Space.- Specified by:
demotein interfaceIDirectSpaceProxy- Parameters:
maxSuspendTime- maximum suspend time for the operation to completetimeUnit- max suspend time unit to usecredentialsProvider- security credentials, ornull, orEmptyCredentialsProvider- Throws:
DemoteFailedExceptionRemoteException
-
cloneProxy
-
setMVCCGenerationsState
- Specified by:
setMVCCGenerationsStatein interfaceIDirectSpaceProxy
-