85 |
|
FAttachment: IAttachment; |
86 |
|
FTransaction: ITransaction; |
87 |
|
public |
88 |
< |
procedure Assign(src: Firebird.IExternalContext); |
88 |
> |
constructor Create(aController: TFBUDRController; context: Firebird.IExternalContext); |
89 |
|
function AsText: AnsiString; |
90 |
|
public |
91 |
|
{IFBUDRExternalContext} |
247 |
|
Result := ValTrue |
248 |
|
else |
249 |
|
Result := ValFalse; |
250 |
< |
end; |
251 |
< |
|
250 |
> |
end; |
251 |
> |
|
252 |
|
{ TFBUDRMessageMetadata } |
253 |
|
|
254 |
|
constructor TFBUDRMessageMetadata.Create(context: IFBUDRExternalContext; |
549 |
|
|
550 |
|
{ TFBUDRExternalContext } |
551 |
|
|
552 |
< |
procedure TFBUDRExternalContext.Assign(src: Firebird.IExternalContext); |
553 |
< |
|
554 |
< |
function SameTransaction: boolean; |
555 |
< |
var tr1, tr2: Firebird.ITransaction; |
556 |
< |
begin |
557 |
< |
Result := false; |
558 |
< |
if FContext = nil then Exit; |
559 |
< |
tr1 := src.getTransaction(FStatus); |
560 |
< |
CheckStatus; |
561 |
< |
tr2 := FContext.getTransaction(FStatus); |
562 |
< |
CheckStatus; |
563 |
< |
Result := tr1 = tr2; |
564 |
< |
end; |
565 |
< |
|
566 |
< |
function SameAttachment: boolean; |
567 |
< |
var at1, at2: Firebird.IAttachment; |
568 |
< |
begin |
569 |
< |
Result := false; |
570 |
< |
if FContext = nil then Exit; |
571 |
< |
at1 := src.getAttachment(FStatus); |
572 |
< |
CheckStatus; |
573 |
< |
at2 := FContext.getAttachment(FStatus); |
574 |
< |
CheckStatus; |
575 |
< |
Result := at1 = at2; |
576 |
< |
end; |
577 |
< |
|
552 |
> |
constructor TFBUDRExternalContext.Create(aController: TFBUDRController; |
553 |
> |
context: Firebird.IExternalContext); |
554 |
|
begin |
555 |
< |
if src = FContext then Exit; |
556 |
< |
|
557 |
< |
if src = nil then |
582 |
< |
begin |
583 |
< |
FirebirdAPI := nil; |
584 |
< |
FTransaction := nil; |
585 |
< |
FAttachment := nil; |
586 |
< |
FContext := nil; |
587 |
< |
end |
588 |
< |
else |
589 |
< |
begin |
590 |
< |
if (FContext = nil) or (src.getMaster() <> FContext.getMaster) then |
591 |
< |
FirebirdAPI := TFB30ClientAPI.Create(src.getMaster); |
592 |
< |
|
593 |
< |
if not SameTransaction then |
594 |
< |
FTransaction := nil; |
595 |
< |
|
596 |
< |
if not SameAttachment then |
597 |
< |
FAttachment := nil; |
598 |
< |
|
599 |
< |
FContext := src; |
600 |
< |
end; |
555 |
> |
inherited Create(aController); |
556 |
> |
FContext := context; |
557 |
> |
FirebirdAPI := TFB30ClientAPI.Create(context.getMaster); |
558 |
|
end; |
559 |
|
|
560 |
|
function TFBUDRExternalContext.AsText: AnsiString; |
631 |
|
|
632 |
|
function TFBUDRExternalContext.HasConfigFile: boolean; |
633 |
|
begin |
634 |
< |
|
634 |
> |
Result := Controller.HasConfigFile; |
635 |
|
end; |
636 |
|
|
637 |
|
function TFBUDRExternalContext.ReadConfigString(Section, Ident, |
638 |
|
DefaultValue: AnsiString): AnsiString; |
639 |
|
begin |
640 |
< |
Result := FController.ReadConfigString(Section, Ident, DefaultValue); |
640 |
> |
Result := Controller.ReadConfigString(Section, Ident, DefaultValue); |
641 |
|
end; |
642 |
|
|
643 |
|
function TFBUDRExternalContext.ReadConfigInteger(Section, Ident: AnsiString; |
644 |
|
DefaultValue: integer): integer; |
645 |
|
begin |
646 |
< |
Result := FController.ReadConfigInteger(Section, Ident, DefaultValue); |
646 |
> |
Result := Controller.ReadConfigInteger(Section, Ident, DefaultValue); |
647 |
|
end; |
648 |
|
|
649 |
|
function TFBUDRExternalContext.ReadConfigBool(Section, Ident: AnsiString; |
650 |
|
DefaultValue: boolean): boolean; |
651 |
|
begin |
652 |
< |
Result := FController.ReadConfigBool(Section, Ident, DefaultValue); |
652 |
> |
Result := Controller.ReadConfigBool(Section, Ident, DefaultValue); |
653 |
|
end; |
654 |
|
|
655 |
|
procedure TFBUDRExternalContext.WriteToLog(Msg: AnsiString); |
656 |
|
begin |
657 |
< |
FController.WriteToLog(Msg); |
657 |
> |
Controller.WriteToLog(Msg); |
658 |
|
end; |
659 |
|
|
660 |
|
|