Package org.apache.ignite.internal
Class GridKernalGatewayImpl
- java.lang.Object
-
- org.apache.ignite.internal.GridKernalGatewayImpl
-
- All Implemented Interfaces:
Serializable,GridKernalGateway
@GridToStringExclude public class GridKernalGatewayImpl extends Object implements GridKernalGateway, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GridKernalGatewayImpl(String igniteInstanceName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GridKernalStategetState()Gets current kernal state.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 asGridKernalGateway.readLock()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.StringtoString()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 furtherGridKernalGateway.readLock()calls untilGridKernalGateway.writeUnlock()method is called.voidwriteUnlock()This method unblocksGridKernalGateway.writeLock().
-
-
-
Constructor Detail
-
GridKernalGatewayImpl
public GridKernalGatewayImpl(String igniteInstanceName)
- Parameters:
igniteInstanceName- Ignite instance name.
-
-
Method Detail
-
readLock
public void readLock() throws IgniteIllegalStateExceptionShould 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.
- Specified by:
readLockin interfaceGridKernalGateway- Throws:
IgniteIllegalStateException- See Also:
GridKernalGateway.readUnlock()
-
readLockAnyway
public void readLockAnyway()
Same asGridKernalGateway.readLock()but doesn't throw IllegalStateException if grid stop.- Specified by:
readLockAnywayin interfaceGridKernalGateway
-
readUnlock
public 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
GridKernalGateway.readLock()method.- Specified by:
readUnlockin interfaceGridKernalGateway- See Also:
GridKernalGateway.readLock()
-
writeLock
public void writeLock()
This method waits for all current calls to exit and blocks any furtherGridKernalGateway.readLock()calls untilGridKernalGateway.writeUnlock()method is called.This method essentially acquires the internal write lock.
- Specified by:
writeLockin interfaceGridKernalGateway
-
tryWriteLock
public boolean tryWriteLock(long timeout) throws InterruptedException- Specified by:
tryWriteLockin interfaceGridKernalGateway- Parameters:
timeout- Timeout.- Returns:
Trueif write lock has been acquired.- Throws:
InterruptedException- If interrupted.
-
onDisconnected
public GridFutureAdapter<?> onDisconnected()
Disconnected callback.- Specified by:
onDisconnectedin interfaceGridKernalGateway- Returns:
- Reconnect future.
-
onReconnected
public void onReconnected()
Reconnected callback.- Specified by:
onReconnectedin interfaceGridKernalGateway
-
writeUnlock
public void writeUnlock()
This method unblocksGridKernalGateway.writeLock().This method essentially releases internal write lock previously acquired by
GridKernalGateway.writeLock()method.- Specified by:
writeUnlockin interfaceGridKernalGateway
-
setState
public void setState(GridKernalState state)
Sets kernal state. Various kernal states drive the logic inside of the gateway.- Specified by:
setStatein interfaceGridKernalGateway- Parameters:
state- Kernal state to set.
-
getState
public GridKernalState getState()
Gets current kernal state.- Specified by:
getStatein interfaceGridKernalGateway- Returns:
- Kernal state.
-
userStackTrace
public String userStackTrace()
Gets user stack trace through the first call of grid public API.- Specified by:
userStackTracein interfaceGridKernalGateway- Returns:
- User stack trace.
-
-