Interface DistributedConfiguration

All Superinterfaces:
BeanInfo, Cloneable, Closeable, Configuration, OpenJPAConfiguration, 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 policies
  • Distribution Policy governs how new instances be distributed among the slices.
  • Replication Policy maintains the same instance in multiple slices.
  • Query Target Policy narrows the slices for a query execution.
  • Finder Target Policy narrows the slices for primary key based lookup
  • Author:
    Pinaki Poddar
    • Method Details

      • getActiveSliceNames

        List<String> getActiveSliceNames()
        Gets the active slice identifiers. This list is determined by the configuration properties either by explicit listing in openjpa.slice.Names property or by scanning openjpa.slice.*.* properties.
        The ordering of the slice identifiers is determined when they are specified explicitly in openjpa.slice.Names property 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

        List<String> getAvailableSliceNames()
        Gets the available slice identifiers irrespective of their status.
        Returns:
      • getSlices

        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(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

        String getDistributionPolicy()
        Gets the policy, as a plugin string, that governs how new instances will be distributed across the available slices.
      • setDistributionPolicy

        void setDistributionPolicy(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

        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(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(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

        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(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

        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(String policy)
        Sets the policy, from the given plugin string, that governs which slices will be targeted for a given finder.