OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Support for client code that needs to interact with the requests, responses | 6 * Support for client code that needs to interact with the requests, responses |
7 * and notifications that are part of the analysis server's wire protocol. | 7 * and notifications that are part of the analysis server's wire protocol. |
8 */ | 8 */ |
9 library analysis_server.plugin.protocol.protocol; | 9 library analysis_server.plugin.protocol.protocol; |
10 | 10 |
11 import 'dart:collection'; | 11 import 'dart:collection'; |
12 import 'dart:convert' hide JsonDecoder; | 12 import 'dart:convert' hide JsonDecoder; |
13 | 13 |
14 import 'package:analysis_server/src/protocol/protocol_internal.dart'; | 14 import 'package:analysis_server/src/protocol/protocol_internal.dart'; |
15 | 15 |
16 part 'generated_protocol.dart'; | 16 part 'generated_protocol.dart'; |
17 | 17 |
18 /** | 18 /** |
19 * A [RequestHandler] that supports [startup] and [shutdown] methods. | 19 * A [RequestHandler] that supports [startup] and [shutdown] methods. |
20 * | 20 * |
21 * Clients may not extend, implement or mix-in this class. | 21 * Clients may not extend, implement or mix-in this class. |
22 */ | 22 */ |
23 abstract class DomainHandler extends RequestHandler { | 23 abstract class DomainHandler implements RequestHandler { |
24 /** | 24 /** |
25 * Perform any operations associated with the shutdown of the domain. It is | 25 * Perform any operations associated with the shutdown of the domain. It is |
26 * not guaranteed that this method will be called. If it is, it will be | 26 * not guaranteed that this method will be called. If it is, it will be |
27 * called after the last [Request] has been made. | 27 * called after the last [Request] has been made. |
28 */ | 28 */ |
29 void shutdown() {} | 29 void shutdown() {} |
30 | 30 |
31 /** | 31 /** |
32 * Perform any operations associated with the startup of the domain. This | 32 * Perform any operations associated with the startup of the domain. This |
33 * will be called before the first [Request]. | 33 * will be called before the first [Request]. |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 jsonObject[ID] = id; | 556 jsonObject[ID] = id; |
557 if (error != null) { | 557 if (error != null) { |
558 jsonObject[ERROR] = error.toJson(); | 558 jsonObject[ERROR] = error.toJson(); |
559 } | 559 } |
560 if (_result != null) { | 560 if (_result != null) { |
561 jsonObject[RESULT] = _result; | 561 jsonObject[RESULT] = _result; |
562 } | 562 } |
563 return jsonObject; | 563 return jsonObject; |
564 } | 564 } |
565 } | 565 } |
OLD | NEW |