public class GenericKeyedSessionPoolFactory
extends org.apache.commons.pool2.BaseKeyedPooledObjectFactory<com.lexmark.saperion.remote.common.authentication.Credentials,com.saperion.connector.authentication.Session>
implements org.apache.commons.pool2.KeyedPooledObjectFactory<com.lexmark.saperion.remote.common.authentication.Credentials,com.saperion.connector.authentication.Session>
Constructor and Description |
---|
GenericKeyedSessionPoolFactory() |
Modifier and Type | Method and Description |
---|---|
com.saperion.connector.authentication.Session |
create(com.lexmark.saperion.remote.common.authentication.Credentials key) |
protected SaClassicConnector |
createConnector()
Creates a SaClassicConnector connection.
|
void |
destroyObject(com.lexmark.saperion.remote.common.authentication.Credentials key,
org.apache.commons.pool2.PooledObject<com.saperion.connector.authentication.Session> obj)
If too many connections are open or the poolUtil is going to shutdown, the objects of type
SaClassicConnector will be destroyed.
|
void |
init(Properties configProperties)
Initialization method using the given properties.
|
void |
init(String configurationPath)
Initialization method.
|
org.apache.commons.pool2.PooledObject<com.saperion.connector.authentication.Session> |
makeObject(com.lexmark.saperion.remote.common.authentication.Credentials credentials)
This method will be called, when no idle connection is available.
|
boolean |
validateObject(com.lexmark.saperion.remote.common.authentication.Credentials key,
org.apache.commons.pool2.PooledObject<com.saperion.connector.authentication.Session> obj) |
org.apache.commons.pool2.PooledObject<com.saperion.connector.authentication.Session> |
wrap(com.saperion.connector.authentication.Session value) |
activateObject, passivateObject
@PostConstruct public void init(String configurationPath) throws Exception
configurationPath
- The path to the configuration file.Exception
- if an initialization error occurs.public void init(Properties configProperties)
configProperties
- the CC properties to use.public com.saperion.connector.authentication.Session create(com.lexmark.saperion.remote.common.authentication.Credentials key) throws Exception
create
in class org.apache.commons.pool2.BaseKeyedPooledObjectFactory<com.lexmark.saperion.remote.common.authentication.Credentials,com.saperion.connector.authentication.Session>
Exception
public org.apache.commons.pool2.PooledObject<com.saperion.connector.authentication.Session> wrap(com.saperion.connector.authentication.Session value)
wrap
in class org.apache.commons.pool2.BaseKeyedPooledObjectFactory<com.lexmark.saperion.remote.common.authentication.Credentials,com.saperion.connector.authentication.Session>
public org.apache.commons.pool2.PooledObject<com.saperion.connector.authentication.Session> makeObject(com.lexmark.saperion.remote.common.authentication.Credentials credentials) throws Exception
makeObject
in interface org.apache.commons.pool2.KeyedPooledObjectFactory<com.lexmark.saperion.remote.common.authentication.Credentials,com.saperion.connector.authentication.Session>
makeObject
in class org.apache.commons.pool2.BaseKeyedPooledObjectFactory<com.lexmark.saperion.remote.common.authentication.Credentials,com.saperion.connector.authentication.Session>
credentials
- the key to make a new session forException
- if an error occurs.public void destroyObject(com.lexmark.saperion.remote.common.authentication.Credentials key, org.apache.commons.pool2.PooledObject<com.saperion.connector.authentication.Session> obj) throws Exception
destroyObject
in interface org.apache.commons.pool2.KeyedPooledObjectFactory<com.lexmark.saperion.remote.common.authentication.Credentials,com.saperion.connector.authentication.Session>
destroyObject
in class org.apache.commons.pool2.BaseKeyedPooledObjectFactory<com.lexmark.saperion.remote.common.authentication.Credentials,com.saperion.connector.authentication.Session>
key
- the object's keyobj
- The object to destroy.Exception
- if an error occurs.public boolean validateObject(com.lexmark.saperion.remote.common.authentication.Credentials key, org.apache.commons.pool2.PooledObject<com.saperion.connector.authentication.Session> obj)
validateObject
in interface org.apache.commons.pool2.KeyedPooledObjectFactory<com.lexmark.saperion.remote.common.authentication.Credentials,com.saperion.connector.authentication.Session>
validateObject
in class org.apache.commons.pool2.BaseKeyedPooledObjectFactory<com.lexmark.saperion.remote.common.authentication.Credentials,com.saperion.connector.authentication.Session>
protected SaClassicConnector createConnector()
Copyright © 2020 Hyland Software Germany GmbH. All rights reserved.