Methods Summary |
---|
public static ConfigContext | createConfigContext(java.lang.String fileUrl, org.xml.sax.helpers.DefaultHandler dh)
final ConfigEnvironment ce = getConfigEnvironment(fileUrl, false, false, true, true);
ce.setHandler(dh.getClass().getName());
return ConfigContextFactory.createConfigContext(ce);
|
public static ConfigContext | createConfigContext(java.lang.String fileUrl)Creates a configuration context for the specified URL.
return createConfigContext(fileUrl, false, false);
|
public static ConfigContext | createConfigContext(java.lang.String fileUrl, boolean readOnly)Creates a configuration context for the specified URL and in
the specified mode.
return createConfigContext(fileUrl, readOnly, false);
|
public static ConfigContext | createConfigContext(java.lang.String fileUrl, boolean readOnly, boolean autoCommit)Creates a configuration context for the specified URL and in
the specified mode.
return createConfigContext(fileUrl, readOnly, autoCommit, true);
|
public static ConfigContext | createConfigContext(java.lang.String fileUrl, boolean readOnly, boolean autoCommit, boolean cache)Returns a ConfigContext object that was either previously
created (and stored in the cache) or created anew.
If cache is true then the factory looks
up its cache of previously created ConfigContext objects and if
a matching one is found then that is returned. If the cache lookup
failed, then a new ConfigContext is created and inserted into the
cache.
If cache is false then the cache is
not used and a new ConfigContext object is returned. This
object is not inserted into the cache.
Note that if ConfigContext already exists, readOnly and autoCommit
are not used.
return createConfigContext(fileUrl, readOnly, autoCommit,
cache, true);
|
public static ConfigContext | createConfigContext(java.lang.String fileUrl, boolean readOnly, boolean autoCommit, boolean cache, boolean resolvePath)Returns a ConfigContext object that was either previously
created (and stored in the cache) or created anew.
If cache is true then the factory looks
up its cache of previously created ConfigContext objects and if
a matching one is found then that is returned. If the cache lookup
failed, then a new ConfigContext is created and inserted into the
cache.
If cache is false then the cache is
not used and a new ConfigContext object is returned. This
object is not inserted into the cache.
If resolvePath is true then the
absolute paths of certain attributes in domain.xml are resolved
as in the runtime context.
Note that if ConfigContext already exists, readOnly and autoCommit
are not used.
return ConfigContextFactory.createConfigContext(
getConfigEnvironment(fileUrl, readOnly, autoCommit,
cache, resolvePath));
|
public static ConfigContext | createConfigContext(java.lang.String fileUrl, boolean readOnly, boolean autoCommit, boolean cache, java.lang.Class rootClass)this method adds a validation handler for creating a context
default is com.sun.enterprise.config.serverbeans.ServerValidationHandler
ConfigEnvironment ce = getConfigEnvironment(fileUrl, readOnly,
autoCommit, cache, true);
ce.setRootClass(rootClass.getName());
return ConfigContextFactory.createConfigContext(ce);
|
public static synchronized ConfigContext | createConfigContext(java.lang.String fileUrl, boolean readOnly, boolean autoCommit, boolean cache, java.lang.Class rootClass, org.xml.sax.helpers.DefaultHandler dh)Creates a different class of beans based on rootClass
By default, in the other createConfigContext APIs, rootClass
is com.sun.enterprise.config.Server
This API can be used to create serverbeans, clientbeans, or any other
class of beans
ConfigEnvironment ce = getConfigEnvironment(fileUrl, readOnly,
autoCommit, cache, true);
ce.setRootClass(rootClass.getName());
ce.setHandler(dh.getClass().getName());
return ConfigContextFactory.createConfigContext(ce);
|
public static boolean | enableLastModifiedCheck(ConfigContext ctx, boolean value)This method is used to activate the lastModified checking for a configContext
If activated, configbeans will carry a lastmodified timestamp in every bean.
This time is also carried onto the configChangeList and also to clones. When
configContext.updateFromConfigChangeList is called, the timestamp is first checked
to see if the bean has not changed since the clone and then the update is made.
If a modification to the bean is detected, a staleWriteConfigException is thrown.
return ConfigContextFactory.enableLastModifiedCheck(ctx, value);
|
private static com.sun.enterprise.config.pluggable.ConfigEnvironment | getConfigEnvironment(java.lang.String fileUrl, boolean readOnly, boolean autoCommit, boolean cache, boolean resolvePath)
ConfigEnvironment ce = EnvironmentFactory.getEnvironmentFactory().
getConfigEnvironment();
ce.setUrl(fileUrl);
ce.setReadOnly(readOnly);
ce.setCachingEnabled(cache);
ce.getConfigBeanInterceptor().setResolvingPaths(resolvePath);
return ce;
|
public static synchronized void | removeConfigContext(java.lang.String fileUrl)
ConfigContextFactory.removeConfigContext(fileUrl);
|
public static void | removeConfigContext(ConfigContext ctx)
ConfigContextFactory.removeConfigContext(ctx);
|
public static synchronized void | replaceConfigContext(ConfigContext oldCtx, ConfigContext newCtx)Replaces a cached context with a new context
So, next time the Url is accessed, it returns the new context
Note the subtlity of this method: This method gets the url of
the old context and replaces the value for that key with the new object
Hence, even though there might be a configContext with the same url
but a different object, it is still replaced. This behavior is desirable
since we would like to have the newCtx set anyway.
However, if the url was not present, then ConfigException is thrown
with that message. Note that: this class is not i18n complaint.
If the old context cannot be found in cache, then throw ConfigException
This method is synchronized so to make it thread safe.
ConfigContextFactory.replaceConfigContext(oldCtx, newCtx);
|