Package org.apache.ignite.internal
Interface GridKernalGateway
-
- All Known Implementing Classes:
GridKernalGatewayImpl
@GridToStringExclude public interface GridKernalGateway
This interface guards access to implementations of public methods that access kernal functionality from the following main API interfaces: Note that this kernal gateway should not be used to guard against method from the following non-rich interfaces since their implementations are already managed by their respective implementing classes: Kernal gateway is also responsible for notifying various futures about the change in kernal state so that issued futures could properly interrupt themselves when kernal becomes unavailable while future is held externally by the user.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GridKernalStategetState()Gets current kernal state.@Nullable GridFutureAdapter<?>onDisconnected()Disconnected callback.voidonReconnected()Reconnected callback.voidreadLock()Should be called on entering every kernal related call originated directly or indirectly via public API.voidreadLockAnyway()Same asreadLock()but doesn't throw IllegalStateException if grid stop.voidreadUnlock()Should be called on leaving every kernal related call originated directly or indirectly via public API.voidsetState(GridKernalState state)Sets kernal state.booleantryWriteLock(long timeout)StringuserStackTrace()Gets user stack trace through the first call of grid public API.voidwriteLock()This method waits for all current calls to exit and blocks any furtherreadLock()calls untilwriteUnlock()method is called.voidwriteUnlock()This method unblockswriteLock().
-
-
-
Method Detail
-
readLock
void readLock() throws IllegalStateExceptionShould be called on entering every kernal related call originated directly or indirectly via public API.This method essentially acquires a read lock and multiple threads can enter the call without blocking.
- Throws:
IllegalStateException- Thrown in case when no kernal calls are allowed.- See Also:
readUnlock()
-
readLockAnyway
void readLockAnyway()
Same asreadLock()but doesn't throw IllegalStateException if grid stop.
-
setState
void setState(GridKernalState state)
Sets kernal state. Various kernal states drive the logic inside of the gateway.- Parameters:
state- Kernal state to set.
-
getState
GridKernalState getState()
Gets current kernal state.- Returns:
- Kernal state.
-
readUnlock
void readUnlock()
Should be called on leaving every kernal related call originated directly or indirectly via public API.This method essentially releases the internal read-lock acquired previously by
readLock()method.- See Also:
readLock()
-
writeLock
void writeLock()
This method waits for all current calls to exit and blocks any furtherreadLock()calls untilwriteUnlock()method is called.This method essentially acquires the internal write lock.
-
writeUnlock
void writeUnlock()
This method unblockswriteLock().This method essentially releases internal write lock previously acquired by
writeLock()method.
-
userStackTrace
String userStackTrace()
Gets user stack trace through the first call of grid public API.- Returns:
- User stack trace.
-
tryWriteLock
boolean tryWriteLock(long timeout) throws InterruptedException- Parameters:
timeout- Timeout.- Returns:
Trueif write lock has been acquired.- Throws:
InterruptedException- If interrupted.
-
onDisconnected
@Nullable @Nullable GridFutureAdapter<?> onDisconnected()
Disconnected callback.- Returns:
- Reconnect future.
-
onReconnected
void onReconnected()
Reconnected callback.
-
-