|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.resoa.node.core.ResoaBaseGateway
public abstract class ResoaBaseGateway
ResoaBaseGateway class implements common grid connection functionality for nodes of all types
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.resoa.grid.ResoaGateway |
|---|
org.resoa.grid.ResoaGateway.ControllerGateway, org.resoa.grid.ResoaGateway.GatewayRunner |
| Field Summary | |
|---|---|
protected int |
executionExceptions
|
protected org.resoa.grid.ResoaGateway.GatewayRunner |
gatewayRunner
The ResoaNode wrapper for runtime |
protected java.util.List<org.resoa.stack.config.StackProfile> |
initialControllers
node friends' profiles, interpreted as potential Controllers inside the grid |
protected org.resoa.stack.config.StackProfile |
localProfile
stackProfile of node itself |
protected java.util.concurrent.locks.ReentrantLock |
lockConnection
synchronization object for connections |
protected java.util.concurrent.locks.ReentrantLock |
lockNodeState
synchronization object for NodeState |
protected java.util.concurrent.locks.ReentrantLock |
lockResoaUpdate
synchronization object for Deployment Update and Service caching |
protected static org.slf4j.Logger |
logger
The central node logger instance |
protected NodeDomainRelationManager<?> |
nodeDomains
The manager of the grid nodes and their deployed service domains |
protected org.resoa.grid.ResoaNodeType |
nodeType
The node type |
protected java.util.Vector<org.resoa.grid.Message> |
pendingMessages
Cache of all message sends, run into SystemOverloadException |
protected int |
permissionExceptions
|
protected java.util.HashMap<java.lang.String,java.lang.String> |
properties
Maps of properties |
protected org.resoa.util.ResoaClassLoader |
rcl
The ClassLoader instance |
protected int |
requestExceptions
|
protected boolean |
running
|
protected ResoaSecurity |
security
resoaSecurity handler |
protected int |
sessionExceptions
|
protected org.resoa.stack.Stack |
stack
protocol stack handler |
| Fields inherited from interface org.resoa.grid.ResoaGateway |
|---|
DOMAIN_PERSISTENCE, DOMAIN_TOPOLOGY, PROP_CONTROLLERDATAPATH, RESOAINFO_FILE, ResoaNodeTimeout, ROLE_CONTROLLER, ROLE_GRID, STACKCONFIG_FILE |
| Constructor Summary | |
|---|---|
protected |
ResoaBaseGateway()
Constructor for Gateway without Resoa Grid Functionality |
|
ResoaBaseGateway(java.lang.String configPath,
T domainType)
Constructor reads config and license file and initializes internal objects and handlers |
| Method Summary | |
|---|---|
protected void |
addMessageToPending(org.resoa.grid.Message msg)
Cache a message for later sending |
protected void |
afterGridConnection(boolean isUpdate)
Event after the container connects to grid nodes |
protected void |
beforeGridConnection(boolean isUpdate)
Event before the container connects to grid nodes |
protected abstract void |
beforeNodeStop(boolean waitForPoolThreadsEnd)
Implement service stops |
void |
connectToInitialController()
Connects to resoaInfo listed Controllers protected void connectToControllers (){ // connect to all controllers, listed in ResoaInfo List |
protected org.resoa.grid.GridSession |
connectToNode(ResoaNodeHandle node)
Connect to all known nodes, where the deployment information requires connection to protected void connectToGridNodes(){ // we request nodes, we must hold connections to List |
java.lang.String |
getConfigurationPath()
|
java.util.List<java.lang.String> |
getConnectedProfiles()
Returns a List of connected profiles |
org.resoa.grid.GridSession |
getControllerSession()
Returns a handle to a connected controller session |
java.util.List<ResoaNodeHandle> |
getDomainNodes(java.lang.String domain)
Returns the grid session to nodes, serving on the same domain |
int |
getErrorCodeFromException(java.lang.Throwable th)
Maps an ResoaException to a HTTPStatusCode |
protected java.util.List<ResoaNodeHandle> |
getGridConnectionsNodes()
Generate a list of nodes, we need to connect to |
org.resoa.stack.config.StackProfile |
getLocalProfile()
The local stack profile |
org.slf4j.Logger |
getLogger()
|
ResoaNodeHandle |
getNodeHandle(java.lang.String profileName)
Returns the node handle of a stack profile name |
org.resoa.topology.NodeState |
getNodeState()
Returns status data of the node (monitoring data) |
org.resoa.grid.ResoaNodeType |
getNodeType()
|
org.resoa.stack.Stack |
getStack()
Returns ResoaStack instance |
protected org.resoa.grid.Transaction.TransactionState |
getTransactionState(boolean isTransactionRequest,
org.resoa.grid.ResoaResponse.ResponseAction action)
Adapts the transaction state of a message, according to desired response action |
void |
indicateTransactionError(org.resoa.grid.Message msg,
org.resoa.grid.ResoaStackChannel channel,
java.lang.String errorMsg,
java.lang.Throwable th)
Indicates an error to the requesting session, in case it was a transaction request |
boolean |
isAccessPoint()
Returns true if node acts as AccesPoint (means, other can connect to). |
boolean |
isRunning()
Returns true if the gateway is up and running |
protected ResoaNodeHandle |
onSessionInitialized(org.resoa.grid.GridSession session)
Gets invoked on session initialized. |
void |
removeIdleSessions()
|
abstract org.resoa.topology.RestSession |
requestRestSessionFromController(org.resoa.topology.RestSession session)
Request RestSession handle from Controller. |
void |
sendPendingMessage()
Send pending message (formerly run into SystemOverloadException) |
void |
sessionDisconnected(org.resoa.grid.GridSession session)
|
void |
sessionInitialized(org.resoa.grid.GridSession session)
|
protected void |
setConfigurationPath(java.lang.String configPath)
|
void |
setGatewayRunner(org.resoa.grid.ResoaGateway.GatewayRunner runner)
|
void |
stop(boolean waitForPoolThreadsEnd)
|
protected abstract void |
updateMonitoring(org.resoa.topology.NodeState state)
Update monitoring data within locked state |
org.resoa.grid.ResoaInfoState |
updateResoaInfo(org.resoa.topology.ResoaInfo newResoaInfo,
boolean refreshClassLoader)
Process a new arrived ResoaInfo and updates deployment information of the node |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.resoa.grid.ResoaGateway |
|---|
broadcastToControllers, broadcastToDomainNodes, createRestSession, executeService, executeService, getPersistor, getRestSession, getServiceImplementation, isDeployed, performTransaction, removeRestSession, sendMessage |
| Methods inherited from interface org.resoa.stack.StackChannelProcessor |
|---|
onMessage, onTransactionDelay, readChannel, writeChannel |
| Field Detail |
|---|
protected static org.slf4j.Logger logger
protected org.resoa.grid.ResoaGateway.GatewayRunner gatewayRunner
protected org.resoa.stack.Stack stack
protected org.resoa.stack.config.StackProfile localProfile
protected org.resoa.grid.ResoaNodeType nodeType
protected ResoaSecurity security
protected org.resoa.util.ResoaClassLoader rcl
protected NodeDomainRelationManager<?> nodeDomains
protected java.util.List<org.resoa.stack.config.StackProfile> initialControllers
protected java.util.HashMap<java.lang.String,java.lang.String> properties
protected java.util.Vector<org.resoa.grid.Message> pendingMessages
protected java.util.concurrent.locks.ReentrantLock lockResoaUpdate
protected java.util.concurrent.locks.ReentrantLock lockConnection
protected java.util.concurrent.locks.ReentrantLock lockNodeState
protected volatile int sessionExceptions
protected volatile int permissionExceptions
protected volatile int requestExceptions
protected volatile int executionExceptions
protected volatile boolean running
| Constructor Detail |
|---|
protected ResoaBaseGateway()
public ResoaBaseGateway(java.lang.String configPath,
T domainType)
throws org.resoa.exception.ResoaException
configPath - path to node config directory
org.resoa.exception.ResoaException| Method Detail |
|---|
public boolean isAccessPoint()
public void setGatewayRunner(org.resoa.grid.ResoaGateway.GatewayRunner runner)
setGatewayRunner in interface org.resoa.grid.ResoaGatewaypublic org.resoa.stack.Stack getStack()
public org.resoa.stack.config.StackProfile getLocalProfile()
getLocalProfile in interface org.resoa.grid.ResoaGatewaypublic org.resoa.grid.ResoaNodeType getNodeType()
getNodeType in interface org.resoa.grid.ResoaGatewaypublic java.lang.String getConfigurationPath()
getConfigurationPath in interface org.resoa.grid.ResoaGatewayprotected void setConfigurationPath(java.lang.String configPath)
configPath - the configurationPath to setpublic boolean isRunning()
isRunning in interface org.resoa.grid.ResoaGatewayResoaGateway.isRunning()public void removeIdleSessions()
removeIdleSessions in interface org.resoa.grid.ResoaGatewaypublic void stop(boolean waitForPoolThreadsEnd)
stop in interface org.resoa.grid.ResoaGatewayprotected abstract void beforeNodeStop(boolean waitForPoolThreadsEnd)
waitForPoolThreadsEnd - public java.util.List<java.lang.String> getConnectedProfiles()
protected org.resoa.grid.GridSession connectToNode(ResoaNodeHandle node)
node - the remote node handle
public void connectToInitialController()
throws org.resoa.exception.ResoaException
connectToInitialController in interface org.resoa.grid.ResoaGatewayorg.resoa.exception.ResoaExceptionprotected void addMessageToPending(org.resoa.grid.Message msg)
msg - public void sendPendingMessage()
public ResoaNodeHandle getNodeHandle(java.lang.String profileName)
profileName - the profile name of the node
public java.util.List<ResoaNodeHandle> getDomainNodes(java.lang.String domain)
domain - the service(jar) domain
public org.resoa.grid.GridSession getControllerSession()
public void sessionInitialized(org.resoa.grid.GridSession session)
sessionInitialized in interface org.resoa.stack.Callbacks.SessionStateprotected ResoaNodeHandle onSessionInitialized(org.resoa.grid.GridSession session)
session - the session
public void sessionDisconnected(org.resoa.grid.GridSession session)
sessionDisconnected in interface org.resoa.stack.Callbacks.SessionStateprotected java.util.List<ResoaNodeHandle> getGridConnectionsNodes()
public org.resoa.grid.ResoaInfoState updateResoaInfo(org.resoa.topology.ResoaInfo newResoaInfo,
boolean refreshClassLoader)
updateResoaInfo in interface org.resoa.grid.ResoaGatewaynewResoaInfo - the new ResoaInforefreshClassLoader - true if the resoa classloader should be refreshedprotected void beforeGridConnection(boolean isUpdate)
isUpdate - true, if the connection is caused by an updateprotected void afterGridConnection(boolean isUpdate)
isUpdate - true, if the connection is caused by an updatepublic abstract org.resoa.topology.RestSession requestRestSessionFromController(org.resoa.topology.RestSession session)
session -
protected org.resoa.grid.Transaction.TransactionState getTransactionState(boolean isTransactionRequest,
org.resoa.grid.ResoaResponse.ResponseAction action)
isTransactionRequest - true, if request was performed within transactional cotnextaction - the actionpublic int getErrorCodeFromException(java.lang.Throwable th)
th - the exception
public void indicateTransactionError(org.resoa.grid.Message msg,
org.resoa.grid.ResoaStackChannel channel,
java.lang.String errorMsg,
java.lang.Throwable th)
msg - the messagechannel - the underlying stack channel instanceerrorMsg - the error messageth - the causing exceptionpublic org.resoa.topology.NodeState getNodeState()
getNodeState in interface org.resoa.grid.ResoaGatewayResoaGateway.getNodeState()protected abstract void updateMonitoring(org.resoa.topology.NodeState state)
state - public org.slf4j.Logger getLogger()
getLogger in interface org.resoa.grid.ResoaGateway
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||