public class DefaultXSDContext extends java.util.Properties implements XSDContextIF
| Property Keyword | Datatype | Default | Description |
|---|---|---|---|
| ARGV.length | int | 0 | Total number of command line arguments. The size of the ARGV[] property array. |
| ARGV[index] | String | null | Command line argument.
The word index should be replaced by the index of the argument array.
The index starts at 0.
The property ARGV.length gives the length of the array. If a range of parameters should be concatenated, the pattern ARGV[from:to:sep] can be used. For an empty separator the expression ARGV[from:to] is also valid. If the element until the end of array should be used a star is allowed at second position ${ARGV[2:*:,]}. |
| basedir | directory | null | The directory of the rules file. |
| ASAMODSDateString | String | null | The ASAM ODS date string of the startup time. |
| localhost | hostname | the name of the local host | The name of the local host. |
| ipaddress | ip address | the ip address of the local host. | The ip address of the local host. |
| Context.StatusCode | String | Status.OK.value() | The status code value. |
| Context.StatusValue | String | Status.OK.name() | The status code string value. |
| Context.Time | String | System.currentTimeMillis | The current time in milli seconds. The value can be requested by passing a simple data format also, similar to the file modification date. Example: ${Context.Time,yyyy.MM.dd} |
| Context.StatusMessage | String | The status message string. | |
| all java system properties | String | All JVM properties, also those comming from commandline. |
XSDContextIF,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected java.util.Properties |
arguments |
protected AsamOdsFactoryIF |
asamOdsFactory |
protected java.util.Properties |
buildIn |
protected java.util.Map<java.lang.String,java.lang.String> |
bundleCache |
protected java.lang.ClassLoader |
classLoader |
static java.lang.String |
CLOSE_TOKEN |
protected java.util.Properties |
defaults |
protected java.lang.Object |
descriptor |
protected java.util.Map<java.lang.String,java.lang.String> |
environment |
protected java.lang.String |
envPrefix |
protected java.lang.String |
gathermode |
protected ImplementationFactoryIF |
implFactory |
protected boolean |
isInitialized |
protected java.util.logging.Logger |
logger |
protected LoggerFactoryIF |
loggerFactory |
protected MailFactoryIF |
mailFactory |
protected javax.mail.Message |
message |
protected java.util.logging.Logger |
messenger |
static java.lang.String |
NULLTEST
The null test property key.
|
static java.lang.String |
OPEN_TOKEN |
protected PropertyFactoryIF |
propertyFactory |
protected java.util.Map<java.lang.String,java.lang.Object> |
references |
protected java.lang.String |
runtimeMessage |
protected Status |
runtimeStatus |
protected java.util.Map<AoSession,java.lang.String> |
sessionRefs |
protected java.util.Map<java.lang.String,AoSession> |
sessions |
protected long |
startupTime |
protected java.util.logging.Logger |
tracer |
| Constructor and Description |
|---|
DefaultXSDContext(java.util.Properties buildIn,
PropertyFactoryIF propertyFactory,
ImplementationFactoryIF factory) |
DefaultXSDContext(PropertyFactoryIF propertyFactory,
ImplementationFactoryIF implFactory)
The default constructor.
|
DefaultXSDContext(java.lang.String[] args,
java.util.Properties buildIn,
PropertyFactoryIF propertyFactory,
ImplementationFactoryIF factory)
The constructor.
|
DefaultXSDContext(java.lang.String[] args,
java.lang.String version,
PropertyFactoryIF propertyFactory,
ImplementationFactoryIF factory)
The context constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
XSDContextIF |
clone()
Clone the context.
|
javax.mail.Message |
createMailMessage(java.lang.String subject,
java.lang.String msg)
Create a mail message
|
void |
destroy()
Destroy the context.
|
AsamOdsFactoryIF |
getAsamOdsFactory()
Retrieve the Asam Ods factory.
|
java.lang.ClassLoader |
getClassLoader()
Get the class loader that should be used for class loading.
|
java.lang.Object |
getDescriptor()
Get the xml tree descriptor.
|
protected java.lang.String |
getHostSpec(boolean ip)
Get the host specification used for the log table entry.
|
ImplementationFactoryIF |
getImplementationFactory()
Retrieve the implementation factory.
|
java.util.logging.Logger |
getLogger()
Get the logger for the context oprations.
|
java.util.logging.Logger |
getLogger(java.lang.String name)
Get a logger from the context named like the given parameter
and parented by the internal logger.
|
LoggerFactoryIF |
getLoggerFactory()
Retrieve the logger factory.
|
MailFactoryIF |
getMailFactory()
Retrieve the mail factory.
|
java.util.logging.Logger |
getMessenger()
Get the messenger for the context oprations.
|
java.util.logging.Logger |
getMessenger(java.lang.String name)
Get a messenger from the context named like the given parameter
and parented by the internal messenger.
|
java.lang.String |
getProperty(java.lang.String key)
Get a property as it is defined from context.
|
java.lang.String |
getProperty(java.lang.String key,
java.util.Properties alt)
Get a property.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String def)
Get a property.
|
java.lang.String |
getPropertyDefinition(java.lang.String key)
Get a property as it is defined from context.
|
java.lang.String |
getPropertyDefinition(java.lang.String key,
java.util.Properties alt)
Get a property as it is defined.
|
java.lang.String |
getPropertyDefinition(java.lang.String key,
java.lang.String def)
Get a property as it is defined.
|
PropertyFactoryIF |
getPropertyFactory()
Retrieve the property factory.
|
long |
getStartupTime()
Get the time of the startup.
|
Status |
getStatus()
Get the runtime status.
|
java.lang.String |
getStatusMessage()
Get the status message
|
java.util.logging.Logger |
getTracer()
Get the tracer for the context oprations.
|
java.util.logging.Logger |
getTracer(java.lang.String name)
Get a tracer from the context named like the given parameter
and parented by the internal tracer.
|
void |
initializeLoggers()
Initialize the logger.
|
boolean |
isInitialized()
Get a boolean to decides that the context is initialized.
|
boolean |
isNotStatus(java.lang.String status)
Compare the runtime status and check against the reverse condition.
|
boolean |
isNullTest()
Indicates that the current run is null.
|
boolean |
isPedantic()
Return a boolean whether the gathermode is pedantic.
|
boolean |
isStatus(Status status)
Inquire the runtime status.
|
boolean |
isStatus(java.lang.String status)
Compare the runtime status.
|
java.lang.String[] |
listReferenceKeys()
Retrieve a keyset of the references.
|
static void |
main(java.lang.String[] args) |
void |
nullTest(boolean flag)
Switch the null test.
|
static void |
out(java.lang.String message) |
void |
putAll(java.util.Properties properties)
Put all the given properties to the internal list of properties.
|
void |
putAll(java.util.ResourceBundle bundle)
Put all the given bundle properties to the internal list of properties.
|
void |
putAll(java.lang.String bundleName)
Put all the given bundle properties to the internal list of properties.
|
void |
putAllAsDefaults(java.util.Properties properties)
Put all the given properties to the internal list of default properties.
|
void |
putAllAsDefaults(java.util.ResourceBundle bundle)
Put all the given bundle properties to the internal list of default properties.
|
void |
putAllAsDefaults(java.lang.String bundleName)
Put all the given bundle properties to the internal list of default properties.
|
java.lang.String |
removeDecorator(java.lang.String value)
Remove the property decorators from a string value.
|
java.lang.String |
removeDecorator(java.lang.String val,
java.util.Map<java.lang.String,java.lang.String> alt)
Remove the property decorators from a string value.
|
java.lang.String |
removeDecorator(java.lang.String val,
java.util.Properties alt)
Replace property keywords in string value.
|
void |
removeReference(java.lang.String key)
Remove a reference object.
|
void |
resetStartupTime()
Reset the runtime startup time.
|
java.lang.Object |
restoreReference(java.lang.String key)
Restore a reference object.
|
void |
saveReference(java.lang.String key,
AoSession session)
Save a session reference object.
|
void |
saveReference(java.lang.String key,
java.lang.Object obj)
Save a reference object.
|
void |
sendMail(javax.mail.Message message)
Send a mail message
|
void |
setAsamOdsFactory(AsamOdsFactoryIF factory)
Set the Asam Ods factory.
|
void |
setBaseDir(java.lang.String basedir)
Set the build in variable
basedir. |
void |
setClassLoader(java.lang.ClassLoader cl)
Set the class loader that should be used for class loading.
|
void |
setDescriptor(java.lang.Object descriptor)
Set the xml tree descriptor.
|
void |
setEnvironment(Environment env)
Read the environment prefix from an xml tree node.
|
void |
setEnvironmentPrefix(java.lang.String prefix)
Set the environment prefix.
|
void |
setGathermode(java.lang.String mode)
The the gathermode.
|
void |
setImplementationFactory(ImplementationFactoryIF factory)
Set the implementation factory.
|
void |
setInitialized(boolean flag)
Indicate that the context is initialized.
|
void |
setJobFilename(java.lang.String jobFilename)
Set the build in variable
job.filename. |
void |
setLogger(java.util.logging.Logger logger)
Set the logger for the context oprations.
|
void |
setLoggerFactory(LoggerFactoryIF factory)
Set the logger factory.
|
void |
setLogLevel(java.lang.String logLevel,
java.lang.String traceLevel,
java.lang.String messageLevel)
Set the level of the loggers.
|
void |
setMailFactory(MailFactoryIF factory)
Set the mail factory.
|
void |
setMessage(javax.mail.Message message)
Set a predefined message.
|
void |
setMessenger(java.util.logging.Logger messenger)
Set the messenger for the context oprations.
|
void |
setOutputStream(java.io.OutputStream out,
java.io.OutputStream err)
Set the output streams for standard out and error.
|
void |
setProperties(Properties props)
Read the properties from an xml tree node.
|
void |
setProperty(Property prop)
Read the properties from an xml tree node.
|
void |
setPropertyFactory(PropertyFactoryIF factory)
Set the property factory.
|
void |
setStatus(Status status)
Set the runtime status.
|
void |
setStatus(Status status,
java.lang.String message)
Set the runtime status.
|
void |
setTracer(java.util.logging.Logger tracer)
Set the tracer for the context oprations.
|
void |
tearDown()
Tear down the context.
|
java.lang.String |
toString()
Implement the toString method.
|
list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNamescontains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, valuesfinalize, getClass, notify, notifyAll, wait, wait, waitsetPropertypublic static final java.lang.String NULLTEST
protected ImplementationFactoryIF implFactory
protected AsamOdsFactoryIF asamOdsFactory
protected LoggerFactoryIF loggerFactory
protected MailFactoryIF mailFactory
protected PropertyFactoryIF propertyFactory
protected java.util.Map<java.lang.String,java.lang.String> environment
protected java.util.Map<java.lang.String,java.lang.Object> references
protected java.util.Map<java.lang.String,java.lang.String> bundleCache
protected java.util.Map<java.lang.String,AoSession> sessions
protected java.util.Map<AoSession,java.lang.String> sessionRefs
protected java.lang.String envPrefix
protected java.util.Properties buildIn
protected java.util.Properties arguments
protected java.util.Properties defaults
protected java.util.logging.Logger logger
protected java.util.logging.Logger messenger
protected java.util.logging.Logger tracer
protected Status runtimeStatus
protected java.lang.String runtimeMessage
protected long startupTime
protected java.lang.String gathermode
protected java.lang.Object descriptor
protected javax.mail.Message message
protected boolean isInitialized
protected java.lang.ClassLoader classLoader
public static final java.lang.String OPEN_TOKEN
public static final java.lang.String CLOSE_TOKEN
public DefaultXSDContext(PropertyFactoryIF propertyFactory, ImplementationFactoryIF implFactory)
propertyFactroy - the property factory.factory - the implementation factory.public DefaultXSDContext(java.lang.String[] args,
java.lang.String version,
PropertyFactoryIF propertyFactory,
ImplementationFactoryIF factory)
args - The command line arguments.version - the version string.propertyFactory - the property factory.factory - the implementation factory.public DefaultXSDContext(java.lang.String[] args,
java.util.Properties buildIn,
PropertyFactoryIF propertyFactory,
ImplementationFactoryIF factory)
args - The command line arguments.buildIn - the buildin properties.propertyFactory - the property factory.factory - the implementation factory.public DefaultXSDContext(java.util.Properties buildIn,
PropertyFactoryIF propertyFactory,
ImplementationFactoryIF factory)
buildIn - the buildin properties.propertyFactory - the property factory.factory - the implementation factory.public XSDContextIF clone()
clone in interface XSDContextIFclone in class java.util.Hashtable<java.lang.Object,java.lang.Object>public void clear()
clear in interface java.util.Map<java.lang.Object,java.lang.Object>clear in class java.util.Hashtable<java.lang.Object,java.lang.Object>public void initializeLoggers()
public void setDescriptor(java.lang.Object descriptor)
throws InvalidDescriptorException
setDescriptor in interface XSDContextIFdescriptor - the tree node.InvalidDescriptorExceptionpublic void setBaseDir(java.lang.String basedir)
throws java.io.IOException
basedir.setBaseDir in interface XSDContextIFbasedir - the new value.java.io.IOException - when the directory doesn't exist.public void setJobFilename(java.lang.String jobFilename)
throws java.io.IOException
job.filename.jobFilename - the new value.java.io.IOException - when the directory doesn't exist.public java.lang.Object getDescriptor()
getDescriptor in interface XSDContextIFpublic void setEnvironmentPrefix(java.lang.String prefix)
setEnvironmentPrefix in interface XSDContextIFprefix - the prefix used for environment variables.
If the last character of the prefix is not element of \p{Punct}
the method will append a dot '.'.public void setProperties(Properties props) throws java.io.FileNotFoundException, ExecutableException, java.io.IOException
setProperties in interface XSDContextIFprops - the property node.java.io.FileNotFoundExceptionExecutableExceptionjava.io.IOExceptionpublic void setProperty(Property prop) throws java.io.FileNotFoundException, ExecutableException, java.io.IOException
setProperty in interface XSDContextIFprop - the property node.java.io.FileNotFoundExceptionExecutableExceptionjava.io.IOExceptionpublic void putAll(java.util.Properties properties)
putAll in interface XSDContextIFproperties - the properties to be added.public void putAll(java.util.ResourceBundle bundle)
putAll in interface XSDContextIFbundle - the resource bunlde from that the properties should be read.public void putAll(java.lang.String bundleName)
putAll in interface XSDContextIFbundle - the propery bundle namepublic void setEnvironment(Environment env)
setEnvironment in interface XSDContextIFenv - the environment tree node of an XML structure.public java.lang.String getPropertyDefinition(java.lang.String key)
getPropertyDefinition in interface XSDContextIFkey - the property keypublic java.lang.String getPropertyDefinition(java.lang.String key,
java.util.Properties alt)
getPropertyDefinition in interface XSDContextIFkey - the property key.alt - an alternative properties object.public java.lang.String getPropertyDefinition(java.lang.String key,
java.lang.String def)
getPropertyDefinition in interface XSDContextIFkey - the property keydef - the default value, if the key was not declaired.public java.lang.String getProperty(java.lang.String key)
getProperty in interface XSDContextIFgetProperty in class java.util.Propertieskey - the property keypublic java.lang.String getProperty(java.lang.String key,
java.util.Properties alt)
getProperty in interface XSDContextIFkey - the property key.alt - an alternative properties object.public java.lang.String getProperty(java.lang.String key,
java.lang.String def)
getProperty in interface XSDContextIFgetProperty in class java.util.Propertieskey - the property keydef - the default value, if the key was not declaired.public java.lang.String removeDecorator(java.lang.String value)
removeDecorator in interface XSDContextIFvalue - The string value.public java.lang.String removeDecorator(java.lang.String val,
java.util.Properties alt)
removeDecorator in interface XSDContextIFval - The string value.alt - an alternative properties object.public java.lang.String removeDecorator(java.lang.String val,
java.util.Map<java.lang.String,java.lang.String> alt)
removeDecorator in interface XSDContextIFvalue - The string value.alt - an alternative map of properties.public void setLogger(java.util.logging.Logger logger)
setLogger in interface XSDContextIFlogger - the loggerpublic void setTracer(java.util.logging.Logger tracer)
setTracer in interface XSDContextIFtracer - the tracerpublic void setMessenger(java.util.logging.Logger messenger)
setMessenger in interface XSDContextIFmessenger - the messengerpublic java.util.logging.Logger getLogger()
getLogger in interface XSDContextIFpublic java.util.logging.Logger getTracer()
getTracer in interface XSDContextIFpublic void setGathermode(java.lang.String mode)
setGathermode in interface XSDContextIFmode - the mode string.public java.util.logging.Logger getMessenger()
getMessenger in interface XSDContextIFpublic java.util.logging.Logger getLogger(java.lang.String name)
getLogger in interface XSDContextIFname - the name of the logger.public java.util.logging.Logger getMessenger(java.lang.String name)
getMessenger in interface XSDContextIFname - the name of the messenger.public java.util.logging.Logger getTracer(java.lang.String name)
getTracer in interface XSDContextIFname - the name of the tracer.public void setStatus(Status status)
setStatus in interface XSDContextIFstatus - the new status.public void setStatus(Status status, java.lang.String message)
setStatus in interface XSDContextIFstatus - the new status.message - the status message.public java.lang.String getStatusMessage()
getStatusMessage in interface XSDContextIFpublic Status getStatus()
getStatus in interface XSDContextIFpublic boolean isStatus(Status status)
isStatus in interface XSDContextIFstatus - the status to against.public boolean isStatus(java.lang.String status)
isStatus in interface XSDContextIFstatus - the status string to check against.public boolean isNotStatus(java.lang.String status)
isNotStatus in interface XSDContextIFstatus - the status string to check against.public boolean isPedantic()
isPedantic in interface XSDContextIFpublic long getStartupTime()
getStartupTime in interface XSDContextIFpublic void resetStartupTime()
resetStartupTime in interface XSDContextIFpublic void setLogLevel(java.lang.String logLevel,
java.lang.String traceLevel,
java.lang.String messageLevel)
throws java.text.ParseException
setLogLevel in interface XSDContextIFlogLevel - The level string of the loggertraceLevel - The level string of the tracermessageLevel - The level string of the messengerjava.text.ParseExceptionpublic void setOutputStream(java.io.OutputStream out,
java.io.OutputStream err)
setOutputStream in interface XSDContextIFout - the output stream for standard out.err - the output stream for standard error.public void tearDown()
tearDown in interface XSDContextIFpublic void destroy()
destroy in interface XSDContextIFpublic void saveReference(java.lang.String key,
java.lang.Object obj)
saveReference in interface XSDContextIFkey - the reference keyword.obj - the reference object.public void saveReference(java.lang.String key,
AoSession session)
saveReference in interface XSDContextIFkey - the reference keyword.session - the reference to session.public java.lang.Object restoreReference(java.lang.String key)
restoreReference in interface XSDContextIFkey - the reference keyword.public void removeReference(java.lang.String key)
removeReference in interface XSDContextIFkey - the reference keyword.public java.lang.String[] listReferenceKeys()
listReferenceKeys in interface XSDContextIFprotected java.lang.String getHostSpec(boolean ip)
ip - true if the ip string should be returned.public javax.mail.Message createMailMessage(java.lang.String subject,
java.lang.String msg)
throws javax.mail.MessagingException
createMailMessage in interface XSDContextIFjavax.mail.MessagingExceptionpublic void setMessage(javax.mail.Message message)
setMessage in interface XSDContextIFpublic void sendMail(javax.mail.Message message)
throws javax.mail.SendFailedException,
javax.mail.MessagingException
sendMail in interface XSDContextIFmessage - the message to be sent.javax.mail.SendFailedExceptionjavax.mail.MessagingExceptionpublic void setImplementationFactory(ImplementationFactoryIF factory)
setImplementationFactory in interface XSDContextIFfactory - the implementation factory.public ImplementationFactoryIF getImplementationFactory()
getImplementationFactory in interface XSDContextIFpublic void setAsamOdsFactory(AsamOdsFactoryIF factory)
setAsamOdsFactory in interface XSDContextIFfactory - the Asam Ods factory.public AsamOdsFactoryIF getAsamOdsFactory()
getAsamOdsFactory in interface XSDContextIFpublic void setLoggerFactory(LoggerFactoryIF factory)
setLoggerFactory in interface XSDContextIFfactory - the logger factory.public LoggerFactoryIF getLoggerFactory()
getLoggerFactory in interface XSDContextIFpublic void setMailFactory(MailFactoryIF factory)
setMailFactory in interface XSDContextIFfactory - the mail factory.public MailFactoryIF getMailFactory()
getMailFactory in interface XSDContextIFpublic void setPropertyFactory(PropertyFactoryIF factory)
setPropertyFactory in interface XSDContextIFfactory - the property factory.public PropertyFactoryIF getPropertyFactory()
getPropertyFactory in interface XSDContextIFpublic boolean isInitialized()
isInitialized in interface XSDContextIFXSDContextIF.setInitialized(boolean)public void setInitialized(boolean flag)
setInitialized in interface XSDContextIFflag - true to indicate that the context is initialized.isInitialized()public void putAllAsDefaults(java.util.Properties properties)
putAllAsDefaults in interface XSDContextIFproperties - public void putAllAsDefaults(java.util.ResourceBundle bundle)
putAllAsDefaults in interface XSDContextIFbundle - the propery bundlepublic void putAllAsDefaults(java.lang.String bundleName)
putAllAsDefaults in interface XSDContextIFbundleName - the propery bundle namepublic boolean isNullTest()
isNullTest in interface XSDContextIFpublic void nullTest(boolean flag)
nullTest in interface XSDContextIFflag - if true null test is turned on.public void setClassLoader(java.lang.ClassLoader cl)
setClassLoader in interface XSDContextIFcl - the class loader that should be used for loadingpublic java.lang.ClassLoader getClassLoader()
getClassLoader in interface XSDContextIFpublic java.lang.String toString()
toString in class java.util.Hashtable<java.lang.Object,java.lang.Object>public static void out(java.lang.String message)
public static void main(java.lang.String[] args)