C# 클래스 Castle.ActiveRecord.Framework.Scopes.AbstractScope

Abstract ISessionScope implementation
상속: System.MarshalByRefObject, ISessionScope
파일 보기 프로젝트 열기: nats/castle-1.0.3-mono 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
key2Session ISession>.IDictionary

공개 메소드들

메소드 설명
AbstractScope ( FlushAction flushAction, SessionScopeType type ) : System

Initializes a new instance of the AbstractScope class.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

FailSession ( ISession session ) : void

Marks the session as failed

Flush ( ) : void

Flushes the sessions that this scope is maintaining

GetSession ( object key ) : ISession

This method should return the session instance associated with the key.

IsKeyKnown ( object key ) : bool

This method is invoked when the Castle.ActiveRecord.Framework.ISessionFactoryHolder instance needs a session instance. Instead of creating one it interrogates the active scope for one. The scope implementation must check if it has a session registered for the given key. RegisterSession

OpenSession ( ISessionFactory sessionFactory, IInterceptor interceptor ) : ISession

If the WantsToCreateTheSession returned true then this method is invoked to allow the scope to create a properly configured session

RegisterSession ( object key, ISession session ) : void

This method is invoked when no session was available at and the Castle.ActiveRecord.Framework.ISessionFactoryHolder just created one. So it registers the session created within this scope using a key. The scope implementation shouldn't make any assumption on what the key actually is as we reserve the right to change it IsKeyKnown

보호된 메소드들

메소드 설명
DiscardSessions ( ICollection sessions ) : void

Discards the sessions.

Initialize ( ISession session ) : void

Initializes the specified session.

PerformDisposal ( ICollection sessions ) : void

Performs the disposal.

PerformDisposal ( ICollection sessions, bool flush, bool close ) : void

Performs the disposal.

SetFlushMode ( ISession session ) : void

Sets the flush mode.

비공개 메소드들

메소드 설명
GetSessions ( ) : ICollection

Gets the sessions.

RemoveSession ( ISession session ) : void

Removes the session.

메소드 상세

AbstractScope() 공개 메소드

Initializes a new instance of the AbstractScope class.
public AbstractScope ( FlushAction flushAction, SessionScopeType type ) : System
flushAction FlushAction The flush action.
type SessionScopeType The type.
리턴 System

DiscardSessions() 보호된 메소드

Discards the sessions.
protected DiscardSessions ( ICollection sessions ) : void
sessions ICollection The sessions.
리턴 void

Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
리턴 void

FailSession() 공개 추상적인 메소드

Marks the session as failed
public abstract FailSession ( ISession session ) : void
session ISession The session
리턴 void

Flush() 공개 메소드

Flushes the sessions that this scope is maintaining
public Flush ( ) : void
리턴 void

GetSession() 공개 메소드

This method should return the session instance associated with the key.
public GetSession ( object key ) : ISession
key object an object instance
리턴 ISession

Initialize() 보호된 메소드

Initializes the specified session.
protected Initialize ( ISession session ) : void
session ISession The session.
리턴 void

IsKeyKnown() 공개 메소드

This method is invoked when the Castle.ActiveRecord.Framework.ISessionFactoryHolder instance needs a session instance. Instead of creating one it interrogates the active scope for one. The scope implementation must check if it has a session registered for the given key. RegisterSession
public IsKeyKnown ( object key ) : bool
key object an object instance
리턴 bool

OpenSession() 공개 메소드

If the WantsToCreateTheSession returned true then this method is invoked to allow the scope to create a properly configured session
public OpenSession ( ISessionFactory sessionFactory, IInterceptor interceptor ) : ISession
sessionFactory ISessionFactory From where to open the session
interceptor IInterceptor the NHibernate interceptor
리턴 ISession

PerformDisposal() 보호된 메소드

Performs the disposal.
protected PerformDisposal ( ICollection sessions ) : void
sessions ICollection The sessions.
리턴 void

PerformDisposal() 보호된 메소드

Performs the disposal.
protected PerformDisposal ( ICollection sessions, bool flush, bool close ) : void
sessions ICollection The sessions.
flush bool if set to true [flush].
close bool if set to true [close].
리턴 void

RegisterSession() 공개 메소드

This method is invoked when no session was available at and the Castle.ActiveRecord.Framework.ISessionFactoryHolder just created one. So it registers the session created within this scope using a key. The scope implementation shouldn't make any assumption on what the key actually is as we reserve the right to change it IsKeyKnown
public RegisterSession ( object key, ISession session ) : void
key object an object instance
session ISession An instance of ISession
리턴 void

SetFlushMode() 보호된 메소드

Sets the flush mode.
protected SetFlushMode ( ISession session ) : void
session ISession The session.
리턴 void

프로퍼티 상세

key2Session 보호되어 있는 프로퍼티

Map between a key to its session
protected IDictionary key2Session
리턴 ISession>.IDictionary