Class PerUserPoolDataSourceFactory
java.lang.Object
org.apache.tomcat.dbcp.dbcp2.datasources.PerUserPoolDataSourceFactory
- All Implemented Interfaces:
- ObjectFactory
A JNDI ObjectFactory which creates 
SharedPoolDataSources- Since:
- 2.0
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidcloseAll()Closes all pools associated with this class.protected static final Objectdeserialize(byte[] data) Deserializes the provided byte array to create an object.protected InstanceKeyDataSourcegetNewInstance(Reference ref) Creates an instance of the subclass and sets any properties contained in the Reference.getObjectInstance(Object refObj, Name name, Context context, Hashtable<?, ?> env) Implements ObjectFactory to create an instance of SharedPoolDataSource or PerUserPoolDataSourceprotected booleanisCorrectClass(String className) Tests if className is the value returned from getClass().getName().toString().
- 
Constructor Details- 
PerUserPoolDataSourceFactorypublic PerUserPoolDataSourceFactory()
 
- 
- 
Method Details- 
getNewInstanceprotected InstanceKeyDataSource getNewInstance(Reference ref) throws IOException, ClassNotFoundException Creates an instance of the subclass and sets any properties contained in the Reference.- Parameters:
- ref- The properties to be set on the created DataSource
- Returns:
- A configured DataSource of the appropriate type.
- Throws:
- IOException- If an I/O error occurs during the deserialization of a configuration parameter.
- ClassNotFoundException- If a class cannot be found during the deserialization of a configuration parameter.
 
- 
isCorrectClassTests if className is the value returned from getClass().getName().toString().- Parameters:
- className- The class name to test.
- Returns:
- true if and only if className is the value returned from getClass().getName().toString()
 
- 
closeAllCloses all pools associated with this class.- Throws:
- ListException- a- ListExceptioncontaining all exceptions thrown by- InstanceKeyDataSource.close()
- Since:
- 2.4.0 throws a ListExceptioninstead of, in 2.3.0 and before, the first exception thrown byInstanceKeyDataSource.close().
- See Also:
 
- 
deserializeDeserializes the provided byte array to create an object.- Parameters:
- data- Data to deserialize to create the configuration parameter.
- Returns:
- The Object created by deserializing the data.
- Throws:
- ClassNotFoundException- If a class cannot be found during the deserialization of a configuration parameter.
- IOException- If an I/O error occurs during the deserialization of a configuration parameter.
 
- 
getObjectInstancepublic Object getObjectInstance(Object refObj, Name name, Context context, Hashtable<?, ?> env) throws IOException, ClassNotFoundExceptionImplements ObjectFactory to create an instance of SharedPoolDataSource or PerUserPoolDataSource- Specified by:
- getObjectInstancein interface- ObjectFactory
- Throws:
- IOException
- ClassNotFoundException
 
 
-