Other user-written components
Diffusion™ provides many opportunities to create user-written components that define custom behavior. Consider whether to develop any of these components as part of your solution.
Server-related components
All of these components must be created as Java™ classes and put on the classpath of the Diffusion server.
- Authentication handlers
- These components handle authentication of clients that connect to the Diffusion server or change the principal that they use to
connect to the Diffusion server. If the client connection is
allowed, the authentication handler assigns roles to the client session.
You can have zero, one, or many authentication handlers configured on your Diffusion server.
For more information, see Developing a local authentication handler and Developing a composite authentication handler.
Note: Local authentication handlers, on the Diffusion server, can be written only in Java. However, control authentication handlers that are part of a client whose API supports Authentication Control can be written in other languages. - Hooks
- Startup and shutdown hooks are called by the Diffusion server.
The startup hook is instantiated and called as the Diffusion server starts and before publishers are loaded.
The shutdown hook is called as the Diffusion server stops.
For example, you can use a shutdown hook to persist some aspect of the state of the Diffusion server to disk.
- HTTP service handlers
- These components handle HTTP requests as part of an HTTP service in the Diffusion server's built-in web server. Provide a user-written HTTP service handler to enable the Diffusion web server to handle any kind of HTTP request.
- Thread pool handlers
- These handlers define custom behavior in the Diffusion server
related to the inbound thread pool.
You can provide a rejection handler that customizes the behavior when a task cannot be run by the thread pool. By default, if a task cannot be run by the inbound thread pool — for example, if the thread pool is overloaded — the calling thread blocks until there is space on the queue.
You can provide a notification handler that receives notifications when events occur on the inbound thread pool.
- DEPRECATED: Authorization handlers
- Authorization handlers are deprecated and have been replaced by role-based
authorization. For more information, see Role-based authorization.
An authorization handler controls authorization and permissions for clients and users. You can have zero or one authorization handler configured on your Diffusion server.
Authorization handlers can be written only in Java.
Topic- and data-related components
All of these components must be created as Java classes and put on the classpath of the Diffusion server.
- Message matchers
- Message matchers are used to customize conflation behavior. These classes
that define how the Diffusion server locates messages on a
client's message queue that are to be conflated.
By default, messages for conflation are matched if they are on the same topic.
For more information, see Conflation.
- Message mergers
- Message mergers are used to customize conflation behavior. These classes
that define how the Diffusion server conflates matching
messages.
By default, the older of the matching messages is removed.
For more information, see Conflation.
- Comparators and collators
- These components define the behavior of an ordered paged topic. Comparators
implement java.util.Comparator and can customize the
ordering of lines in a paged string or paged record topic. Collators
implement java.text.RulesBased Collator and can define
the ordering of lines in a paged record topic.
For more information, see .
- Custom field handlers
- These components handle the data in custom fields of your record topics. A
custom field handler can define the default value of a custom field, parse
incoming data into the format required by the custom field, and compare data
in custom fields of the same type for equality.
For more information, see Metadata.
- Custom topic data handlers
- These components handle the behavior of a custom topic. When you create a
custom topic, you provide a custom topic handler that defines how the topic
data is maintained, compared, and sent to subscribing clients.
For more information, see DEPRECATED: Custom topics.
- Routing topic handlers
- These components handle the behavior of a routing topic. When you create a
routing topic, you provide a routing topic handler that, when a subscription
to the routing topic is made, maps the routing topic to another topic on the Diffusion server on a client-by-client basis.
For more information, see Routing topics.
- Service handlers
- These components handle the behavior of a service topic. When you create a
service topic, you provide a service handler that receives requests from
clients on the topic and provides responses through the topic.
For more information, see DEPRECATED: Service topics.