public class I5Connector extends Object implements sirius.kernel.Stoppable
In contrast to native pooling provided by jt400, this facility permits to configure connections using the system config and additionally to share these accross multiple pools.
Modifier and Type | Field and Description |
---|---|
protected sirius.kernel.health.Counter |
borrows |
protected sirius.kernel.health.Average |
callDuration |
protected sirius.kernel.health.Counter |
calls |
protected sirius.kernel.health.Average |
callUtilization |
static sirius.kernel.health.Log |
LOG |
protected Map<sirius.kernel.commons.Tuple<String,String>,sirius.biz.i5.I5ConnectionPool> |
pools |
Constructor and Description |
---|
I5Connector() |
Modifier and Type | Method and Description |
---|---|
I5Connection |
getConnection(String configName,
String tenantName,
Consumer<I5Connection> setup)
Provides a connection from the connection pool created for the configured i5.
|
void |
stopped() |
public static final sirius.kernel.health.Log LOG
protected sirius.kernel.health.Counter borrows
protected sirius.kernel.health.Counter calls
protected sirius.kernel.health.Average callDuration
protected sirius.kernel.health.Average callUtilization
public I5Connection getConnection(String configName, @Nullable String tenantName, @Nullable Consumer<I5Connection> setup)
For multi tenant scenarios several pools to the same physical host can be created, by supplying different tenantNames.
configName
- the name of the config entry (i5.[configEntry]) which is used to fetch the
pool configuration from the system config.tenantName
- the optional tenant name to create multiple pools for one hostsetup
- an optional setup procedure which is invoked once for each new connection. Note that this
parameter is only considered for the first call which creates the connection pool.public void stopped()
stopped
in interface sirius.kernel.Stoppable
Copyright © 2018. All rights reserved.