Protocol plug-in
Custom protocols are written as Java™ classes that extend the public class FixedProviderProtocol, and must implement the following three abstract methods:
- public ProtocolInitStatus initialize()
- public ProtocolRunStatus run()
- public ProtocolShutdownStatus shutdown()
The initialize() method is called once, to initialize the protocol during the execution of the "initialize" method of the attribute retrieval service. For example, this method can be responsible for establishing a connection to a remote database or profiling service.
The run() method is called (by the "getEntitlement" method of the attribute retrieval service) each time a request is made for a container that must be retrieved by this protocol. This method must retrieve the requested container (or containers) specified by the _container_descriptors member variable of the client class' HashMap. This container can be obtained using the elements() method of the client class.
The client class' addContainer() method is then used to add the retrieved container (or containers) to the client class' _session. How, and from where, the protocol acquires the container is specific to the individual protocol.
The shutdown() method is called once to shutdown the protocol during the execution of the "shutdown" method of the attribute retrieval service. For example, this method can be responsible for closing the connections to remote databases or profiling services that were opened during the "initialize" method.
The following resources are available to assist in creating a custom protocol plug-in:
- Attribute retrieval service class documentation
/opt/pdwebars/amwebars_class_doc.zip - Example protocol plug-in modules (Java)
/opt/pdwebars/protocol_plugin/exampleProtocol.java - Compiled (built) version of the example module
/opt/pdwebars/protocol_plugin/exampleProtocol.class READMEfile, that explains how to customize and compile the example code/opt/pdwebars/protocol_plugin/README