public class ConnectionPolicy extends Object implements Cloneable, Serializable
Purpose: Used to specify how a client session's should be allocated.
ServerSession
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected boolean |
isLazy |
protected Login |
login |
protected String |
poolName |
protected Map |
properties
This attribute provides a mechanism to pass connection information to events.
|
Constructor and Description |
---|
ConnectionPolicy()
PUBLIC:
A connection policy is used to define how the client session connection should be acquired.
|
ConnectionPolicy(Login login)
PUBLIC:
A connection policy is used to define how the client session connection should be acquired.
|
ConnectionPolicy(String poolName)
PUBLIC:
A connection policy is used to define how the client session connection should be acquired.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
INTERNAL:
Clone the query
|
void |
dontUseLazyConnection()
PUBLIC:
A lazy connection only acquires a physical connection
when a transaction is started and releases the connection when the transaction completes.
|
Login |
getLogin()
PUBLIC:
Return the login to use for this connection.
|
String |
getPoolName()
PUBLIC:
Return the pool name or null if not part of a pool.
|
Map |
getProperties()
ADVANCED:
This method will return the collection of custom properties set on the Connection
policy.
|
Object |
getProperty(Object object)
PUBLIC:
Returns the property associated with the corresponding key.
|
boolean |
hasLogin()
PUBLIC:
Return if a login is used, only one of login and pool can be used.
|
boolean |
hasProperties()
PUBLIC:
Returns true if properties are available on the Connection Policy
|
boolean |
isLazy()
PUBLIC:
Return if a lazy connection should be used, a lazy connection only acquire a physical connection
when a transaction is started and releases the connection when the transaction completes.
|
boolean |
isPooled()
INTERNAL:
Return if part of a connection pool.
|
boolean |
isUserDefinedConnection()
INTERNAL:
Return if part of a connection pool.
|
Object |
removeProperty(Object key)
PUBLIC:
This method is used to remove a custom property from the Connection Policy.
|
void |
setIsLazy(boolean isLazy)
PUBLIC:
Set if a lazy connection should be used, a lazy connection only acquire a physical connection
when a transaction is started and releases the connection when the transaction completes.
|
void |
setLogin(Login login)
PUBLIC:
Set the login to use for this connection.
|
void |
setPoolName(String poolName)
PUBLIC:
Set the pool name or null if not part of a pool.
|
void |
setProperty(Object key,
Object property)
PUBLIC:
Use this method to set custom properties on the Connection Policy.
|
String |
toString()
INTERNAL:
return a string representation of this ConnectionPolicy
|
void |
useLazyConnection()
PUBLIC:
A lazy connection only acquires a physical connection
when a transaction is started and releases the connection when the transaction completes.
|
protected Login login
protected String poolName
protected boolean isLazy
protected Map properties
public ConnectionPolicy()
public ConnectionPolicy(String poolName)
public ConnectionPolicy(Login login)
public void dontUseLazyConnection()
public Login getLogin()
public String getPoolName()
public Map getProperties()
public Object getProperty(Object object)
public boolean hasLogin()
public boolean hasProperties()
public boolean isLazy()
public boolean isPooled()
public boolean isUserDefinedConnection()
public Object removeProperty(Object key)
public void setIsLazy(boolean isLazy)
public void setLogin(Login login)
public void setPoolName(String poolName)
public void setProperty(Object key, Object property)
public String toString()
public void useLazyConnection()
Copyright © 2023. All rights reserved.