public static STSClientFactory getInstance(int maxClientsInPool) { if (INSTANCE == null) { INSTANCE = new STSClientFactory(); POOL = STSClientPool.instance(maxClientsInPool); } return INSTANCE; }
public STSClient create(int initialNumberOfClients, final STSClientConfig config) { if (POOL.isPoolingDisabled()) { return new STSClient(config); } POOL.initialize(initialNumberOfClients, config); return POOL.takeOut(config); }
STSClient createSTSClient(final STSClientConfig config) throws ParsingException { STSClientPool pool = STSClientFactory.getInstance(); if (pool.configExists(config) == false) { pool.createPool(config); } return pool.getClient(config); }
private String key(STSClientConfig stsClientConfig) { return key(stsClientConfig.getServiceName(), stsClientConfig.getPortName(), stsClientConfig.getEndPointAddress()); }
STSClient createSTSClient(final STSClientConfig.Builder builder) throws ParsingException { return STSClientFactory.getInstance().create(builder.build()); }
public STSClientConfig build() { validate(this); return new STSClientConfig(this); }
public STSClient create(int initialNumberOfClients, final STSClientCreationCallBack callBack) { if (POOL.isPoolingDisabled()) { return null; } POOL.initialize(initialNumberOfClients, callBack); return POOL.takeOut(callBack.getKey()); }
/** * This method returns all allocated clients back to the STSClientPool when pooling is enabled. */ public void close() { STSClientPool pool = STSClientFactory.getInstance(); for (STSClient client: this.clients) { pool.returnClient(client); } } }
public static STSClientFactory getInstance() { if (INSTANCE == null) { // pooling disabled return getInstance(0); } return INSTANCE; }
public STSClient takeOut(STSClientConfig stsClientConfig) { String key = key(stsClientConfig); STSClient client = takeOutInternal(key); if (client == null) { initialize(initialClients, stsClientConfig); client = takeOutInternal(key); } return client; }
/** * Get instance of {@link STSClientPool}. * * @return {@link STSClientPool} instance */ public static STSClientPool getPoolInstance() { STSClientPoolFactory cf = LazySTSClientFactory.INSTANCE; STSClientFactory.setInstance(cf); return cf; }
@Override public String getSTSClientConfigKey() { return STSClientConfig.computeSTSClientConfigKey(STSClientConfig.SUBSTITUTE_MODULE, serviceName, portName, endPointAddress, userName); } }
STSClient createSTSClient(final STSClientConfig.Builder builder) throws ParsingException { return STSClientFactory.getInstance().create(builder.build()); }
public STSClientConfig build() { validate(this); return new STSClientConfig(this); }
STSClient createSTSClient(final STSClientConfig config) throws ParsingException { STSClientPool pool = STSClientFactory.getInstance(); if (pool.configExists(config) == false) { pool.createPool(config); } return pool.getClient(config); }
/** * This method returns all allocated clients back to the STSClientPool when pooling is enabled. */ public void close() { STSClientPool pool = STSClientFactory.getInstance(); for (STSClient client: this.clients) { pool.returnClient(client); } } }
STSClient createSTSClient(final STSClientConfig.Builder builder) throws ParsingException { return STSClientFactory.getInstance().create(builder.build()); }
public STSClientConfig build() { validate(this); return new STSClientConfig(this); }
public STSClientConfig build() { validate(this); return new STSClientConfig(this); }
public STSClientConfig build() { validate(this); return new STSClientConfig(this); }