oracle.webcache.invalidation
Class InvalidationConnection

java.lang.Object
  |
  +--oracle.webcache.invalidation.InvalidationConnection
Direct Known Subclasses:
SimpleInvalidationConnection

public class InvalidationConnection
extends java.lang.Object

This class represents a Web Cache connection over which invalidation messages may be sent, either synchronously or asynchronously.

Connection details (such as the hostname and port number of the Web Cache) are read from an XML configuration file.


Constructor Summary
TypeConstructor
  InvalidationConnection()
          Constructs a Web Cache invalidation connection over which an invalidation message can be sent.
protected InvalidationConnection(oracle.net.http.HttpConnection conn)
           
  InvalidationConnection(java.lang.String tagName)
          Constructs a Web Cache invalidation connection over which an invalidation message can be sent.
 
Method Summary
TypeMethod
 InvalidationResult send(InvalidationMessage msg)
          Sends an invalidation message to the Web Cache, in synchronous mode.
 void send(InvalidationMessage msg, oracle.net.http.HttpListener lsnr, java.lang.Object callbackArg)
          Sends an invalidation message to the Web Cache, in asynchronous mode.
static void shutdown()
          Terminates all outstanding sender threads.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvalidationConnection

public InvalidationConnection(java.lang.String tagName)
Constructs a Web Cache invalidation connection over which an invalidation message can be sent.

Connection details (such as the hostname and port number of the Web Cache) are read from an XML configuration file. The given tagName parameter identifies which element in the configuration file contains these details. This element may appear anywhere in the file (at any depth).

If the element is a simple element (i.e. it has no sub-elements) then it is expected to have the following attributes:

   host="<hostname of Web Cache>"
   port="<invalidation port no.>"
   authorization="<HTTP Authorization string>"
 
These atttributes define the underlying physical HTTP "connection". A call to InvalidationConnection#send will result in an InvalidationMessage being sent to the Web Cache over this connection.

If the element has sub-elements then each of its sub-elements are expected to be simple elements of the above type. In this case a corresponding group of physical HTTP "connections" are associated with this InvalidationConnection. A call to InvalidationConnection#send will result in an InvalidationMessage being sent over each connection in the group.


 A "simple" configuration file might look like this:
  <?xml version="1.0" ?>
  <webcache>
    <invalidation
      host="cache.us.oracle.com"
      port="4001"
      authorization="invalidator:invalidator"/>
  </webcache>
    
 A "complex" configuration file might look like this:
  <?xml version="1.0" ?>
  <invalidation>
    <webcache1
      host="cache1.us.oracle.com"
      port="4001"
      authorization="invalidator:invalidator"/>
    <webcache2
      host="cache2.us.oracle.com"
      port="4001"
      authorization="invalidator:invalidator"/>
  </invalidation>

 
The location of the configuration file is expected to be in the system property "oracle.http.configfile".

InvalidationConnection

public InvalidationConnection()
Constructs a Web Cache invalidation connection over which an invalidation message can be sent.

Equivalent to InvalidationConnection("invalidation").


InvalidationConnection

protected InvalidationConnection(oracle.net.http.HttpConnection conn)
Method Detail

send

public InvalidationResult send(InvalidationMessage msg)
Sends an invalidation message to the Web Cache, in synchronous mode.

Parameters:
msg - an InvalidationMessage object
Returns:
an InvalidationResult object

See Also:
InvalidationMessage, InvalidationResult

send

public void send(InvalidationMessage msg,
                 oracle.net.http.HttpListener lsnr,
                 java.lang.Object callbackArg)
Sends an invalidation message to the Web Cache, in asynchronous mode. Notifies caller when send is complete via an asynchronous callback.

Parameters:
msg - an InvalidationMessage object
lsnr - callback listener
callbackArg - callback argument

See Also:
InvalidationMessage, HttpListener

shutdown

public static void shutdown()
Terminates all outstanding sender threads.