|
@@ -1095,7 +1095,7 @@ begin
|
|
If Assigned(Owner) and ((AClassName='') or (CompareText(AClassName,Owner.name)=0)) then
|
|
If Assigned(Owner) and ((AClassName='') or (CompareText(AClassName,Owner.name)=0)) then
|
|
begin
|
|
begin
|
|
I:=0;
|
|
I:=0;
|
|
- While (Result=Nil) and (I<ComponentCount) do
|
|
|
|
|
|
+ While (Result=Nil) and (I<Owner.ComponentCount) do
|
|
begin
|
|
begin
|
|
C:=Owner.Components[i];
|
|
C:=Owner.Components[i];
|
|
If (C is TCustomJSONRPCHandler) and SameText(TCustomJSONRPCHandler(C).RPCMethodName,aMethodName) then
|
|
If (C is TCustomJSONRPCHandler) and SameText(TCustomJSONRPCHandler(C).RPCMethodName,aMethodName) then
|
|
@@ -1530,6 +1530,7 @@ Var
|
|
AClass : TCustomJSONRPCHandlerClass;
|
|
AClass : TCustomJSONRPCHandlerClass;
|
|
DM : TDataModule;
|
|
DM : TDataModule;
|
|
C : TComponent;
|
|
C : TComponent;
|
|
|
|
+ I : Integer;
|
|
|
|
|
|
begin
|
|
begin
|
|
Result:=Nil;
|
|
Result:=Nil;
|
|
@@ -1539,10 +1540,15 @@ begin
|
|
{$ifdef wmdebug}SendDebug(Format('Creating datamodule from class %d ',[Ord(Assigned(FDataModuleClass))]));{$endif}
|
|
{$ifdef wmdebug}SendDebug(Format('Creating datamodule from class %d ',[Ord(Assigned(FDataModuleClass))]));{$endif}
|
|
DM:=FDataModuleClass.Create(AOwner);
|
|
DM:=FDataModuleClass.Create(AOwner);
|
|
{$ifdef wmdebug}SendDebug(Format('Created datamodule from class %s ',[DM.ClassName]));{$endif}
|
|
{$ifdef wmdebug}SendDebug(Format('Created datamodule from class %s ',[DM.ClassName]));{$endif}
|
|
- C:=DM.FindComponent(FHandlerMethodName);
|
|
|
|
- If (C<>Nil) and (C is TCustomJSONRPCHandler) then
|
|
|
|
- Result:=TCustomJSONRPCHandler(C)
|
|
|
|
- else
|
|
|
|
|
|
+ I:=0;
|
|
|
|
+ While (Result=Nil) and (I<DM.ComponentCount) do
|
|
|
|
+ begin
|
|
|
|
+ C:=DM.Components[i];
|
|
|
|
+ If (C is TCustomJSONRPCHandler) and SameText(TCustomJSONRPCHandler(C).RPCMethodName,FHandlerMethodName) then
|
|
|
|
+ Result:=TCustomJSONRPCHandler(C);
|
|
|
|
+ inc(I);
|
|
|
|
+ end;
|
|
|
|
+ If Result=Nil then
|
|
begin
|
|
begin
|
|
FreeAndNil(DM);
|
|
FreeAndNil(DM);
|
|
JSONRPCError(SErrUnknownJSONRPCMethodHandler,[FHandlerMethodName]);
|
|
JSONRPCError(SErrUnknownJSONRPCMethodHandler,[FHandlerMethodName]);
|