-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from Mercap/server_methods_cleanup
Improve server packaging
- Loading branch information
Showing
13 changed files
with
116 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Extension { #name : #JRPCBatchRequestsObject } | ||
|
||
{ #category : #'*JRPC-Server' } | ||
JRPCBatchRequestsObject >> beHandledByServer: aJRPCServer [ | ||
^ JRPCBatchResponseObject new | ||
responses: (self requests collect: [ :req | | ||
req beHandledByServer: aJRPCServer ]); | ||
yourself | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Extension { #name : #JRPCErrorResponseObject } | ||
|
||
{ #category : #'*JRPC-Server' } | ||
JRPCErrorResponseObject >> beHandledByServer: aJRPCServer [ | ||
"Returns self, this method is executed when a request inside a batch generated an error." | ||
^ self | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Extension { #name : #JRPCNotificationObject } | ||
|
||
{ #category : #'*JRPC-Server' } | ||
JRPCNotificationObject >> beHandledByServer: aJRPCServer [ | ||
| response | | ||
response := super beHandledByServer: aJRPCServer. | ||
"If the response is an error invalid request, it should be returned even if the request was a notification." | ||
(response isError and: [ response isInvalidRequest ]) | ||
ifTrue: [ ^ response ]. | ||
|
||
^ JRPCEmptyResponseObject new | ||
] | ||
|
||
{ #category : #'*JRPC-Server' } | ||
JRPCNotificationObject >> convertErrorToResponse: jrpcError [ | ||
jrpcError isIncorrectJSON | ||
ifTrue: [ ^ jrpcError asJRPCResponseWithId: self id ]. | ||
|
||
^ JRPCEmptyResponseObject new | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Extension { #name : #JRPCRequestObject } | ||
|
||
{ #category : #'*JRPC-Server' } | ||
JRPCRequestObject >> beHandledByServer: aJRPCServer [ | ||
^ aJRPCServer handleJRPCRequestObject: self | ||
] | ||
|
||
{ #category : #'*JRPC-Server' } | ||
JRPCRequestObject >> convertErrorToResponse: jrpcError [ | ||
^ jrpcError asJRPCResponseWithId: self id | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters