Multiple ContentInterceptors
can be associated with a single Namespace
. They are typically configured in the <configuration>
section of the domain configuration file like this:
<content-interceptor class="com.acme.MyContentInterceptor">
<parameter name="myParam1">someValue</parameter>
<parameter name="myParam2">anotherValue</parameter>
</content-interceptor>
As you can see, ContentInterceptors
can be configured with parameters. This is optional, and exactly which parameters are available depends on the specific ContentInterceptor
implementation.
ContentInterceptor
implementations must provide a public constructor without arguments, so that instances of the class can be instantiated at startup. In addition, implementors should pay attention to this minimal lifecycle definition:
setParameters
will be called with a java.util.Hashtable
containing the parameter names and values as specified in the configuration.setNamespace
will be called, passing in a NamespaceAccessToken
than can later be used by the ContentInterceptor
to perform its deeds (like logging to the namespace logger).preXXX
and postXXX
methods will be called as soon as the associated event occurs. The signatures of the preXXX
and postXXX
specify a wide range of exceptions that can be thrown. If such an exception is thrown it will be propagated up to the the API client. In the case of the preXXX
the started operation will be terminated. So be sure to handle all exceptions that shouldn't be propagated back into the core core API - and thus possibly influence success of the operation - yourself.
|
|
|
|
|
|