com.neeve.ods
Class StoreBindingFactory

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.ods.OdsObject
          extended by com.neeve.ods.StoreBindingFactory

public final class StoreBindingFactory
extends OdsObject

The store binding factory.

The store binding factory, a singleton object, provides methods to create store bindings.

Threading:
The store binding factory is not safe for concurrent access by multiple threads.

Field Summary
static int FLG_CREATE_CORE_BINDING
          Indicates a request for a store binding implementation to return an instance of the core binding.
static int FLG_EVENT_SOURCING
          Indicates that the application is operating in event sourcing mode.
 
Method Summary
 IStoreBinding createBinding(String memberName, StoreDescriptor descriptor, IStoreEventHandler eventHandler)
          Bind to a store using a store descriptor.
 IStoreBinding createBinding(String memberName, StoreDescriptor descriptor, IStoreEventHandler eventHandler, int flags)
          Bind to a store using a store descriptor.
 IStoreBinding createBinding(String memberName, StoreDescriptor descriptor, IStoreEventHandler eventHandler, IStoreReplicatorNotificationHandler replicatorNotificationHandler)
          Bind to a store using a store descriptor.
 IStoreBinding createBinding(String memberName, StoreDescriptor descriptor, IStoreEventHandler eventHandler, IStoreReplicatorNotificationHandler replicatorNotificationHandler, int flags)
          Bind to a store using a store descriptor.
 IStoreBinding createBinding(String memberName, String storeName, IStoreEventHandler eventHandler)
          Convenience method to create a binding using a store descriptor loaded from the default configuration repository.
 IStoreBinding createBinding(String memberName, String storeName, IStoreEventHandler eventHandler, int flags)
          Convenience method to create a binding using a store descriptor loaded from the default configuration repository.
 IStoreBinding createBinding(String memberName, String storeName, IStoreEventHandler eventHandler, IStoreReplicatorNotificationHandler replicatorNotificationHandler, int flags)
          Convenience method to create a binding using a store descriptor loaded from the default configuration repository.
static StoreBindingFactory getInstance()
          Get the singleton store binding factory instance.
 
Methods inherited from class com.neeve.root.RootObject
getChecked, getThreaded, getTracer, setChecked, setTracer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLG_EVENT_SOURCING

public static final int FLG_EVENT_SOURCING
Indicates that the application is operating in event sourcing mode.

This flag is used during binding creation to specify that the application is operating in event sourcing mode (as opposed to state replication mode. When this flag is set, ODS only replicates send operations and does not replicate state change operations. State can be maintained in ODS but is just not replicated. Also, when operating in event sourcing mode, ODS materializes state from the persistent store for primaries and backups. In state replication mode, state is materialized only for primaries while backups initialize their state from the operating primary at the time the backup joins the store.

See Also:
Constant Field Values

FLG_CREATE_CORE_BINDING

public static final int FLG_CREATE_CORE_BINDING
Indicates a request for a store binding implementation to return an instance of the core binding.

The core ODS store binding implementation requires the user of the binding to perform sequencing of member control events. By default, the factory will create an instance of the binding that wraps around the core binding and delegates store method calls to the core binding and sequences the method calls along with the member control events. This flag overrides that behavior. If specified, the factory will instantiate the core binding and return to the caller.

See Also:
Constant Field Values
Method Detail

getInstance

public static final StoreBindingFactory getInstance()
Get the singleton store binding factory instance.

Threading:
This method is safe for concurrent access by multiple threads.

createBinding

public final IStoreBinding createBinding(String memberName,
                                         StoreDescriptor descriptor,
                                         IStoreEventHandler eventHandler,
                                         IStoreReplicatorNotificationHandler replicatorNotificationHandler,
                                         int flags)
                                  throws OdsException
Bind to a store using a store descriptor.

Parameters:
memberName - The name of the member establishing the store binding. The member name needs to be unique across all members (bindings) of a store. This value can be null in which case a unique name will be dynamically created to for the user of the binding being established. The caller is responsible for ensuring uniqueness of the name across all store members in case a non-null value is specified.
descriptor - The descriptor describing the store to bind to.
eventHandler - The event handler to be used by the created binding to dispatch its events.
replicatorNotificationHandler - The handler used by the created replicator, if one is created, to dispatch its operational notifications.
flags - Specifies flags used to qualify the creation of the binding. The following flags are permitted for use currently:
  - FLG_EVENT_SOURCING
  - FLG_CREATE_CORE_BINDING
Throws:
OdsException - Thrown in case an error occurs during the creation of the binding.
Threading:
This method is not safe for concurrent access by multiple threads.

createBinding

public final IStoreBinding createBinding(String memberName,
                                         StoreDescriptor descriptor,
                                         IStoreEventHandler eventHandler,
                                         int flags)
                                  throws OdsException
Bind to a store using a store descriptor.

This method invokes createBinding(memberName, descriptor, eventHandler, null, flags)

Throws:
OdsException

createBinding

public final IStoreBinding createBinding(String memberName,
                                         StoreDescriptor descriptor,
                                         IStoreEventHandler eventHandler,
                                         IStoreReplicatorNotificationHandler replicatorNotificationHandler)
                                  throws OdsException
Bind to a store using a store descriptor.

This method invokes createBinding(memberName, descriptor, eventHandler, replicatorNotificationHandler, 0)

Throws:
OdsException

createBinding

public final IStoreBinding createBinding(String memberName,
                                         StoreDescriptor descriptor,
                                         IStoreEventHandler eventHandler)
                                  throws OdsException
Bind to a store using a store descriptor.

This method invokes createBinding(memberName, descriptor, eventHandler, null)

Throws:
OdsException

createBinding

public final IStoreBinding createBinding(String memberName,
                                         String storeName,
                                         IStoreEventHandler eventHandler,
                                         IStoreReplicatorNotificationHandler replicatorNotificationHandler,
                                         int flags)
                                  throws OdsException
Convenience method to create a binding using a store descriptor loaded from the default configuration repository.

This method invokes createBinding(memberName, StoreDescriptor.load(storeName), eventHandler, replicatorNotificationHandler, flags)

Throws:
OdsException

createBinding

public final IStoreBinding createBinding(String memberName,
                                         String storeName,
                                         IStoreEventHandler eventHandler)
                                  throws OdsException
Convenience method to create a binding using a store descriptor loaded from the default configuration repository.

This method invokes createBinding(memberName, storeName, eventHandler, null, 0)

Throws:
OdsException

createBinding

public final IStoreBinding createBinding(String memberName,
                                         String storeName,
                                         IStoreEventHandler eventHandler,
                                         int flags)
                                  throws OdsException
Convenience method to create a binding using a store descriptor loaded from the default configuration repository.

This method invokes createBinding(memberName, storeName, eventHandler, null, flags)

Throws:
OdsException


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.