// The user either tries to access the application using a relative request
// or the session context has timed out.
// Log and create an exception
String msg = LogUtil.error(getClass(), "Session does not have a current position or session has expired for socket reference $0. [{1}]", ref, context);
throw new EngineException("NoCurrentPosition", msg);
}
// Try to determine the socket to start with using the usual socket search strategy
if (ref != null)
{
Node currentNode = currentSocket.getNode();
String socketName;
int index = ref.indexOf(ModelQualifier.OBJECT_DELIMITER_CHAR);
if (index >= 0)
{
// "Node.Socket"
String nodeName = ref.substring (0, index);
socketName = ref.substring(index + 1);
currentNode = currentSocket.getProcess().getNodeByName(nodeName);
if (currentNode == null)
{
String msg = LogUtil.error(getClass(), "Initial node $0 not found (position reference: $1). [{2}]", nodeName, ref, context);
throw new ModelException("NodeNotFound", msg);
}
if (! (currentNode instanceof InitialNode))
{
String msg = LogUtil.error(getClass(), "Node $0 is not an initial node (position reference: $1). [{2}]", currentNode.getQualifier(), ref, context);
throw new ModelException("NoInitialNode", msg);
}
}
else if (index == 0)
{
// ".Socket"
socketName = ref.substring(1);
}
else
{
// "Socket"
socketName = ref;
}
startSocket = currentNode.getSocketByName(socketName);
if (startSocket == null)
{
if (mustExist)
{
String msg = LogUtil.error(getClass(), "Exit socket $0 not found. [{1}]", socketName, context);
throw new EngineException("NoExitSocket", msg);
}
}
}
else
{