Skip to content

Commit

Permalink
modify dispatcher to use new middleware executor implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
zamronypj committed Feb 17, 2022
1 parent 95dcd10 commit eaf8376
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/Dispatcher/Factories/DispatcherFactoryImpl.pas
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ implementation

DispatcherImpl,
RequestResponseFactoryImpl,
MiddlewareExecutorImpl;
MiddlewareExecutorImpl,
WithExceptMiddlewareExecutorImpl;

constructor TDispatcherFactory.create(
const appMiddlewaresInst : IMiddlewareLinkList;
Expand All @@ -71,7 +72,9 @@ implementation

function TDispatcherFactory.createMiddlewareExecutor() : IMiddlewareExecutor;
begin
result := TMiddlewareExecutor.create(appMiddlewares);
result := TWithExceptMiddlewareExecutor.create(
TMiddlewareExecutor.create(appMiddlewares)
);
end;

function TDispatcherFactory.build(const container : IDependencyContainer) : IDependency;
Expand Down
6 changes: 3 additions & 3 deletions src/Dispatcher/Factories/SessionDispatcherFactoryImpl.pas
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ implementation
end;

function TSessionDispatcherFactory.createMiddlewareExecutor() : IMiddlewareExecutor;
var actualFactory : IMiddlewareExecutor;
var actualExecutor : IMiddlewareExecutor;
begin
actualFactory := inherited createMiddlewareExecutor();
actualExecutor := inherited createMiddlewareExecutor();
result := TSessionMiddlewareExecutor.create(
actualFactory,
actualExecutor,
fSessionMgr,
fCookieFactory,
fExpiresInSec
Expand Down

0 comments on commit eaf8376

Please sign in to comment.