Methods Summary |
---|
public java.lang.Object | clone()INTERNAL:
Clone the query
try {
ConnectionPolicy clone = (ConnectionPolicy)super.clone();
if (clone.hasLogin()) {
clone.setLogin((Login)clone.getLogin().clone());
}
return clone;
} catch (CloneNotSupportedException e) {
return null;
}
|
public void | dontUseLazyConnection()PUBLIC:
A lazy connection only acquires a physical connection
when a transaction is started and releases the connection when the transaction completes.
setIsLazy(false);
|
public oracle.toplink.essentials.sessions.Login | getLogin()PUBLIC:
Return the login to use for this connection.
Client sessions support using a seperate user login for database modification.
return login;
|
public java.lang.String | getPoolName()PUBLIC:
Return the pool name or null if not part of a pool.
return poolName;
|
public java.util.Map | getProperties()ADVANCED:
This method will return the collection of custom properties set on the Connection
policy. Note that this will cause the lazy initialization of the HashMap.
if (this.properties == null) {
this.properties = new HashMap();
}
return this.properties;
|
public java.lang.Object | getProperty(java.lang.Object object)PUBLIC:
Returns the property associated with the corresponding key. These properties will be available to
connection events.
if (this.hasProperties()) {
return this.getProperties().get(object);
}
return null;
|
public boolean | hasLogin()PUBLIC:
Return if a login is used, only one of login and pool can be used.
return login != null;
|
public boolean | hasProperties()PUBLIC:
Returns true if properties are available on the Connection Policy
return (this.properties != null) && (!this.properties.isEmpty());
|
public 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.
return isLazy;
|
public boolean | isPooled()INTERNAL:
Return if part of a connection pool.
return poolName != null;
|
public boolean | isUserDefinedConnection()INTERNAL:
Return if part of a connection pool.
return poolName == null;
|
public java.lang.Object | removeProperty(java.lang.Object key)PUBLIC:
This method is used to remove a custom property from the Connection Policy.
This method will return the propery removed. If it was not found then null
will be returned.
if (this.hasProperties()) {
return getProperties().remove(key);
}
return null;
|
public 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.
this.isLazy = isLazy;
|
public void | setLogin(oracle.toplink.essentials.sessions.Login login)PUBLIC:
Set the login to use for this connection.
Client sessions support using a seperate user login for database modification.
Pooled connections must use the pool's login and cannot define their own.
this.login = login;
|
public void | setPoolName(java.lang.String poolName)PUBLIC:
Set the pool name or null if not part of a pool.
this.poolName = poolName;
|
public void | setProperty(java.lang.Object key, java.lang.Object property)PUBLIC:
Use this method to set custom properties on the Connection Policy. These
properties will be available from within connection events but have no
effect on the connection directly.
getProperties().put(key, property);
|
public java.lang.String | toString()INTERNAL:
return a string representation of this ConnectionPolicy
String type = "";
if (isPooled()) {
type = "(" + ToStringLocalization.buildMessage("pooled", (Object[])null) + ": " + getPoolName();
} else {
type = "(" + ToStringLocalization.buildMessage("login", (Object[])null) + ": " + getLogin();
}
if (isLazy()) {
type = type + "," + ToStringLocalization.buildMessage("lazy", (Object[])null) + ")";
} else {
type = type + "," + ToStringLocalization.buildMessage("non-lazy", (Object[])null) + ")";
}
return Helper.getShortClassName(getClass()) + type;
|
public void | useLazyConnection()PUBLIC:
A lazy connection only acquires a physical connection
when a transaction is started and releases the connection when the transaction completes.
setIsLazy(true);
|