Package org.apache.openjpa.slice
Interface DistributedConfiguration
-
- All Superinterfaces:
java.beans.BeanInfo,java.lang.Cloneable,Closeable,Configuration,OpenJPAConfiguration,java.io.Serializable
- All Known Subinterfaces:
DistributedJDBCConfiguration
- All Known Implementing Classes:
DistributedJDBCConfigurationImpl
public interface DistributedConfiguration extends OpenJPAConfiguration
A configuration for multiple data stores, each referred as slice. This configuration allows each underlying slice be configured with its own specific configuration properties such as JDBC Driver or connection user/password etc.
This configuration also extends by several policy plugins. A policy plugin is an user implementation of a specific policy interface. A policy implementation is invoked by Slice runtime.
Slice recognizes following policiesDistribution Policygoverns how new instances be distributed among the slices.Replication Policymaintains the same instance in multiple slices.Query Target Policynarrows the slices for a query execution.Finder Target Policynarrows the slices for primary key based lookup- Author:
- Pinaki Poddar
-
-
Field Summary
-
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
-
Fields inherited from interface org.apache.openjpa.lib.conf.Configuration
ATTRIBUTE_ALLOWED_VALUES, ATTRIBUTE_CATEGORY, ATTRIBUTE_INTERFACE, ATTRIBUTE_ORDER, ATTRIBUTE_TYPE, ATTRIBUTE_XML, INIT_STATE_FREEZING, INIT_STATE_FROZEN, INIT_STATE_LIQUID
-
Fields inherited from interface org.apache.openjpa.conf.OpenJPAConfiguration
LOG_DATACACHE, LOG_ENHANCE, LOG_METADATA, LOG_QUERY, LOG_RUNTIME, LOG_TOOL, OPTION_DATASTORE_CONNECTION, OPTION_EMBEDDED_COLLECTION_RELATION, OPTION_EMBEDDED_MAP_RELATION, OPTION_EMBEDDED_RELATION, OPTION_ID_APPLICATION, OPTION_ID_DATASTORE, OPTION_INC_FLUSH, OPTION_JDBC_CONNECTION, OPTION_NONTRANS_READ, OPTION_NULL_CONTAINER, OPTION_OPTIMISTIC, OPTION_POSTLOAD_ON_MERGE, OPTION_QUERY_SQL, OPTION_TYPE_ARRAY, OPTION_TYPE_COLLECTION, OPTION_TYPE_MAP, OPTION_USE_TCCL_IN_SELECT_NEW, OPTION_VALUE_AUTOASSIGN, OPTION_VALUE_INCREMENT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<java.lang.String>getActiveSliceNames()Gets the active slice identifiers.java.util.List<java.lang.String>getAvailableSliceNames()Gets the available slice identifiers irrespective of their status.java.lang.StringgetDistributionPolicy()Gets the policy, as a plugin string, that governs how new instances will be distributed across the available slices.DistributionPolicygetDistributionPolicyInstance()Gets the policy that governs how new instances will be distributed across the available slices.java.lang.StringgetFinderTargetPolicy()Gets the policy, as a plugin string, that governs which slices will be targeted for a given finder.FinderTargetPolicygetFinderTargetPolicyInstance()Gets the policy that governs which slices will be targeted for a given finder.java.lang.StringgetQueryTargetPolicy()Gets the policy, as a plugin string, that governs which slices will be targeted for a given query.QueryTargetPolicygetQueryTargetPolicyInstance()Gets the policy that governs which slices will be targeted for a given query.java.lang.StringgetReplicationPolicy()Gets the policy, as a plugin string, that governs how new replicated instances will be replicated across the available slices.ReplicationPolicygetReplicationPolicyInstance()Gets the policy that governs how new replicated instances will be replicated across the available slices.SlicegetSlice(java.lang.String sliceName)Gets the Slice for a given name.java.util.List<Slice>getSlices(Slice.Status... statuses)Gets the slices of given status.booleanisReplicated(java.lang.Class<?> type)Affirms if the given type is replicated.voidsetDistributionPolicy(java.lang.String policy)Sets the policy, from the given plugin string, that governs how new instances will be distributed across the available slices.voidsetDistributionPolicyInstance(DistributionPolicy policy)Sets the policy that governs how new instances will be distributed across the available slices.voidsetFinderTargetPolicy(java.lang.String policy)Sets the policy, from the given plugin string, that governs which slices will be targeted for a given finder.voidsetFinderTargetPolicyInstance(FinderTargetPolicy policy)Sets the policy that governs which slices will be targeted for a given finder.voidsetQueryTargetPolicy(java.lang.String policy)Sets the policy, from the given plugin string, that governs which slices will be targeted for a given query.voidsetQueryTargetPolicyInstance(QueryTargetPolicy policy)Sets the policy that governs which slices will be targeted for a given query.voidsetReplicationPolicy(java.lang.String policy)Sets the policy, from the given plugin string, that governs how new replicated instances will be replicated across the available slices.voidsetReplicationPolicyInstance(ReplicationPolicy policy)Sets the policy that governs how new replicated instances will be replicated across the available slices.-
Methods inherited from interface java.beans.BeanInfo
getAdditionalBeanInfo, getBeanDescriptor, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, getIcon, getMethodDescriptors, getPropertyDescriptors
-
Methods inherited from interface org.apache.openjpa.lib.conf.Configuration
addPropertyChangeListener, addValue, clone, close, fromProperties, getConfigurationLog, getId, getLog, getLog, getLogFactory, getProductName, getPropertyKeys, getPropertyKeys, getUserClassLoader, getValue, getValues, instantiateAll, isReadOnly, removePropertyChangeListener, removeValue, setId, setLog, setLogFactory, setProductName, setReadOnly, setUserClassLoader, toProperties
-
Methods inherited from interface org.apache.openjpa.conf.OpenJPAConfiguration
getAggregateListenerInstances, getAggregateListeners, getAuditor, getAuditorInstance, getAutoClear, getAutoClearConstant, getAutoDetach, getAutoDetachConstant, getBrokerFactory, getBrokerFactoryEventManager, getBrokerImpl, getCacheDistributionPolicy, getCacheDistributionPolicyInstance, getCacheMarshallerInstances, getCacheMarshallers, getCallbackOptions, getCallbackOptionsInstance, getClassResolver, getClassResolverInstance, getCompatibility, getCompatibilityInstance, getConnection2DriverName, getConnection2Password, getConnection2Properties, getConnection2URL, getConnection2UserName, getConnectionDriverName, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactory2Properties, getConnectionFactoryMode, getConnectionFactoryName, getConnectionFactoryProperties, getConnectionPassword, getConnectionProperties, getConnectionRetainMode, getConnectionRetainModeConstant, getConnectionURL, getConnectionUserName, getCreateScriptSource, getCreateScriptTarget, getCreateSource, getCreateSourceConstant, getDatabaseAction, getDatabaseActionConstant, getDataCache, getDataCacheManager, getDataCacheManagerInstance, getDataCacheMode, getDataCacheTimeout, getDetachStateInstance, getDropScriptSource, getDropScriptTarget, getDropSource, getDropSourceConstant, getDynamicDataStructs, getDynamicEnhancementAgent, getEncryptionProvider, getFetchBatchSize, getFetchGroups, getFetchGroupsList, getFilterListenerInstances, getFilterListeners, getFinderCache, getFinderCacheInstance, getFlushBeforeQueries, getFlushBeforeQueriesConstant, getIgnoreChanges, getInstrumentation, getInstrumentationManagerInstance, getInverseManager, getLifecycleEventManager, getLifecycleEventManagerInstance, getLoadScriptSource, getLockManager, getLockTimeout, getManagedRuntime, getManagedRuntimeInstance, getMapping, getMaxFetchDepth, getMetaDataFactory, getMetaDataRepository, getMetaDataRepositoryInstance, getMultithreaded, getNontransactionalRead, getNontransactionalWrite, getOptimistic, getOptimizeIdCopy, getOrphanedKeyAction, getOrphanedKeyActionInstance, getPostLoadOnMerge, getProxyManager, getProxyManagerInstance, getQueryCache, getQueryCompilationCache, getQueryCompilationCacheInstance, getQuerySQLCache, getQuerySQLCacheInstance, getQueryTimeout, getReadLockLevel, getReadLockLevelConstant, getRefreshFromDataCache, getRemoteCommitEventManager, getRemoteCommitProvider, getRestoreState, getRestoreStateConstant, getRetainState, getRetryClassRegistration, getRuntimeUnenhancedClasses, getRuntimeUnenhancedClassesConstant, getSavepointManager, getSavepointManagerInstance, getScriptsAction, getScriptsActionConstant, getSequence, getSequenceInstance, getSpecification, getSpecificationInstance, getStoreFacadeTypeRegistry, getTransactionMode, getTypesWithoutEnhancement, getUseTCCLinSelectNew, getValidationFactoryInstance, getValidationGroupPrePersist, getValidationGroupPreRemove, getValidationGroupPreUpdate, getValidationMode, getValidatorInstance, getWriteLockLevel, getWriteLockLevelConstant, isConnectionFactoryModeManaged, isInitializeEagerly, isTransactionModeManaged, metaDataRepositoryAvailable, newBrokerInstance, newInverseManagerInstance, newLockManagerInstance, newMetaDataFactoryInstance, newMetaDataRepositoryInstance, newRemoteCommitProviderInstance, setAggregateListeners, setAggregateListeners, setAuditor, setAuditorInstance, setAutoClear, setAutoClear, setAutoDetach, setAutoDetach, setBrokerFactory, setBrokerImpl, setCacheDistributionPolicy, setCacheDistributionPolicyInstance, setCacheMarshallers, setCallbackOptions, setClassResolver, setClassResolver, setCompatibility, setConnection2DriverName, setConnection2Password, setConnection2Properties, setConnection2URL, setConnection2UserName, setConnectionDriverName, setConnectionFactory, setConnectionFactory2, setConnectionFactory2Name, setConnectionFactory2Properties, setConnectionFactoryMode, setConnectionFactoryModeManaged, setConnectionFactoryName, setConnectionFactoryProperties, setConnectionPassword, setConnectionProperties, setConnectionRetainMode, setConnectionRetainMode, setConnectionURL, setConnectionUserName, setDataCache, setDataCacheManager, setDataCacheManager, setDataCacheMode, setDataCacheTimeout, setDataCacheTimeout, setDetachState, setDetachState, setDynamicDataStructs, setDynamicDataStructs, setDynamicEnhancementAgent, setEncryptionProvider, setFetchBatchSize, setFetchBatchSize, setFetchGroups, setFetchGroups, setFilterListeners, setFilterListeners, setFinderCache, setFlushBeforeQueries, setFlushBeforeQueries, setIgnoreChanges, setIgnoreChanges, setInitializeEagerly, setInstrumentation, setInverseManager, setLifecycleEventManager, setLockManager, setLockTimeout, setLockTimeout, setManagedRuntime, setManagedRuntime, setMapping, setMaxFetchDepth, setMaxFetchDepth, setMetaDataFactory, setMetaDataRepository, setMetaDataRepository, setMultithreaded, setMultithreaded, setNontransactionalRead, setNontransactionalRead, setNontransactionalWrite, setNontransactionalWrite, setOptimistic, setOptimistic, setOptimizeIdCopy, setOptimizeIdCopy, setOrphanedKeyAction, setOrphanedKeyAction, setPostLoadOnMerge, setPostLoadOnMerge, setProxyManager, setProxyManager, setQueryCache, setQueryCompilationCache, setQuerySQLCache, setQuerySQLCache, setQueryTimeout, setReadLockLevel, setReadLockLevel, setRefreshFromDataCache, setRefreshFromDataCache, setRemoteCommitEventManager, setRemoteCommitProvider, setRestoreState, setRestoreState, setRetainState, setRetainState, setRetryClassRegistration, setRetryClassRegistration, setRuntimeUnenhancedClasses, setRuntimeUnenhancedClasses, setSavepointManager, setSequence, setSequence, setSpecification, setSpecification, setTransactionMode, setTransactionModeManaged, setTypesWithoutEnhancement, setUseTCCLinSelectNew, setUseTCCLinSelectNew, setValidationFactory, setValidationGroupPrePersist, setValidationGroupPreRemove, setValidationGroupPreUpdate, setValidationMode, setValidatorInstance, setWriteLockLevel, setWriteLockLevel, supportedOptions
-
-
-
-
Method Detail
-
getActiveSliceNames
java.util.List<java.lang.String> getActiveSliceNames()
Gets the active slice identifiers. This list is determined by the configuration properties either by explicit listing inopenjpa.slice.Namesproperty or by scanningopenjpa.slice.*.*properties.
The ordering of the slice identifiers is determined when they are specified explicitly inopenjpa.slice.Namesproperty or ordered alphabetically when found by scanning the properties.
This list always returns the identifiers that are active, slices that can not be connected to are not included in this list.
-
getAvailableSliceNames
java.util.List<java.lang.String> getAvailableSliceNames()
Gets the available slice identifiers irrespective of their status.- Returns:
-
getSlices
java.util.List<Slice> getSlices(Slice.Status... statuses)
Gets the slices of given status.- Parameters:
statuses- list of status flags. If null, returns all slices irrespective of status.
-
getSlice
Slice getSlice(java.lang.String sliceName)
Gets the Slice for a given name. Exception is raised if the given slice is not configured.
-
getDistributionPolicyInstance
DistributionPolicy getDistributionPolicyInstance()
Gets the policy that governs how new instances will be distributed across the available slices.
-
setDistributionPolicyInstance
void setDistributionPolicyInstance(DistributionPolicy policy)
Sets the policy that governs how new instances will be distributed across the available slices.
-
getDistributionPolicy
java.lang.String getDistributionPolicy()
Gets the policy, as a plugin string, that governs how new instances will be distributed across the available slices.
-
setDistributionPolicy
void setDistributionPolicy(java.lang.String policy)
Sets the policy, from the given plugin string, that governs how new instances will be distributed across the available slices.
-
getReplicationPolicyInstance
ReplicationPolicy getReplicationPolicyInstance()
Gets the policy that governs how new replicated instances will be replicated across the available slices.
-
getReplicationPolicy
java.lang.String getReplicationPolicy()
Gets the policy, as a plugin string, that governs how new replicated instances will be replicated across the available slices.
-
setReplicationPolicyInstance
void setReplicationPolicyInstance(ReplicationPolicy policy)
Sets the policy that governs how new replicated instances will be replicated across the available slices.
-
setReplicationPolicy
void setReplicationPolicy(java.lang.String policy)
Sets the policy, from the given plugin string, that governs how new replicated instances will be replicated across the available slices.
-
isReplicated
boolean isReplicated(java.lang.Class<?> type)
Affirms if the given type is replicated.
-
getQueryTargetPolicyInstance
QueryTargetPolicy getQueryTargetPolicyInstance()
Gets the policy that governs which slices will be targeted for a given query.
-
getQueryTargetPolicy
java.lang.String getQueryTargetPolicy()
Gets the policy, as a plugin string, that governs which slices will be targeted for a given query.
-
setQueryTargetPolicyInstance
void setQueryTargetPolicyInstance(QueryTargetPolicy policy)
Sets the policy that governs which slices will be targeted for a given query.
-
setQueryTargetPolicy
void setQueryTargetPolicy(java.lang.String policy)
Sets the policy, from the given plugin string, that governs which slices will be targeted for a given query.
-
getFinderTargetPolicyInstance
FinderTargetPolicy getFinderTargetPolicyInstance()
Gets the policy that governs which slices will be targeted for a given finder.
-
getFinderTargetPolicy
java.lang.String getFinderTargetPolicy()
Gets the policy, as a plugin string, that governs which slices will be targeted for a given finder.
-
setFinderTargetPolicyInstance
void setFinderTargetPolicyInstance(FinderTargetPolicy policy)
Sets the policy that governs which slices will be targeted for a given finder.
-
setFinderTargetPolicy
void setFinderTargetPolicy(java.lang.String policy)
Sets the policy, from the given plugin string, that governs which slices will be targeted for a given finder.
-
-