org.jboss.jca.adapters.jdbc

## Class PreparedStatementCache

- java.lang.Object
- - org.jboss.jca.adapters.jdbc.PreparedStatementCache

- All Implemented Interfaces:
    CacheListener<CachedPreparedStatement>

      public class PreparedStatementCache
      extends java.lang.Object
      implements CacheListener<CachedPreparedStatement>

  Cache for PreparedStatements. When ps ages out, close it.
  Author:
    Jesper Pedersen

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `PreparedStatementCache.Key` Key class

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PreparedStatementCache(int max, JdbcStatisticsPlugin stats)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CachedPreparedStatement` | `get(PreparedStatementCache.Key key)` Get
    `void` | `onEviction(CachedPreparedStatement evicted)` On eviction
    `void` | `put(PreparedStatementCache.Key key, CachedPreparedStatement value)` Put
    `int` | `size()` Size
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PreparedStatementCache

          public PreparedStatementCache(int max,
                                        JdbcStatisticsPlugin stats)

      Constructor
      Parameters:
        `max` - The max value
        `stats` - The statistics plugin

  - ### Method Detail

    - #### get

          public CachedPreparedStatement get(PreparedStatementCache.Key key)

      Get
      Parameters:
        `key` - The key
      Returns:
        The value

    - #### put

          public void put(PreparedStatementCache.Key key,
                          CachedPreparedStatement value)

      Put
      Parameters:
        `key` - The key
        `value` - The value

    - #### size

          public int size()

      Size
      Returns:
        The size

    - #### onEviction

          public void onEviction(CachedPreparedStatement evicted)

      On eviction
      Specified by:
        `onEviction` in interface `CacheListener<CachedPreparedStatement>`
      Parameters:
        `evicted` - The value being evicted

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2014 IronJacamar (http://www.ironjacamar.org)