web server - Borland Technical Publications
web server - Borland Technical Publications web server - Borland Technical Publications
Chapter 25 25Implementing Partition Interceptors Chapter Important Implementing Partition Interceptors requires the following steps: 1 Defining your interceptor using the module-borland.xml descriptor file. 2 Creating the interceptor class. 3 JARing the class and the descriptor file. 4 Deploy the JAR to the Partition of interest. For documentation updates, go to www.borland.com/techpubs/bes. Defining the Interceptor You define the interceptor by creating a module-borland.xml file. This file uses the following DTD: The element must contain the full-path class name of the implementation contained within the JAR. The element is an optional field that controls the order in which a set of interceptors for a particular Partition are fired. This value must be between 0 and 9. Priority 0 ranks before priority 9. Interceptors are fired in order during load time and in reverse order during shutdown. If two or more interceptors share the same priority, there is no way to determine or enforce which of that set will be fired relative to the other. The is an optional element which contains a pair of elements, and . These are passed into your class implementation as a java.util.HashMap. Your code must extract the appropriate values from this type. The limit on arguments is imposed by the JVM implementation. Chapter 25: Implementing Partition Interceptors 241
Creating the Interceptor Class For example, the following XML defines an interceptor called InterceptorImpl: com.borland.enterprise.examples.InterceptorImpl key1 value1 key2 value2 key3 value3 1 Creating the Interceptor Class Your class must implement: com.borland.enterprise.server.Partition.service.PartitionInterceptor The following methods are available: public void initialize(java.util.HashMap args); This method is called before any Partition services like the Tomcat container are created and initialized. This method is not subject to the parameter, since it is invoked as each interceptor is loaded. public void startupPreLoad(); This method is called after Partition services are started and before the Partition services load modules. public void startupPostLoad(); This method is invoked after all Partition services have loaded their respective modules. public void shutdownPreUnload(); This method is called before the Partition services unload their respective modules. The parameter now reverses its meaning; priority 9 interceptors are called first, then priority 8, and so forth. public void shutdownPostUnload(); This method is called after the services have unloaded their modules. public void PartitionTerminating(); This method is called after the services have been shut down, just before the Partition shuts down. 242 BES Developer’s Guide
- Page 201 and 202: 190 BES Developer’s Guide
- Page 203 and 204: JNDI Definitions Module Important s
- Page 205 and 206: Disabling and Enabling a Deployed D
- Page 207 and 208: Configuring JDBC Datasources In the
- Page 209 and 210: Configuring JDBC Datasources To add
- Page 211 and 212: Defining the Connection Pool Proper
- Page 213 and 214: Defining the Connection Pool Proper
- Page 215 and 216: Descriptions of Borland Enterprise
- Page 217 and 218: Advanced Topics for Defining JDBC D
- Page 219 and 220: Connecting to JDBC Resources from J
- Page 221 and 222: Configuring JMS Connection Factorie
- Page 223 and 224: Defining Connection Pool Properties
- Page 225 and 226: Obtaining JMS Connection Factories
- Page 227 and 228: JMS and Transactions and its accomp
- Page 229 and 230: JMS and Transactions For instance:
- Page 231 and 232: 220 BES Developer’s Guide
- Page 233 and 234: Configuring JMS administered object
- Page 235 and 236: Tibco Creating Clustered JMS Servic
- Page 237 and 238: Sonic serverUrl String localhost:72
- Page 239 and 240: Sonic Creating Clustered JMS Servic
- Page 241 and 242: OpenJMS Even though OpenJMS can be
- Page 243 and 244: OpenJMS Important If you use OpenJM
- Page 245 and 246: OpenJMS openjms.clean_messages_on_s
- Page 247 and 248: OpenJMS Table 24.1 Property Name De
- Page 249 and 250: Other JMS providers The following a
- Page 251: 240 BES Developer’s Guide
- Page 255 and 256: Creating the JAR file Creating the
- Page 257 and 258: Components Components The Connector
- Page 259 and 260: System Contracts Connection Managem
- Page 261 and 262: System Contracts Security Managemen
- Page 263 and 264: Common Client Interface (CCI) Conne
- Page 265 and 266: Packaging and Deployment Figure 26.
- Page 267 and 268: Resource Adapters Resource Adapters
- Page 269 and 270: Connection management Connection ma
- Page 271 and 272: Security management with the Securi
- Page 273 and 274: Security management with the Securi
- Page 275 and 276: Resource Adapter overview Note Reso
- Page 277 and 278: Deployment Descriptors for the Reso
- Page 279 and 280: Developing the Resource Adapter Con
- Page 281 and 282: Deploying the Resource Adapter Pack
- Page 283 and 284: Application development overview 8
- Page 285 and 286: Application development overview //
- Page 287 and 288: Application development overview
- Page 289 and 290: Other Considerations Other Consider
- Page 291 and 292: Other Considerations To illustrate,
- Page 293 and 294: Other Considerations } } { cf = new
- Page 295 and 296: General syntax and usage General sy
- Page 297 and 298: Syntax and usage for iastool Table
- Page 299 and 300: Syntax and usage for java2iiop Exam
- Page 301 and 302: Syntax and usage for appclient Tabl
Creating the Interceptor Class<br />
For example, the following XML defines an interceptor called InterceptorImpl:<br />
<br />
<br />
com.borland.enterprise.examples.InterceptorImpl<br />
<br />
key1<br />
value1<br />
<br />
<br />
key2<br />
value2<br />
<br />
<br />
key3<br />
value3<br />
<br />
1<br />
<br />
<br />
Creating the Interceptor Class<br />
Your class must implement:<br />
com.borland.enterprise.<strong>server</strong>.Partition.service.PartitionInterceptor<br />
The following methods are available:<br />
public void initialize(java.util.HashMap args);<br />
This method is called before any Partition services like the Tomcat container are<br />
created and initialized. This method is not subject to the parameter, since it is<br />
invoked as each interceptor is loaded.<br />
public void startupPreLoad();<br />
This method is called after Partition services are started and before the Partition<br />
services load modules.<br />
public void startupPostLoad();<br />
This method is invoked after all Partition services have loaded their respective<br />
modules.<br />
public void shutdownPreUnload();<br />
This method is called before the Partition services unload their respective modules.<br />
The parameter now reverses its meaning; priority 9 interceptors are called<br />
first, then priority 8, and so forth.<br />
public void shutdownPostUnload();<br />
This method is called after the services have unloaded their modules.<br />
public void PartitionTerminating();<br />
This method is called after the services have been shut down, just before the Partition<br />
shuts down.<br />
242 BES Developer’s Guide