C# 클래스 Amnesia.Session

상속: IDisposable
파일 보기 프로젝트 열기: vc3/Amnesia

Private Properties

프로퍼티 타입 설명
CloseConnections void
LogResponse void
LogResponse void
RaiseAfterSessionEnded void

공개 메소드들

메소드 설명
Dispose ( ) : void
GetConnection ( string connectionString, DbConnection>.Func createConnection ) : IDbConnection

Gets or creates a connection that can be used with the current session. If there is no active session, null is returned. This connection can and should be shared across threads for transaction rollbacks to work properly.

LockConnection ( IDbConnection connection ) : IDisposable

Because session connections can be shared across threads access to them must be synchronized. For normal connections that are not part of a distributed transaction no locking is performed for better performance.

NewAsyncActivity ( ) : IAsyncActivity

Registers an activity with the session. This method only needs to be called on threads that are not tied to an HttpContext.

NewParallelActivity ( ) : IParallelActivity

Registers an multithreaded activity with the session that will execute synchronously relative to the current activity already underway. In other words, the parallel activity must complete prior to the current activity completing (unlike NewAsyncActivity).

PrepareForDispose ( ) : void
ResetServer ( string serviceUrl, ILog log ) : void

Ensures that there is not an open session. Typically sessions should be ended by calling Dispose() but this can be used at the very start of a test to ensure that the system is in a known state.

Session ( Uri appUrl ) : System

Starts a new Amnesia session with a remote application

Session ( Uri appUrl, ILog log ) : System

Starts a new Amnesia session with a remote application

Session ( string appUrl ) : System

Starts a new Amnesia session with a remote application

Session ( string appUrl, ILog log ) : System

Starts a new Amnesia session with a remote application

비공개 메소드들

메소드 설명
CloseConnections ( ILog log ) : void

Closes all database connections associated with the session.

LogResponse ( Handler response ) : void
LogResponse ( Handler response, ILog log ) : void
RaiseAfterSessionEnded ( ) : void

Called by a single thread when the session has ended

메소드 상세

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

GetConnection() 공개 정적인 메소드

Gets or creates a connection that can be used with the current session. If there is no active session, null is returned. This connection can and should be shared across threads for transaction rollbacks to work properly.
public static GetConnection ( string connectionString, DbConnection>.Func createConnection ) : IDbConnection
connectionString string
createConnection DbConnection>.Func
리턴 IDbConnection

LockConnection() 공개 정적인 메소드

Because session connections can be shared across threads access to them must be synchronized. For normal connections that are not part of a distributed transaction no locking is performed for better performance.
public static LockConnection ( IDbConnection connection ) : IDisposable
connection IDbConnection
리턴 IDisposable

NewAsyncActivity() 공개 정적인 메소드

Registers an activity with the session. This method only needs to be called on threads that are not tied to an HttpContext.
public static NewAsyncActivity ( ) : IAsyncActivity
리턴 IAsyncActivity

NewParallelActivity() 공개 정적인 메소드

Registers an multithreaded activity with the session that will execute synchronously relative to the current activity already underway. In other words, the parallel activity must complete prior to the current activity completing (unlike NewAsyncActivity).
public static NewParallelActivity ( ) : IParallelActivity
리턴 IParallelActivity

PrepareForDispose() 공개 메소드

public PrepareForDispose ( ) : void
리턴 void

ResetServer() 공개 정적인 메소드

Ensures that there is not an open session. Typically sessions should be ended by calling Dispose() but this can be used at the very start of a test to ensure that the system is in a known state.
public static ResetServer ( string serviceUrl, ILog log ) : void
serviceUrl string
log ILog
리턴 void

Session() 공개 메소드

Starts a new Amnesia session with a remote application
public Session ( Uri appUrl ) : System
appUrl System.Uri
리턴 System

Session() 공개 메소드

Starts a new Amnesia session with a remote application
public Session ( Uri appUrl, ILog log ) : System
appUrl System.Uri
log ILog
리턴 System

Session() 공개 메소드

Starts a new Amnesia session with a remote application
public Session ( string appUrl ) : System
appUrl string
리턴 System

Session() 공개 메소드

Starts a new Amnesia session with a remote application
public Session ( string appUrl, ILog log ) : System
appUrl string
log ILog
리턴 System