public abstract class GenericClientFactory extends Object implements ClientFactory, ClientLifeCycleManager
| Modifier and Type | Class and Description |
|---|---|
protected static class |
GenericClientFactory.LoadBalancer |
| Modifier and Type | Field and Description |
|---|---|
private Client |
client
The client.
|
protected ClientMetadata |
clientMetadata
Holds reference to client metadata.
|
private Object |
connectionPoolOrConnection
The connection pool or connection.
|
protected Map<String,Object> |
externalProperties
Holds persistence unit related property
|
protected ConcurrentMap<Host,Object> |
hostPools
Holds one pool instance per host
|
protected RetryService |
hostRetryService
Holds Instance of retry service
|
protected IndexManager |
indexManager
The index manager.
|
protected EntityManagerFactoryImpl.KunderaMetadata |
kunderaMetadata
kundera metadata
|
protected LoadBalancingPolicy |
loadBalancingPolicy
Holds LoadBalancer instance
|
private static org.slf4j.Logger |
logger
The logger.
|
private String |
persistenceUnit
The persistence unit.
|
protected PropertyReader |
propertyReader
property reader instance
|
protected EntityReader |
reader
The reader.
|
protected SchemaManager |
schemaManager
Configure schema manager.
|
| Constructor and Description |
|---|
GenericClientFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Object |
createPoolOrConnection()
Creates a new GenericClient object.
|
Client |
getClientInstance()
Gets the client instance.
|
ClientMetadata |
getClientMetadata() |
protected Object |
getConnectionPoolOrConnection()
Gets the connection pool or connection.
|
protected String |
getPersistenceUnit()
Gets the persistence unit.
|
abstract void |
initialize(Map<String,Object> puProperties)
Initialize client.
|
protected abstract void |
initializeLoadBalancer(String loadBalancingPolicyName) |
protected abstract Client |
instantiateClient(String persistenceUnit)
Instantiate client.
|
abstract boolean |
isThreadSafe()
Checks if is client thread safe.
|
void |
load(String persistenceUnit,
Map<String,Object> puProperties)
Load.
|
protected void |
loadClientMetadata(Map<String,Object> puProperties)
Load client metadata.
|
protected void |
onValidation(String host,
String port) |
protected void |
setConnectionPoolOrConnection(Object connectionPoolOrConnection)
Sets the connection pool or connection.
|
protected void |
setExternalProperties(Map<String,Object> puProperties) |
protected void |
setKunderaMetadata(EntityManagerFactoryImpl.KunderaMetadata kunderaMetadata)
Sets the persistence unit.
|
private void |
setPersistenceUnit(String persistenceUnit)
Sets the persistence unit.
|
protected void |
unload() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSchemaManagerdestroyprivate static org.slf4j.Logger logger
private Client client
private String persistenceUnit
private Object connectionPoolOrConnection
protected EntityReader reader
protected SchemaManager schemaManager
protected PropertyReader propertyReader
protected Map<String,Object> externalProperties
protected LoadBalancingPolicy loadBalancingPolicy
protected RetryService hostRetryService
protected ConcurrentMap<Host,Object> hostPools
protected ClientMetadata clientMetadata
protected EntityManagerFactoryImpl.KunderaMetadata kunderaMetadata
protected IndexManager indexManager
public void load(String persistenceUnit, Map<String,Object> puProperties)
load in interface ClientFactorypersistenceUnit - the persistence unitprotected void loadClientMetadata(Map<String,Object> puProperties)
puProperties - public abstract void initialize(Map<String,Object> puProperties)
initialize in interface ClientLifeCycleManagerpuProperties - protected abstract Object createPoolOrConnection()
externalProperties - public Client getClientInstance()
getClientInstance in interface ClientFactoryprotected abstract Client instantiateClient(String persistenceUnit)
public abstract boolean isThreadSafe()
isThreadSafe in interface ClientLifeCycleManagerprotected String getPersistenceUnit()
protected Object getConnectionPoolOrConnection()
protected void setConnectionPoolOrConnection(Object connectionPoolOrConnection)
private void setPersistenceUnit(String persistenceUnit)
persistenceUnit - the new persistence unitprotected void setKunderaMetadata(EntityManagerFactoryImpl.KunderaMetadata kunderaMetadata)
persistenceUnit - the new persistence unitprotected void setExternalProperties(Map<String,Object> puProperties)
puProperties - protected void unload()
protected abstract void initializeLoadBalancer(String loadBalancingPolicyName)
public ClientMetadata getClientMetadata()
Copyright © 2015. All Rights Reserved.