public Session(Connection connection, SessionId sessionId, AcknowledgementMode acknowledgementMode) { this.info = new SessionInfo(); this.info.SessionId = sessionId; this.connection = connection; this.connection.Oneway(this.info); this.acknowledgementMode = acknowledgementMode; this.requestTimeout = connection.RequestTimeout; this.dispatchAsync = connection.DispatchAsync; this.transactionContext = new TransactionContext(this); Uri brokerUri = connection.BrokerUri; // Set propertieDs on session using parameters prefixed with "session." if(!String.IsNullOrEmpty(brokerUri.Query) && !brokerUri.OriginalString.EndsWith(")")) { string query = brokerUri.Query.Substring(brokerUri.Query.LastIndexOf(")") + 1); StringDictionary options = URISupport.ParseQuery(query); options = URISupport.GetProperties(options, "session."); URISupport.SetProperties(this, options); } this.ConsumerTransformer = connection.ConsumerTransformer; this.ProducerTransformer = connection.ProducerTransformer; this.executor = new SessionExecutor(this, this.consumers); if(connection.IsStarted) { this.Start(); } connection.AddSession(this); }
public ProducerId( SessionId sessionId, long consumerId ) { this.connectionId = sessionId.ConnectionId; this.sessionId = sessionId.Value; this.value = consumerId; }
public NetTxSession(Connection connection, SessionId id) : base(connection, id, AcknowledgementMode.AutoAcknowledge) { TransactionContext.InitializeDtcTxContext(); }
public override Response processRemoveSession(SessionId id) { if(id != null) { ConnectionId connectionId = id.ParentId; if(connectionId != null) { ConnectionState cs = connectionStates[connectionId]; if(cs != null) { cs.removeSession(id); } } } return TRACKED_RESPONSE_MARKER; }
public virtual Response processRemoveSession(SessionId id) { return null; }
public override Response processRemoveSession(SessionId id) { if(id != null) { ConnectionId connectionId = id.ParentId; if(connectionId != null) { ConnectionState cs = null; if(connectionStates.TryGetValue(connectionId, out cs)) { cs.removeSession(id); } } } return TRACKED_RESPONSE_MARKER; }
public SessionInfo(ConnectionInfo connectionInfo, long sessionId) { this.sessionId = new SessionId(connectionInfo.ConnectionId, sessionId); }
public SessionState removeSession(SessionId id) { SessionState ret = sessions[id]; sessions.Remove(id); return ret; }
public SessionState this[SessionId id] { get { #if DEBUG try { #endif return sessions[id]; #if DEBUG } catch(System.Collections.Generic.KeyNotFoundException) { // Useful for dignosing missing session ids string sessionList = string.Empty; foreach(SessionId sessionId in sessions.Keys) { sessionList += sessionId.ToString() + "\n"; } System.Diagnostics.Debug.Assert(false, string.Format("Session '{0}' did not exist in the sessions collection.\n\nSessions:-\n{1}", id, sessionList)); throw; } #endif } }
public SessionState removeSession(SessionId id) { SessionState ret = null; sessions.TryGetValue(id, out ret); sessions.Remove(id); return ret; }
public SessionState this[SessionId id] { get { SessionState sessionState; if(sessions.TryGetValue(id, out sessionState)) { return sessionState; } #if DEBUG // Useful for dignosing missing session ids string sessionList = string.Empty; foreach(SessionId sessionId in sessions.Keys) { sessionList += sessionId.ToString() + "\n"; } System.Diagnostics.Debug.Assert(false, string.Format("Session '{0}' did not exist in the sessions collection.\n\nSessions:-\n{1}", id, sessionList)); #endif return null; } }