Interface RoutingPolicyFactory
-
public interface RoutingPolicyFactory
This interface defines the necessary methods of a routing policy factory that can be plugged into aDocumentProtocol
using theDocumentProtocol.putRoutingPolicyFactory(String, RoutingPolicyFactory)
method.- Author:
- Simon Thoresen Hult
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DocumentProtocolRoutingPolicy
createPolicy(java.lang.String param)
This method creates and returns a routing policy that corresponds to the implementing class, using the given parameter string.void
destroy()
Destroys this factory and frees up any resources it has held.
-
-
-
Method Detail
-
createPolicy
DocumentProtocolRoutingPolicy createPolicy(java.lang.String param)
This method creates and returns a routing policy that corresponds to the implementing class, using the given parameter string. There is only ever one instance of a routing policy for a given name and parameter combination, and because of this the policies must be state-less beyond what can be derived from the parameter string. Because there is only a single thread running route resolution within message bus, it is not necessary to make policies thread-safe. For more information seeRoutingPolicy
. Do NOT throw exceptions out of this method because that will cause the running thread to die, just return null to signal failure instead.- Parameters:
param
- The parameter to use when creating the policy.- Returns:
- The created routing policy.
-
destroy
void destroy()
Destroys this factory and frees up any resources it has held. Making further calls on a destroyed factory causes a runtime exception.
-
-