Este conteúdo não está disponível no idioma selecionado.
16.51. Request Processors
ModeShape connectors are typically the components that receive these Request objects. Before we look further into the connector framework, there is one more component related to Requests that should be discussed.
The RequestProcessor class is an abstract class that defines a
process(...) method for each concrete Request subclass. In other words, there is a process(CompositeRequest) method, a process(ReadNodeRequest) method, and so on. This makes it easy to implement behavior that responds to the different kinds of Request classes: subclass the RequestProcessor, override all of the abstract methods, and optionally overriding any of the other methods that have a default implementation.
Note
The RequestProcessor abstract class contains default implementations for quite a few of the
process(...) methods, and these will be sufficient but probably not efficient or optimum. If you can provide a more efficient implementation given your source, feel free to do so. However, if performance is not a big issue, all of the concrete methods will provide the correct behavior. Keep things simple to start out - you can always provide better implementations later.