com.neeve.discovery
Class DiscoveryCacheFactory

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.discovery.DiscoveryObject
          extended by com.neeve.discovery.DiscoveryCacheFactory

public final class DiscoveryCacheFactory
extends DiscoveryObject

The discovery cache factory.

The discovery cache factory, a singleton object, provides methods to create discovery caches.

Threading:
The discovery cache factory is not safe for concurrent access by multiple threads.

Field Summary
static String DEFAULT_CACHE_DESCRIPTOR
          Default discovery URL (if not overriden by nv.discovery.descriptor property)
static int FLG_NO_AUTOOPEN
          Flag used in cache creation to not automatically open the cache during creation
 
Method Summary
 void close()
          Close all created caches.
 IDiscoveryCache createCache(String descriptorStr)
          Create a discovery cache.
 IDiscoveryCache createCache(String descriptorStr, int flags)
          Create a discovery cache.
 IDiscoveryCache getDefaultCache()
          Get the process wide singleton discovery cache.
static DiscoveryCacheFactory getInstance()
          Get the singleton discovery cache factory instance.
 boolean isDefaultCache(IDiscoveryCache cache)
          Get if a cache is the default cache.
 
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

DEFAULT_CACHE_DESCRIPTOR

public static final String DEFAULT_CACHE_DESCRIPTOR
Default discovery URL (if not overriden by nv.discovery.descriptor property)


FLG_NO_AUTOOPEN

public static final int FLG_NO_AUTOOPEN
Flag used in cache creation to not automatically open the cache during creation

See Also:
Constant Field Values
Method Detail

getInstance

public static final DiscoveryCacheFactory getInstance()
Get the singleton discovery cache factory instance.

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

createCache

public final IDiscoveryCache createCache(String descriptorStr,
                                         int flags)
                                  throws EDiscoveryException
Create a discovery cache.

Parameters:
descriptorStr - The string representation of an address descriptor that describes the cache to create e.g. mcast://224.0.23.180:4090
flags - Flags tha qualify the creation of the cache. The following flags are currently supported
- FLG_NO_AUTOOPEN
Throws:
EDiscoveryException - Thrown in case an error occurs during the creation of the cache.
Threading:
This method is safe for concurrent access by multiple threads.

createCache

public final IDiscoveryCache createCache(String descriptorStr)
                                  throws EDiscoveryException
Create a discovery cache.

This method invokes createCache(descriptorStr, null)

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

getDefaultCache

public final IDiscoveryCache getDefaultCache()
Get the process wide singleton discovery cache.

This method returns the process wide singleton discovery cache. The singlton cache is created by invoking createCache(java.lang.String, int) using DEFAULT_CACHE_DESCRIPTOR as the cache descriptor.

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

isDefaultCache

public final boolean isDefaultCache(IDiscoveryCache cache)
Get if a cache is the default cache.

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

close

public final void close()
Close all created caches.

This should be the last call to the factory.

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


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