net.refractions.udig.catalog.memory
Class MemoryServiceExtensionImpl

java.lang.Object
  extended by net.refractions.udig.catalog.memory.MemoryServiceExtensionImpl
All Implemented Interfaces:
ServiceExtension

public class MemoryServiceExtensionImpl
extends java.lang.Object
implements ServiceExtension


Field Summary
static java.util.Map<java.net.URL,MemoryServiceImpl> impl
           
static java.lang.String KEY
          service creation key
static java.lang.String MEMBER_PARAM
          This param indicates a FeatureType that needs to be created in the DataStore.
static java.net.URL URL
          special memory service url
 
Fields inherited from interface net.refractions.udig.catalog.ServiceExtension
EXTENSION_ID
 
Constructor Summary
MemoryServiceExtensionImpl()
           
MemoryServiceExtensionImpl(MemoryDSFactory factory)
          This permits the use of a custom sub-class of an ActiveMemoryDataStore.
 
Method Summary
 java.util.Map<java.lang.String,java.io.Serializable> createParams(java.net.URL url)
          The primary intention is for drag 'n' drop.
 IService createService(java.net.URL id2, java.util.Map<java.lang.String,java.io.Serializable> params)
          Creates an IService based on the params provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final java.lang.String KEY
service creation key

See Also:
Constant Field Values

URL

public static final java.net.URL URL
special memory service url


impl

public static final java.util.Map<java.net.URL,MemoryServiceImpl> impl

MEMBER_PARAM

public static final java.lang.String MEMBER_PARAM
This param indicates a FeatureType that needs to be created in the DataStore.

Since MemoryData store is volatile there needs to be a way to specify what FeatureTypes the DataStore has using the parameters.

See Also:
Constant Field Values
Constructor Detail

MemoryServiceExtensionImpl

public MemoryServiceExtensionImpl()

MemoryServiceExtensionImpl

public MemoryServiceExtensionImpl(MemoryDSFactory factory)
This permits the use of a custom sub-class of an ActiveMemoryDataStore. If this is null, this extension will use the default implementation.

Parameters:
factory - providing custom datastore to be used or null
Method Detail

createService

public IService createService(java.net.URL id2,
                              java.util.Map<java.lang.String,java.io.Serializable> params)
Description copied from interface: ServiceExtension
Creates an IService based on the params provided. This may or may not return a singleton, caching is optional. Error messages can be retrieved using the getStatus and getMessage methods. It is important to note that this method must inspect the url to determine if it can be used to create the service. If it cannot, null must be returned.

Specified by:
createService in interface ServiceExtension
Parameters:
id2 - The sugested service id, should be generated when null.
params - The set of connection params. These param values may either be parsed, or unparsed (String).
Returns:
the IService created, or null when a service cannot be created from these params.
See Also:
IResolve.getStatus(), IResolve.getMessage()

createParams

public java.util.Map<java.lang.String,java.io.Serializable> createParams(java.net.URL url)
Description copied from interface: ServiceExtension
The primary intention is for drag 'n' drop. This generates a set of params for the given URL ... in most cases this will be passed to the createService method. It is important to note that this method must inspect the url to determine if it can be used to create the service. If it cannot, null must be returned.

Specified by:
createParams in interface ServiceExtension
Parameters:
url - The potential source of params.
Returns:
Map of params to be used for creation, null if the URL cannot be used.