Class DefaultJCoManagedConnectionContainer
- java.lang.Object
-
- de.hybris.platform.sap.core.jco.connection.impl.DefaultJCoManagedConnectionContainer
-
- All Implemented Interfaces:
JCoManagedConnectionContainer,JCoManagedConnectionContainerRestricted
public class DefaultJCoManagedConnectionContainer extends java.lang.Object implements JCoManagedConnectionContainer, JCoManagedConnectionContainerRestricted
Container for managed connections.
Container is session scoped. In case of the session is destroyed the destroy method is called, which cleanups stateful connections.
-
-
Field Summary
Fields Modifier and Type Field Description protected JCoManagedConnectionFactorymanagedConnectionFactoryManaged connection factory.protected java.util.Map<java.lang.String,JCoConnection>managedConnectionsMap of managed connections.
-
Constructor Summary
Constructors Constructor Description DefaultJCoManagedConnectionContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddestroy()Destroy hosted managed connections.JCoConnectiongetManagedConnection(java.lang.String connectionName)Getter for managed connection.JCoConnectiongetManagedConnection(java.lang.String connectionName, java.lang.String destinationName)Getter for managed connection.JCoConnectiongetManagedConnection(java.lang.String connectionName, java.lang.String destinationName, java.lang.String scopeId)Getter for managed connection.voidremoveConnection(JCoConnection connection)Removes the Stateful connection from managedConnection container.voidsetManagedConnectionFactory(JCoManagedConnectionFactory manangedConnectionFactory)Setter for connection factory.
-
-
-
Field Detail
-
managedConnectionFactory
protected JCoManagedConnectionFactory managedConnectionFactory
Managed connection factory.
-
managedConnections
protected java.util.Map<java.lang.String,JCoConnection> managedConnections
Map of managed connections.
-
-
Method Detail
-
setManagedConnectionFactory
public void setManagedConnectionFactory(JCoManagedConnectionFactory manangedConnectionFactory)
Setter for connection factory.- Parameters:
manangedConnectionFactory- managed connection factory.
-
getManagedConnection
public JCoConnection getManagedConnection(java.lang.String connectionName)
Description copied from interface:JCoManagedConnectionContainerGetter for managed connection.
Throws BackendRuntimeException in case of managed connection with given name cannot be constructed.- Specified by:
getManagedConnectionin interfaceJCoManagedConnectionContainer- Parameters:
connectionName- name of the connection.- Returns:
- managed connection.
-
getManagedConnection
public JCoConnection getManagedConnection(java.lang.String connectionName, java.lang.String destinationName)
Description copied from interface:JCoManagedConnectionContainerGetter for managed connection.
Throws BackendRuntimeException in case of managed connection with given name cannot be constructed.- Specified by:
getManagedConnectionin interfaceJCoManagedConnectionContainer- Parameters:
connectionName- name of the connection.destinationName- name of the destination to be used- Returns:
- managed connection.
-
getManagedConnection
public JCoConnection getManagedConnection(java.lang.String connectionName, java.lang.String destinationName, java.lang.String scopeId)
Description copied from interface:JCoManagedConnectionContainerGetter for managed connection.
Throws BackendRuntimeException in case of managed connection with given name cannot be constructed.- Specified by:
getManagedConnectionin interfaceJCoManagedConnectionContainer- Parameters:
connectionName- name of the connection.destinationName- name of the destination to be usedscopeId- scope id which is needed to identify different connections (sessions) to the same destination- Returns:
- managed connection.
-
destroy
protected void destroy() throws BackendExceptionDestroy hosted managed connections.- Throws:
BackendException- Exception in case of failure.
-
removeConnection
public void removeConnection(JCoConnection connection)
Description copied from interface:JCoManagedConnectionContainerRestrictedRemoves the Stateful connection from managedConnection container.- Specified by:
removeConnectionin interfaceJCoManagedConnectionContainerRestricted- Parameters:
connection- JCo Connection
-
-