|
|||||||||||
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 String |
ADAPTERS_NAMESPACE
Reserved namespace ID for adapters |
static 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 String |
MC_CONFIG_DIRECTORY
Used to override the location returned by MetamergeConfig.getDirectory() |
static String |
MC_CREATE
Driver parameter - Specify "true" or "false" to tell the driver whether a configuration URL should be created |
static String |
MC_DEBUG
Driver parameter - Specify "true" or "false" to set the debug mode option for the driver |
static String |
MC_DRIVER
MetamergeConfigFactory parameter - Specifies the driver class name to use. |
static String |
MC_ENCRYPT
Force use of server public key encryption by setting this prop to "true". |
static String |
MC_NAMESPACE
The namespace, which a given MetamergeConfig object represents. |
static String |
MC_NO_DEFAULT_FOLDERS
Used to avoid creating default folders. |
static String |
MC_PARSER
Driver parameter - If driver needs a parser this parameter specifies the class to use |
static String |
MC_URL
MetamergeConfigFactory parameter - Specifies the URL |
static String |
STDFORMS_NAMESPACE
Reserved namespace ID for standard forms etc ... |
static String |
SYSTEM_NAMESPACE
Reserved namespace ID for installed components etc ... |
Constructor Summary | |
---|---|
MetamergeConfigFactory()
|
Method Summary | |
---|---|
static void |
addNamespaceListener(ActionListener listener)
Deprecated. |
static String |
addPackage(String path)
Adds a package to the packages namespace. |
static List<String> |
addPackages(List<String> packages)
Adds a list of packages to the packages namespace. |
static boolean |
canRemoveNamespace(String namedURL)
|
static void |
copy(BaseConfiguration input,
MetamergeConfig dest,
Name destName)
Recursively copy input configuration to another MetamergeConfig object |
static void |
copy(BaseConfiguration input,
MetamergeConfig dest,
Name destName,
boolean overwrite)
Recursively copy input configuration to another MetamergeConfig object |
static void |
copyFolder(MetamergeFolder folder,
MetamergeConfig dest,
Name destName)
Recursively copies a folder to another MetamergeConfig object. |
static void |
copyFolder(MetamergeFolder folder,
MetamergeConfig dest,
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(Vector<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(Object path)
Gets an instance of the driver for old-style config files. |
static MetamergeConfig |
getCFGFileInstance(Object path,
String password)
Gets an instance of the driver for old-style config files |
static MetamergeConfig |
getFileInstance(Object path)
Returns an instance of a MetamergeConfig driver using path as parameter |
static MetamergeConfig |
getInstance(Hashtable env)
Returns an instance of a MetamergeConfig driver using env as parameter |
static MetamergeConfig |
getLocalNamespace(MetamergeConfig referent,
Object name)
Returns the MetamergeConfig associated with the provided namespace. |
static Object |
getLocalNamespaceFor(MetamergeConfig referent,
BaseConfiguration config)
Returns the local namespace for a component. |
static MetamergeConfig |
getNamespace(Object name)
Returns the MetamergeConfig associated with the provided namespace. |
static 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 Object[] |
getNamespaces()
Returns a list of registered namespaces. |
static Properties |
getNameSyntax()
Gets the javax.naming NameSyntax properties used in Metamerge configuration drivers. |
static List<MetamergeConfig> |
getPackages()
Returns a list of packaged config files |
static ResourceHash |
getResHash()
|
static boolean |
getUseConfigListeners()
|
static boolean |
isNameLocal(MetamergeConfig mc,
Object name)
Returns true if the name is local to the given MetamergeConfig. |
static boolean |
isStandardObject(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(String url)
Returns a MetamergeConfig object for the provided url. |
static void |
logmsg(String msg)
Convenience method to log a message to the system log. |
static Object |
lookup(MetamergeConfig mc,
Object name)
Performs a lookup in the global namespace for name. |
static void |
namespaceChanged(String ns,
MetamergeConfig mc,
boolean added)
Deprecated. |
static Name |
parseName(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(Object name,
MetamergeConfig mc)
Registers a MetamergeConfig object in the global namespace. |
static void |
removeNamespace(Object name)
Returns the MetamergeConfig associated with the provided namespace. |
static void |
removeNamespaceListener(ActionListener listener)
Deprecated. |
static boolean |
removePackage(MetamergeConfig mc)
Removes a package from the in-memory list of packages. |
static MetamergeConfig |
resolve(MetamergeConfig mc,
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(Object ns)
Puts a MetamergeConfig object onto the unloadPending stack and calls garbageCollect. |
static void |
verifyInheritanceChain(BaseConfiguration config,
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 String SYSTEM_NAMESPACE
public static final String STDFORMS_NAMESPACE
public static final String ADAPTERS_NAMESPACE
public static final String MC_PARSER
public static final String MC_DEBUG
public static final String MC_CREATE
public static final String MC_DRIVER
public static final String MC_URL
public static final String MC_ENCRYPT
public static final String MC_NAMESPACE
public static final String MC_NO_DEFAULT_FOLDERS
public static final String MC_CONFIG_DIRECTORY
public static final String DEFAULT_DRIVER
public static final Log logger
Constructor Detail |
---|
public MetamergeConfigFactory()
Method Detail |
---|
public static ResourceHash getResHash()
public static Properties getNameSyntax()
public static MetamergeConfig getFileInstance(Object path) throws Exception
path
- input file/parh/url ....
Exception
public static MetamergeConfig getInstance(Hashtable env) throws Exception
env
- Table of parameters
Exception
public static MetamergeConfig getCFGFileInstance(Object path) throws Exception
path
- CFG file/url name
Exception
public static MetamergeConfig getCFGFileInstance(Object path, String password) throws Exception
path
- CFG file/urlpassword
- Password to access path
Exception
public static MetamergeConfig createSysInstance(Vector<String> paths)
paths
- A Vector containing Strings, each representing an URL.
public static MetamergeConfig getNamespace(Object name)
name
- The namespace name
public static void removeNamespace(Object name)
name
- The namespace namepublic static MetamergeConfig getLocalNamespace(MetamergeConfig referent, Object name)
name
- The namespace name
public static Object getNamespaceFor(BaseConfiguration config)
config
- Configuration object obtained from a MetamergeConfig object
public static Object getLocalNamespaceFor(MetamergeConfig referent, BaseConfiguration config)
referent
- The MetamergeConfig object to search for local namespacesconfig
- The configuration object
public static Object[] getNamespaces()
public static boolean isNameLocal(MetamergeConfig mc, Object name) throws Exception
mc
- A MetamergeConfig objectname
- The name of the MetamergeConfig object
Exception
public static Name parseName(Object name) throws InvalidNameException
name
- null, javax.namgin.Name or an object having a toString()
method
InvalidNameException
public static void registerNamespace(Object name, MetamergeConfig mc)
name
- Unique namemc
- MetamergeConfig objectpublic static void unregisterNamespace(Object ns)
ns
- public static boolean garbageCollect()
public static boolean canRemoveNamespace(String namedURL)
public static MetamergeConfig loadNamespace(String url) throws Exception
url
- URL to load/locate
Exception
public static MetamergeConfig loadNamespace(NamespaceConfig nc) throws Exception
nc
- NamespaceConfig to load/locate
Exception
public static MetamergeConfig resolve(MetamergeConfig mc, Name name) throws Exception
mc
- The MetamergeConfig object requesting namename
- The name to resolve
Exception
public static Object lookup(MetamergeConfig mc, Object name) throws Exception
mc
- Calling MetamergeConfigname
- The name to lookup
Exception
public static void copy(BaseConfiguration input, MetamergeConfig dest, Name destName) throws Exception
input
- Object to copydest
- MetamergeConfig object to receive copydestName
- Name of copied object in dest config
Exception
public static void copy(BaseConfiguration input, MetamergeConfig dest, Name destName, boolean overwrite) throws 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
Exception
public static void copyFolder(MetamergeFolder folder, MetamergeConfig dest, Name destName) throws Exception
folder
- The folder to copydest
- The config that receives the copydestName
- The name the copy gets
Exception
public static void copyFolder(MetamergeFolder folder, MetamergeConfig dest, Name destName, boolean overwrite) throws Exception
folder
- The folder to copydest
- The config that receives the copydestName
- The name the copy getsoverwrite
- flag indicating whether to overwrite
Exception
public static void copyObject(BaseConfiguration source, BaseConfiguration dest)
source
- The object to copydest
- The config that receives the copypublic static void logmsg(String msg)
msg
- The message to logpublic static void verifyInheritanceChain(BaseConfiguration config, Object inheritFrom) throws Exception
Exception
public static boolean isStandardObject(Object objname)
public static List<String> addPackages(List<String> packages)
packages
- List of absolute pathspublic static boolean removePackage(MetamergeConfig mc) throws Exception
mc
- The package to remove
Exception
public static String addPackage(String path) throws Exception
path
- The absolute path of the file
Exception
public static List<MetamergeConfig> getPackages() throws Exception
Exception
public static void addNamespaceListener(ActionListener listener)
public static void removeNamespaceListener(ActionListener listener)
public static void namespaceChanged(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 |