public abstract class AbstractSpaceCacheContainer extends AbstractSpaceProxy implements ISpaceCache
Modifier and Type | Class and Description |
---|---|
class |
AbstractSpaceCacheContainer.StateMonitor |
Modifier and Type | Field and Description |
---|---|
protected String |
_cacheID |
protected org.slf4j.Logger |
_logger |
Modifier | Constructor and Description |
---|---|
protected |
AbstractSpaceCacheContainer(IDirectSpaceProxy remoteProxy,
SpaceCacheConfig config) |
Modifier and Type | Method and Description |
---|---|
AbstractSpaceCache |
assertCacheConnected() |
void |
close()
Closes space cache (the local cache).
|
OperationID |
createNewOperationID()
Generate a unique operation ID
|
protected abstract AbstractSpaceCache |
createSpaceCache() |
protected void |
finalize() |
Object |
getAdmin()
Returns the admin object to the remote part of this space.
|
abstract SpaceCacheConfig |
getCacheConfig() |
String |
getCacheId() |
SpaceCacheState |
getCacheState() |
Transaction.Created |
getContextTransaction()
Returns the transaction associated with the current context, if any.
|
IDirectSpaceProxy |
getDirectProxy()
returns itself in case of a direct proxy or the real proxy in case of a local cache or a
view.
|
SpaceURL |
getFinderURL()
Returns the
SpaceURL object which was used as the argument for SpaceFinder.find(SpaceURL) while looking for the space. |
IDirectSpaceProxy |
getLocalSpace()
Returns a direct proxy to the local space.
|
String |
getName()
Returns the name of this space.
|
Object |
getPrivilegedAdmin() |
int |
getReadModifiers()
Gets the proxy ReadModifiers.
|
Uuid |
getReferentUuid()
Returns the unique
Uuid of this space instance. |
IDirectSpaceProxy |
getRemoteSpace()
Returns a direct proxy to the remote space.
|
int |
getUpdateModifiers()
Gets the proxyUpdateModifiers.
|
SpaceURL |
getURL()
Returns the
SpaceURL instance which was used to initialize the space. |
void |
initialize() |
protected abstract org.slf4j.Logger |
initLogger() |
int |
initWriteModifiers(int modifiers) |
boolean |
isCacheContainer() |
boolean |
isClustered()
returns true if the proxy is Clustered
|
boolean |
isEmbedded()
Checks whether proxy is connected to embedded or remote space.
|
boolean |
isFifo()
Returns
true if this proxy FIFO enabled, otherwise false . |
boolean |
isOptimisticLockingEnabled()
Returns status of Optimistic Lock protocol.
|
boolean |
isSecured()
Returns an indication : is this space secured.
|
boolean |
isServiceSecured()
If a security model is defined will return
true . |
boolean |
isStartedWithinGSC()
Returns 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
LRMIClassLoader
|
SecurityContext |
login(CredentialsProvider credentialsProvider)
Login to a secured service using the provided
credentialsProvider . |
protected void |
notifyLocalSpaceOnInternalStateChange(SpaceCacheState state) |
void |
onCacheFailure(AbstractSpaceCache failedCache) |
Object |
readById(ReadTakeProxyActionInfo actionInfo) |
Object |
readById(String className,
Object id,
Object routing,
Transaction txn,
long timeout,
int modifiers,
boolean ifExists,
QueryResultTypeInternal resultType,
String[] projections) |
Transaction.Created |
replaceContextTransaction(Transaction.Created transaction) |
Transaction.Created |
replaceContextTransaction(Transaction.Created transaction,
ActionListener actionListener,
boolean delegatedXa) |
void |
setActionListener(ActionListener actionListener)
Sets a new
ActionListener to receive events. |
void |
setFifo(boolean enabled)
Sets FIFO mode for proxy.
|
void |
setOptimisticLocking(boolean enabled)
Enable/Disable Optimistic Lock protocol.
|
int |
setReadModifiers(int modifiers)
Sets the read mode modifiers for proxy level.
|
int |
setUpdateModifiers(int modifiers)
Sets the update mode modifiers for proxy level.
|
String |
toString() |
void |
verifyProjectionsAreSupported(AbstractProjectionTemplate projectionTemplate) |
aggregate, applyNotifyInfoDefaults, asyncAddIndexes, asyncChange, asyncRead, asyncTake, change, checkIfConnected, clear, clear, count, count, createActionManager, dropClass, 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, writeMultiple
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNotificationsDirectProxy
getCacheTypeName
protected final org.slf4j.Logger _logger
protected final String _cacheID
protected AbstractSpaceCacheContainer(IDirectSpaceProxy remoteProxy, SpaceCacheConfig config)
protected abstract org.slf4j.Logger initLogger()
public void verifyProjectionsAreSupported(AbstractProjectionTemplate projectionTemplate)
public String getCacheId()
public SpaceCacheState getCacheState()
public abstract SpaceCacheConfig getCacheConfig()
protected void finalize() throws Throwable
public void close()
ISpaceCache
close
in interface ISpaceCache
close
in interface ISpaceProxy
public AbstractSpaceCache assertCacheConnected() throws SpaceCacheException
SpaceCacheException
public IDirectSpaceProxy getLocalSpace()
ISpaceCache
getLocalSpace
in interface ISpaceCache
getLocalSpace
in class AbstractSpaceProxy
public IDirectSpaceProxy getRemoteSpace()
ISpaceCache
getRemoteSpace
in interface ISpaceCache
getRemoteSpace
in class AbstractSpaceProxy
public void initialize() throws SpaceCacheInitializationException
public void onCacheFailure(AbstractSpaceCache failedCache)
protected abstract AbstractSpaceCache createSpaceCache() throws SpaceCacheInitializationException
public boolean isEmbedded()
IJSpace
isEmbedded
in interface IJSpace
public boolean isClustered()
ISpaceProxy
isClustered
in interface ISpaceProxy
public boolean isSecured()
IJSpace
public boolean isServiceSecured() throws RemoteException
SecuredService
true
.isServiceSecured
in interface SecuredService
true
if secured; false
otherwise.RemoteException
- communication-related exceptions that may occur during the execution
of a remote method call.public boolean isStartedWithinGSC() throws RemoteException
IJSpace
isStartedWithinGSC
in interface IJSpace
RemoteException
public String getName()
IJSpace
public SpaceURL getFinderURL()
IJSpace
SpaceURL
object which was used as the argument for SpaceFinder.find(SpaceURL)
while looking for the space. If a client uses this SpaceURL
when it calls to SpaceFinder.find(SpaceURL)
it should be able to find that
space.
Notice: The SpaceURL
returned when calling getURL() is different since in that case
it returns the SpaceURL
used to initialize the space (a java:// protocol to start an
embedded space).getFinderURL
in interface IJSpace
SpaceURL
object which can be used to find the space proxy while calling
SpaceFinder.find(SpaceURL)
public SpaceURL getURL()
IJSpace
SpaceURL
instance which was used to initialize the space.public Uuid getReferentUuid()
IJSpace
Uuid
of this space instance.getReferentUuid
in interface IJSpace
public Object getAdmin() throws RemoteException
IJSpace
// get a list of classes and the number of entries of each class
IRemoteJSpaceAdmin
remoteAdmin =
(IRemoteJSpaceAdmin)serverAdmin.getAdmin();
Object classList[] = remoteAdmin.getRuntimeInfo().m_ClassNames.toArray();
List numOFEntries = remoteAdmin.getRuntimeInfo().m_NumOFEntries;
getAdmin
in interface IJSpace
RemoteException
- if a communication error occurspublic IDirectSpaceProxy getDirectProxy()
IJSpace
getDirectProxy
in interface IJSpace
public Object getPrivilegedAdmin() throws RemoteException
getPrivilegedAdmin
in interface ISpaceProxy
RemoteException
IJSpace.getAdmin()
public boolean isFifo()
IJSpace
true
if this proxy FIFO enabled, otherwise false
.public void setFifo(boolean enabled)
IJSpace
public boolean isOptimisticLockingEnabled()
IJSpace
isOptimisticLockingEnabled
in interface IJSpace
public void setOptimisticLocking(boolean enabled)
IJSpace
setOptimisticLocking
in interface IJSpace
public int initWriteModifiers(int modifiers)
initWriteModifiers
in interface ISpaceProxy
public Transaction.Created getContextTransaction()
ISpaceProxy
getContextTransaction
in interface ISpaceProxy
public Transaction.Created replaceContextTransaction(Transaction.Created transaction)
replaceContextTransaction
in interface ISpaceProxy
public Transaction.Created replaceContextTransaction(Transaction.Created transaction, ActionListener actionListener, boolean delegatedXa)
replaceContextTransaction
in interface ISpaceProxy
public void setActionListener(ActionListener actionListener)
ActionMaker
ActionListener
to receive events. Replaces any former
ActionListener
if exists.setActionListener
in interface ActionMaker
public int getReadModifiers()
IJSpace
getReadModifiers
in interface IJSpace
public int setReadModifiers(int modifiers)
IJSpace
setReadModifiers
in interface IJSpace
public int getUpdateModifiers()
IJSpace
getUpdateModifiers
in interface IJSpace
public int setUpdateModifiers(int modifiers)
IJSpace
setUpdateModifiers
in interface IJSpace
public SecurityContext login(CredentialsProvider credentialsProvider) throws RemoteException
SecuredService
credentialsProvider
.login
in interface SecuredService
credentialsProvider
- provides credentials to be used for authentication.RemoteException
- communication-related exceptions that may occur during the
execution of a remote method call.public Class<?> loadRemoteClass(String className) throws ClassNotFoundException
ISpaceProxy
loadRemoteClass
in interface ISpaceProxy
ClassNotFoundException
public OperationID createNewOperationID()
ISpaceProxy
createNewOperationID
in interface ISpaceProxy
public Object readById(ReadTakeProxyActionInfo actionInfo) throws RemoteException, UnusableEntryException, TransactionException, InterruptedException
readById
in interface ISpaceProxy
readById
in class AbstractSpaceProxy
RemoteException
UnusableEntryException
TransactionException
InterruptedException
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
readById
in interface ISpaceProxy
readById
in class AbstractSpaceProxy
RemoteException
UnusableEntryException
TransactionException
InterruptedException
public boolean isCacheContainer()
isCacheContainer
in class AbstractSpaceProxy
protected void notifyLocalSpaceOnInternalStateChange(SpaceCacheState state)
Copyright © GigaSpaces.