Class AbstractSpaceCacheContainer
java.lang.Object
com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy
com.gigaspaces.internal.client.cache.AbstractSpaceCacheContainer
- All Implemented Interfaces:
IPojoSpace,ISpaceCache,ISpaceProxy,SecuredService,IDotnetProxyAssociated,ActionMaker,IJSpace,JavaSpace
- Direct Known Subclasses:
LocalCacheContainer,LocalViewContainer
- Since:
- 8.0.5
- Author:
- Niv Ingberg
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSpaceCacheContainer(IDirectSpaceProxy remoteProxy, SpaceCacheConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes space cache (the local cache).Generate a unique operation IDprotected abstract AbstractSpaceCacheprotected voidfinalize()getAdmin()Returns the admin object to the remote part of this space.abstract SpaceCacheConfigReturns 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.Returns a direct proxy to the local space.getName()Returns the name of this space.intGets the proxy ReadModifiers.Returns the uniqueUuidof this space instance.Returns a direct proxy to the remote space.intGets the proxyUpdateModifiers.getURL()Returns theSpaceURLinstance which was used to initialize the space.voidprotected abstract org.slf4j.LoggerintinitWriteModifiers(int modifiers) booleanbooleanreturns true if the proxy is ClusteredbooleanChecks whether proxy is connected to embedded or remote space.booleanisFifo()Returnstrueif this proxy FIFO enabled, otherwisefalse.booleanReturns 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.protected voidvoidonCacheFailure(AbstractSpaceCache failedCache) readById(ReadTakeProxyActionInfo actionInfo) readById(String className, Object id, Object routing, Transaction txn, long timeout, int modifiers, boolean ifExists, QueryResultTypeInternal resultType, String[] projections) replaceContextTransaction(Transaction.Created transaction) replaceContextTransaction(Transaction.Created transaction, ActionListener actionListener, boolean delegatedXa) voidsetActionListener(ActionListener actionListener) Sets a newActionListenerto receive events.voidsetFifo(boolean enabled) Sets FIFO mode for proxy.voidsetOptimisticLocking(boolean enabled) Enable/Disable Optimistic Lock protocol.intsetReadModifiers(int modifiers) Sets the read mode modifiers for proxy level.intsetUpdateModifiers(int modifiers) Sets the update mode modifiers for proxy level.toString()voidverifyProjectionsAreSupported(AbstractProjectionTemplate projectionTemplate) Methods inherited from class com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy
aggregate, applyNotifyInfoDefaults, asyncAddIndexes, asyncChange, asyncRead, asyncTake, change, checkIfConnected, clear, clear, count, count, createActionManager, dropClass, execute, execute, getAppDomainId, getContainerName, getDotnetProxyHandleId, getSpaceHealthStatus, getTypeDescriptor, hasAssociatedAppDomain, isLocalCacheCacheContainer, isLocalViewContainer, isTargetOfADotnetProxy, notify, ping, read, read, read, read, 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 class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.j_spaces.core.IJSpace
getCacheTypeNameMethods inherited from interface com.gigaspaces.internal.client.spaceproxy.ISpaceProxy
getNotificationsDirectProxy
-
Field Details
-
_logger
protected final org.slf4j.Logger _logger -
_cacheID
-
-
Constructor Details
-
AbstractSpaceCacheContainer
-
-
Method Details
-
initLogger
protected abstract org.slf4j.Logger initLogger() -
verifyProjectionsAreSupported
-
getCacheId
-
getCacheState
-
getCacheConfig
-
finalize
-
toString
-
close
public void close()Description copied from interface:ISpaceCacheCloses space cache (the local cache). Note, any operations performed on the space cache after it has been closed will result in an error. For example, and event session built on top of the space cache should be closed before the space cache is closed.- Specified by:
closein interfaceISpaceCache- Specified by:
closein interfaceISpaceProxy
-
assertCacheConnected
- Throws:
SpaceCacheException
-
getLocalSpace
Description copied from interface:ISpaceCacheReturns a direct proxy to the local space.- Specified by:
getLocalSpacein interfaceISpaceCache- Overrides:
getLocalSpacein classAbstractSpaceProxy
-
getRemoteSpace
Description copied from interface:ISpaceCacheReturns a direct proxy to the remote space.- Specified by:
getRemoteSpacein interfaceISpaceCache- Overrides:
getRemoteSpacein classAbstractSpaceProxy
-
initialize
-
onCacheFailure
-
createSpaceCache
-
isEmbedded
public boolean isEmbedded()Description copied from interface:IJSpaceChecks whether proxy is connected to embedded or remote space.- Specified by:
isEmbeddedin interfaceIJSpace
-
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
-
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
-
getName
Description copied from interface:IJSpaceReturns the name of this space. -
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)
-
getURL
Description copied from interface:IJSpaceReturns theSpaceURLinstance which was used to initialize the space. -
getReferentUuid
Description copied from interface:IJSpaceReturns the uniqueUuidof this space instance.- Specified by:
getReferentUuidin interfaceIJSpace
-
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 interfaceIJSpace- Returns:
- the remoteAdmin object to the remote part of this space.
- Throws:
RemoteException- if a communication error occurs
-
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
-
getPrivilegedAdmin
- Specified by:
getPrivilegedAdminin interfaceISpaceProxy- Throws:
RemoteException- See Also:
-
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. -
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
-
initWriteModifiers
public int initWriteModifiers(int modifiers) - Specified by:
initWriteModifiersin interfaceISpaceProxy
-
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
-
setActionListener
Description copied from interface:ActionMakerSets a newActionListenerto receive events. Replaces any formerActionListenerif exists.- Specified by:
setActionListenerin interfaceActionMaker
-
getReadModifiers
public int getReadModifiers()Description copied from interface:IJSpaceGets the proxy ReadModifiers.- Specified by:
getReadModifiersin interfaceIJSpace
-
setReadModifiers
public int setReadModifiers(int modifiers) 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 modifiers) Description copied from interface:IJSpaceSets the update mode modifiers for proxy level.- Specified by:
setUpdateModifiersin interfaceIJSpace
-
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.
-
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
-
createNewOperationID
Description copied from interface:ISpaceProxyGenerate a unique operation ID- Specified by:
createNewOperationIDin interfaceISpaceProxy- Returns:
- Unique operation ID
-
readById
public Object readById(ReadTakeProxyActionInfo actionInfo) throws RemoteException, UnusableEntryException, TransactionException, InterruptedException - Specified by:
readByIdin interfaceISpaceProxy- Overrides:
readByIdin classAbstractSpaceProxy- Throws:
RemoteExceptionUnusableEntryExceptionTransactionExceptionInterruptedException
-
readById
public Object readById(String className, Object id, Object routing, Transaction txn, long timeout, int modifiers, boolean ifExists, QueryResultTypeInternal resultType, String[] projections) throws RemoteException, UnusableEntryException, TransactionException, InterruptedException - Specified by:
readByIdin interfaceISpaceProxy- Overrides:
readByIdin classAbstractSpaceProxy- Throws:
RemoteExceptionUnusableEntryExceptionTransactionExceptionInterruptedException
-
isCacheContainer
public boolean isCacheContainer()- Overrides:
isCacheContainerin classAbstractSpaceProxy
-
notifyLocalSpaceOnInternalStateChange
-