Classes | Public Member Functions
org.apache.xmlrpc.server.RequestProcessorFactoryFactory Interface Reference
Inheritance diagram for org.apache.xmlrpc.server.RequestProcessorFactoryFactory:
Inheritance graph
[legend]

List of all members.

Classes

interface  RequestProcessorFactory
class  RequestSpecificProcessorFactoryFactory
class  StatelessProcessorFactoryFactory

Public Member Functions

RequestProcessorFactory getRequestProcessorFactory (Class pClass) throws XmlRpcException

Detailed Description

The request processor is the object, which is actually performing the request. There is nothing magic about the request processor: It may very well be a POJO. The RequestProcessorFactoryFactory is passed to the AbstractReflectiveHandlerMapping at startup. The mapping uses this factory to create instances of RequestProcessorFactory, which are used to initialize the ReflectiveXmlRpcHandler. The handler in turn uses its factory to create the actual request processor when a request comes in.

However, the question arises, when and how the request processor is created and whether it needs request specific initialization. The RequestProcessorFactoryFactory is an object, which makes that logic pluggable. Unfortunately, we aren't done with a single factory: We even need a factory for factories. The rationale is best explained by looking at the different use cases and how to implement them.

The default RequestProcessorFactoryFactory is the RequestSpecificProcessorFactoryFactory. It creates a new processor instance for any request. In other words, it allows the request processor to have some state. This is fine, if the request processor is a lightweight object or needs request specific initialization. In this case, the actual request processor is created and invoked when calling RequestProcessorFactory#getRequestProcessor(XmlRpcRequest).

An alternative implementation is the StatelessProcessorFactoryFactory, which may be used to create stateless request processors. Stateless request processors are typically heavyweight objects, which have an expensive initialization phase. The processor factory, which is created by getRequestProcessorFactory(Class pClass) contains an initialized singleton, which is returned by RequestProcessorFactory#getRequestProcessor(XmlRpcRequest).

Other alternatives might be a RequestProcessorFactoryFactory, which maintains a pool of RequestProcessorFactory instances. The instances are configured by calling RequestProcessorFactory#getRequestProcessor(XmlRpcRequest).

Definition at line 65 of file RequestProcessorFactoryFactory.java.


Member Function Documentation


The documentation for this interface was generated from the following file:


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:50