Class DefaultJCoManagedConnectionContainer
java.lang.Object
de.hybris.platform.sap.core.jco.connection.impl.DefaultJCoManagedConnectionContainer
- All Implemented Interfaces:
JCoManagedConnectionContainer,JCoManagedConnectionContainerRestricted
public class DefaultJCoManagedConnectionContainer
extends 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.
Container is session scoped. In case of the session is destroyed the destroy method is called, which cleanups stateful connections.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JCoManagedConnectionFactoryManaged connection factory.protected Map<String,JCoConnection> Map of managed connections. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddestroy()Destroy hosted managed connections.getManagedConnection(String connectionName) Getter for managed connection.getManagedConnection(String connectionName, String destinationName) Getter for managed connection.getManagedConnection(String connectionName, String destinationName, String scopeId) Getter for managed connection.voidremoveConnection(JCoConnection connection) Removes the Stateful connection from managedConnection container.voidsetManagedConnectionFactory(JCoManagedConnectionFactory manangedConnectionFactory) Setter for connection factory.
-
Field Details
-
managedConnectionFactory
Managed connection factory. -
managedConnections
Map of managed connections.
-
-
Constructor Details
-
DefaultJCoManagedConnectionContainer
public DefaultJCoManagedConnectionContainer()
-
-
Method Details
-
setManagedConnectionFactory
Setter for connection factory.- Parameters:
manangedConnectionFactory- managed connection factory.
-
getManagedConnection
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
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(String connectionName, String destinationName, 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
Destroy hosted managed connections.- Throws:
BackendException- Exception in case of failure.
-
removeConnection
Description copied from interface:JCoManagedConnectionContainerRestrictedRemoves the Stateful connection from managedConnection container.- Specified by:
removeConnectionin interfaceJCoManagedConnectionContainerRestricted- Parameters:
connection- JCo Connection
-