org.apache.tomcat.dbcp.dbcp.datasources

## Class PerUserPoolDataSourceFactory

- java.lang.Object
- - org.apache.tomcat.dbcp.dbcp.datasources.PerUserPoolDataSourceFactory

- All Implemented Interfaces:
    javax.naming.spi.ObjectFactory

      public class PerUserPoolDataSourceFactory
      extends java.lang.Object

  A JNDI ObjectFactory which creates `SharedPoolDataSource`s

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PerUserPoolDataSourceFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `closeAll()` Close all pools associated with this class.
    `protected static java.lang.Object` | `deserialize(byte[] data)` used to set some properties saved within a Reference
    `protected InstanceKeyDataSource` | `getNewInstance(javax.naming.Reference ref)` Creates an instance of the subclass and sets any properties contained in the Reference.
    `java.lang.Object` | `getObjectInstance(java.lang.Object refObj, javax.naming.Name name, javax.naming.Context context, java.util.Hashtable<?,?> env)` implements ObjectFactory to create an instance of SharedPoolDataSource or PerUserPoolDataSource
    `protected boolean` | `isCorrectClass(java.lang.String className)`

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

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

- - ### Constructor Detail

    - #### PerUserPoolDataSourceFactory

          public PerUserPoolDataSourceFactory()

  - ### Method Detail

    - #### isCorrectClass

          protected boolean isCorrectClass(java.lang.String className)

      Returns:
        true if and only if className is the value returned from getClass().getName().toString()

    - #### getNewInstance

          protected InstanceKeyDataSource getNewInstance(javax.naming.Reference ref)
                                                  throws java.io.IOException,
                                                         java.lang.ClassNotFoundException

      Creates an instance of the subclass and sets any properties contained in the Reference.
      Throws:
        `java.io.IOException`
        `java.lang.ClassNotFoundException`

    - #### closeAll

          public static void closeAll()
                               throws java.lang.Exception

      Close all pools associated with this class.
      Throws:
        `java.lang.Exception`

    - #### getObjectInstance

          public java.lang.Object getObjectInstance(java.lang.Object refObj,
                                           javax.naming.Name name,
                                           javax.naming.Context context,
                                           java.util.Hashtable<?,?> env)
                                             throws java.io.IOException,
                                                    java.lang.ClassNotFoundException

      implements ObjectFactory to create an instance of SharedPoolDataSource or PerUserPoolDataSource
      Specified by:
        `getObjectInstance` in interface `javax.naming.spi.ObjectFactory`
      Throws:
        `java.io.IOException`
        `java.lang.ClassNotFoundException`

    - #### deserialize

          protected static final java.lang.Object deserialize(byte[] data)
                                                       throws java.io.IOException,
                                                              java.lang.ClassNotFoundException

      used to set some properties saved within a Reference
      Throws:
        `java.io.IOException`
        `java.lang.ClassNotFoundException`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.