|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.config.interfaces.MetamergeConfigFactory
public class MetamergeConfigFactory
The MetamergeConfigFactory class provides a number of static methods for use by applications to obtain MetamergeConfig objects. Each MetamergeConfig object is registered in the global namespace with a unique name. This namespace is used by MetamergeConfig objects when they refer to object in other configurations. The resolving of names is also provided by this class. Typically, a MetamergeConfig object will always call the isNameLocal() method to determine whether a name is handled by itself or another MetamergeConfig object. In the latter case a subsequent call to the lookup() method will cause this class to resolve, and potentially load, the MetamergeConfig object that is able to access the named object.
Name | Description |
---|---|
javax.naming.Context.PROVIDER_URL | The URL the driver uses to locate the configuration store |
MetamergeConfigFactory.MC_DRIVER | The class name for the MetamergeConfig implementation |
MetamergeConfigFactory.MC_CREATE | Specifies wether the driver should create the endpoint if it does not exist |
MetamergeConfigFactory.MC_PARSER | The class name for the parser (if the driver needs one) |
MetamergeConfigFactory.MC_DEBUG | true/false to set the debug flag in the driver |
For example, if A calls lookup using ext:Properties as name and A also has a namespace (e.g. external reference) named ext defined, this class will load the MetamergeConfig as defined by A's local namespace definition. Assuming A's namespace definition looks like this: ext ---> d:/mm/ext.cfg then that file will be loaded and registered in the global namespace as d:/mm/ext.cfg. The local namespace reference is only valid for the calling MetamergeConfig object but the MetamergeConfig object it refers to may be used by other MetamergeConfig objects as well. For example, B might have a similar configuration but instead of ext it may refer to d:/mm/ext.cfg as library. When B then calls lookup with library:Properties this class will then find out that the file (d:/mm/ext.cfg) is already loaded and that instance is reused for B as well. Thus, there are local namespace references and global namespace references. Local namespace references are valid only in the MetamergeConfig object they are defined whereas global namespace references (like system) are globally available.
Field Summary | |
---|---|
static java.lang.String |
ADAPTERS_NAMESPACE
Reserved namespace ID for adapters |
static java.lang.String |
DEFAULT_DRIVER
This is the default driver class if none is discovered/specified. |
static Log |
logger
This is the Log object used by this class and other configuration drivers. |
static java.lang.String |
MC_CREATE
Driver parameter - Specify "true" or "false" to tell the driver whether a configuration URL should be created |
static java.lang.String |
MC_DEBUG
Driver parameter - Specify "true" or "false" to set the debug mode option for the driver |
static java.lang.String |
MC_DRIVER
MetamergeConfigFactory parameter - Specifies the driver class name to use. |
static java.lang.String |
MC_ENCRYPT
Force use of server public key encryption by setting this prop to "true". |
static java.lang.String |
MC_NAMESPACE
The namespace, which a given MetamergeConfig object represents. |
static java.lang.String |
MC_NO_DEFAULT_FOLDERS
Used to avoid creating default folders. |
static java.lang.String |
MC_PARSER
Driver parameter - If driver needs a parser this parameter specifies the class to use |
static java.lang.String |
MC_URL
MetamergeConfigFactory parameter - Specifies the URL |
static java.lang.String |
STDFORMS_NAMESPACE
Reserved namespace ID for standard forms etc ... |
static java.lang.String |
SYSTEM_NAMESPACE
Reserved namespace ID for installed components etc ... |
Constructor Summary | |
---|---|
MetamergeConfigFactory()
|
Method Summary | |
---|---|
static void |
addNamespaceListener(java.awt.event.ActionListener listener)
Adds listener to the list of object to notify when namespaces are added/removed |
static java.lang.String |
addPackage(java.lang.String path)
Adds a package to the packages namespace. |
static java.util.List<java.lang.String> |
addPackages(java.util.List<java.lang.String> packages)
Adds a list of packages to the packages namespace. |
static boolean |
canRemoveNamespace(java.lang.String namedURL)
|
static void |
copy(BaseConfiguration input,
MetamergeConfig dest,
javax.naming.Name destName)
Recursively copy input configuration to another MetamergeConfig object |
static void |
copy(BaseConfiguration input,
MetamergeConfig dest,
javax.naming.Name destName,
boolean overwrite)
Recursively copy input configuration to another MetamergeConfig object |
static void |
copyFolder(MetamergeFolder folder,
MetamergeConfig dest,
javax.naming.Name destName)
Recursively copies a folder to another MetamergeConfig object. |
static void |
copyFolder(MetamergeFolder folder,
MetamergeConfig dest,
javax.naming.Name destName,
boolean overwrite)
Recursively copies a folder to another MetamergeConfig object. |
static void |
copyObject(BaseConfiguration source,
BaseConfiguration dest)
Recursively copies an object to another MetamergeConfig object. |
static MetamergeConfig |
createSysInstance(java.util.Vector<java.lang.String> paths)
Gets an combined instance for a Vector of files. |
static boolean |
garbageCollect()
Removes the MetamergeConfig objects from the global namespace if there are no more references to it. |
static MetamergeConfig |
getCFGFileInstance(java.lang.Object path)
Gets an instance of the driver for old-style config files. |
static MetamergeConfig |
getCFGFileInstance(java.lang.Object path,
java.lang.String password)
Gets an instance of the driver for old-style config files |
static MetamergeConfig |
getFileInstance(java.lang.Object path)
Returns an instance of a MetamergeConfig driver using path as parameter |
static MetamergeConfig |
getInstance(java.util.Hashtable env)
Returns an instance of a MetamergeConfig driver using env as parameter |
static MetamergeConfig |
getLocalNamespace(MetamergeConfig referent,
java.lang.Object name)
Returns the MetamergeConfig associated with the provided namespace. |
static java.lang.Object |
getLocalNamespaceFor(MetamergeConfig referent,
BaseConfiguration config)
Returns the local namespace for a component. |
static MetamergeConfig |
getNamespace(java.lang.Object name)
Returns the MetamergeConfig associated with the provided namespace. |
static java.lang.Object |
getNamespaceFor(BaseConfiguration config)
Returns the namespace to which a configuration object belongs or null if the object does not belong to a registered namespace. |
static java.lang.Object[] |
getNamespaces()
Returns a list of registered namespaces. |
static java.util.Properties |
getNameSyntax()
Gets the javax.naming NameSyntax properties used in Metamerge configuration drivers. |
static java.util.List<MetamergeConfig> |
getPackages()
Returns a list of packaged config files |
static ResourceHash |
getResHash()
|
static boolean |
getUseConfigListeners()
|
static boolean |
isNameLocal(MetamergeConfig mc,
java.lang.Object name)
Returns true if the name is local to the given MetamergeConfig. |
static boolean |
isStandardObject(java.lang.Object objname)
Returns true if the object name represents a standard object in the configuration space. |
static MetamergeConfig |
loadNamespace(NamespaceConfig nc)
Returns a MetamergeConfig object for the provided NamespaceConfig. |
static MetamergeConfig |
loadNamespace(java.lang.String url)
Returns a MetamergeConfig object for the provided url. |
static void |
logmsg(java.lang.String msg)
Convenience method to log a message to the system log. |
static java.lang.Object |
lookup(MetamergeConfig mc,
java.lang.Object name)
Performs a lookup in the global namespace for name. |
static void |
namespaceChanged(java.lang.String ns,
MetamergeConfig mc,
boolean added)
|
static javax.naming.Name |
parseName(java.lang.Object name)
This method parses a name which can either be an instance of javax.naming.Name or any object implementing the toString() method. |
static void |
registerNamespace(java.lang.Object name,
MetamergeConfig mc)
Registers a MetamergeConfig object in the global namespace. |
static void |
removeNamespace(java.lang.Object name)
Returns the MetamergeConfig associated with the provided namespace. |
static void |
removeNamespaceListener(java.awt.event.ActionListener listener)
|
static boolean |
removePackage(MetamergeConfig mc)
Removes a package from the in-memory list of packages. |
static MetamergeConfig |
resolve(MetamergeConfig mc,
javax.naming.Name name)
Resolves a namespace reference into a Metamergeconfig object. |
static void |
setUseConfigListeners(boolean value)
Enable/disable the use of configuration listeners in the JVM. |
static void |
unregisterNamespace(java.lang.Object ns)
Puts a MetamergeConfig object onto the unloadPending stack and calls garbageCollect. |
static void |
verifyInheritanceChain(BaseConfiguration config,
java.lang.Object inheritFrom)
Verify that inheritance chain does not loop. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SYSTEM_NAMESPACE
public static final java.lang.String STDFORMS_NAMESPACE
public static final java.lang.String ADAPTERS_NAMESPACE
public static final java.lang.String MC_PARSER
public static final java.lang.String MC_DEBUG
public static final java.lang.String MC_CREATE
public static final java.lang.String MC_DRIVER
public static final java.lang.String MC_URL
public static final java.lang.String MC_ENCRYPT
public static final java.lang.String MC_NAMESPACE
public static final java.lang.String MC_NO_DEFAULT_FOLDERS
public static final java.lang.String DEFAULT_DRIVER
public static final Log logger
Constructor Detail |
---|
public MetamergeConfigFactory()
Method Detail |
---|
public static ResourceHash getResHash()
public static java.util.Properties getNameSyntax()
public static MetamergeConfig getFileInstance(java.lang.Object path) throws java.lang.Exception
path
- input file/parh/url ....
java.lang.Exception
public static MetamergeConfig getInstance(java.util.Hashtable env) throws java.lang.Exception
env
- Table of parameters
java.lang.Exception
public static MetamergeConfig getCFGFileInstance(java.lang.Object path) throws java.lang.Exception
path
- CFG file/url name
java.lang.Exception
public static MetamergeConfig getCFGFileInstance(java.lang.Object path, java.lang.String password) throws java.lang.Exception
path
- CFG file/urlpassword
- Password to access path
java.lang.Exception
public static MetamergeConfig createSysInstance(java.util.Vector<java.lang.String> paths)
paths
- A Vector containing Strings, each representing an URL.
public static MetamergeConfig getNamespace(java.lang.Object name)
name
- The namespace name
public static void removeNamespace(java.lang.Object name)
name
- The namespace namepublic static MetamergeConfig getLocalNamespace(MetamergeConfig referent, java.lang.Object name)
name
- The namespace name
public static java.lang.Object getNamespaceFor(BaseConfiguration config)
config
- Configuration object obtained from a MetamergeConfig object
public static java.lang.Object getLocalNamespaceFor(MetamergeConfig referent, BaseConfiguration config)
referent
- The MetamergeConfig object to search for local namespacesconfig
- The configuration object
public static java.lang.Object[] getNamespaces()
public static boolean isNameLocal(MetamergeConfig mc, java.lang.Object name) throws java.lang.Exception
mc
- A MetamergeConfig objectname
- The name of the MetamergeConfig object
java.lang.Exception
public static javax.naming.Name parseName(java.lang.Object name) throws javax.naming.InvalidNameException
name
- null, javax.namgin.Name or an object having a toString()
method
javax.naming.InvalidNameException
public static void registerNamespace(java.lang.Object name, MetamergeConfig mc)
name
- Unique namemc
- MetamergeConfig objectpublic static void unregisterNamespace(java.lang.Object ns)
ns
- public static boolean garbageCollect()
public static boolean canRemoveNamespace(java.lang.String namedURL)
public static MetamergeConfig loadNamespace(java.lang.String url) throws java.lang.Exception
url
- URL to load/locate
java.lang.Exception
public static MetamergeConfig loadNamespace(NamespaceConfig nc) throws java.lang.Exception
nc
- NamespaceConfig to load/locate
java.lang.Exception
public static MetamergeConfig resolve(MetamergeConfig mc, javax.naming.Name name) throws java.lang.Exception
mc
- The MetamergeConfig object requesting namename
- The name to resolve
java.lang.Exception
public static java.lang.Object lookup(MetamergeConfig mc, java.lang.Object name) throws java.lang.Exception
mc
- Calling MetamergeConfigname
- The name to lookup
java.lang.Exception
public static void copy(BaseConfiguration input, MetamergeConfig dest, javax.naming.Name destName) throws java.lang.Exception
input
- Object to copydest
- MetamergeConfig object to receive copydestName
- Name of copied object in dest config
java.lang.Exception
public static void copy(BaseConfiguration input, MetamergeConfig dest, javax.naming.Name destName, boolean overwrite) throws java.lang.Exception
input
- Object to copydest
- MetamergeConfig object to receive copydestName
- Name of copied object in dest configoverwrite
- flag indicating whether to overwrite in case of copying folder
java.lang.Exception
public static void copyFolder(MetamergeFolder folder, MetamergeConfig dest, javax.naming.Name destName) throws java.lang.Exception
folder
- The folder to copydest
- The config that receives the copydestName
- The name the copy gets
java.lang.Exception
public static void copyFolder(MetamergeFolder folder, MetamergeConfig dest, javax.naming.Name destName, boolean overwrite) throws java.lang.Exception
folder
- The folder to copydest
- The config that receives the copydestName
- The name the copy getsoverwrite
- flag indicating whether to overwrite
java.lang.Exception
public static void copyObject(BaseConfiguration source, BaseConfiguration dest)
source
- The object to copydest
- The config that receives the copypublic static void logmsg(java.lang.String msg)
msg
- The message to logpublic static void verifyInheritanceChain(BaseConfiguration config, java.lang.Object inheritFrom) throws java.lang.Exception
java.lang.Exception
public static boolean isStandardObject(java.lang.Object objname)
public static java.util.List<java.lang.String> addPackages(java.util.List<java.lang.String> packages)
packages
- List of absolute pathspublic static boolean removePackage(MetamergeConfig mc) throws java.lang.Exception
mc
- The package to remove
java.lang.Exception
public static java.lang.String addPackage(java.lang.String path) throws java.lang.Exception
path
- The absolute path of the file
java.lang.Exception
public static java.util.List<MetamergeConfig> getPackages() throws java.lang.Exception
java.lang.Exception
public static void addNamespaceListener(java.awt.event.ActionListener listener)
public static void removeNamespaceListener(java.awt.event.ActionListener listener)
public static void namespaceChanged(java.lang.String ns, MetamergeConfig mc, boolean added)
public static void setUseConfigListeners(boolean value)
value
- False to disable configuration listeners.public static boolean getUseConfigListeners()
setUseConfigListeners(boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |