이 콘텐츠는 선택한 언어로 제공되지 않습니다.
13.8. Delegating Translators
You can create a delegating translator by extending the
org.teiid.translator.BaseDelegatingExecutionFactory
class.
Once your classes are packaged as a custom translator, you will be able to wire another translator instance into your delegating translator at runtime in order to intercept all of the calls to the delegate. This base class does not provide any functionality on its own, other than delegation.
Name
|
Description
|
Default
|
---|---|---|
delegateName
|
Translator instance name to delegate to.
| |
As an example, consider if you are currently using "oracle" translator in your VDB and you need to intercept the calls going through this translator.
- You first write a custom delegating translator:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Then you deploy this translator.
- Then modify your
-vdb.xml
or.vdb
file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
We have defined a "translator" called "oracle-interceptor", which is based on the custom translator "interceptor" from above, and supplied the translator it required to delegate to "oracle" as its delegateName. Then, we used this override translator "oracle-interceptor" in the VDB. Now any calls going into this VDB model's translator will be intercepted by your code to do whatever you need to do.