public abstract class AsamOdsHandler extends java.util.logging.ConsoleHandler implements ImplementationIF
The session that is used by the handler, is stored as reference in context by the constant
com.highqsoft.xsd.AsamOdsHandler.HANDLER_SESSION_KEY
and can be reused for other purposes.
The object is able to consume the following properties:
Property Keyword | Datatype | Default | Description |
---|---|---|---|
TargetRef | String | none | The name of reference to the target ASAM ODS session. |
ApplElemName | String | none | The name of application element htat should be used for logging. |
Argument Keyword | Datatype | Default | Description |
---|---|---|---|
ERROR.MissingArgument | String | The argument {0} is missing. | The message that is used when an argument is missing. |
ImplementationIF
Modifier and Type | Class and Description |
---|---|
class |
AsamOdsHandler.DefaultFormatter
The default formatter.
|
Modifier and Type | Field and Description |
---|---|
protected ApplicationElement |
aeObj
The application element that should be used for logging.
|
protected T_LONGLONG |
aid |
protected AoSession |
aoSession
The ASAM ODS Session.
|
protected java.util.Properties |
arguments
The arguments of the implementation.
|
protected java.util.Vector<ElemId> |
createdElems
A vector that collects the created instance elements.
|
protected XSDContextIF |
ctx
The context.
|
protected java.lang.Object |
descriptor
The XML object descriptor.
|
static java.lang.String |
HANDLER_SESSION_KEY |
protected java.util.Vector<InstanceElement> |
relIEs
The related instance to that the log instances should be linked.
|
protected java.util.Map<InstanceElement,ApplicationRelation[]> |
relMap
The map that holds the relations to the instance elements.
|
protected boolean |
requestToCloseSession |
Constructor and Description |
---|
AsamOdsHandler()
Create the formatter.
|
Modifier and Type | Method and Description |
---|---|
int |
addElement(ElemId elemId)
Add an element to the created element array.
|
void |
addRelatedInstance(ElemId relIe)
Add a related instance element.
|
void |
close()
Override ConsoleHandler.close to close ASAM ODS session.
|
void |
closeSession()
Close the session.
|
T_LONGLONG |
getAId()
Get the application element id that should be used for logging.
|
ApplicationElement |
getApplicationElement()
Get the application element that should be used for logging.
|
XSDContextIF |
getContext()
Get the context.
|
ElemId[] |
getCreatedElements()
Get all created instances.
|
java.lang.Object |
getDescriptor()
Get the xml tree descriptor.
|
InstanceElement[] |
getRelatedInstances()
Get the instances to that the log entries should be linked to.
|
ApplicationRelation[] |
getRelation(InstanceElement ieObj)
Get the relation of the given element to the log application element.
|
AoSession |
getSession()
Get the ASAM ODS session.
|
void |
init()
Initialize the work.
|
abstract void |
publish(java.util.logging.LogRecord record)
Publish the log record to the stderr print stream.
|
void |
removeElement(ElemId elemId)
Remove an element from the created element array.
|
void |
removeRelatedInstance(ElemId relIe)
Remove a related instance element.
|
void |
setArguments(java.util.Properties args)
Set argument property map.
|
void |
setContext(XSDContextIF ctx)
Set the context.
|
void |
setDescriptor(java.lang.Object descriptor)
Set the xml tree descriptor.
|
flush, isLoggable, setEncoding, setOutputStream
public static final java.lang.String HANDLER_SESSION_KEY
protected XSDContextIF ctx
protected java.util.Properties arguments
protected ApplicationElement aeObj
protected T_LONGLONG aid
protected AoSession aoSession
protected boolean requestToCloseSession
protected java.lang.Object descriptor
protected java.util.Vector<ElemId> createdElems
protected java.util.Vector<InstanceElement> relIEs
protected java.util.Map<InstanceElement,ApplicationRelation[]> relMap
public void setContext(XSDContextIF ctx)
setContext
in interface ImplementationIF
ctx
- the context.public XSDContextIF getContext()
getContext
in interface ImplementationIF
public void setArguments(java.util.Properties args) throws InvalidArgumentException
setArguments
in interface ImplementationIF
args
- the property mapInvalidArgumentException
- if the arguments are not valid.public void setDescriptor(java.lang.Object descriptor) throws InvalidDescriptorException
setDescriptor
in interface ImplementationIF
descriptor
- the tree node.InvalidDescriptorException
- if the descriptor isn't valid.public java.lang.Object getDescriptor()
getDescriptor
in interface ImplementationIF
public void init() throws InitializationFailedException
init
in interface ImplementationIF
InitializationFailedException
- if the initialization fails.public AoSession getSession() throws AoException
AoException
public void closeSession() throws AoException
AoException
public void close()
close
in class java.util.logging.ConsoleHandler
public ApplicationElement getApplicationElement() throws AoException
AoException
public T_LONGLONG getAId() throws AoException
AoException
public abstract void publish(java.util.logging.LogRecord record)
publish
in class java.util.logging.ConsoleHandler
record
- the log record.public ElemId[] getCreatedElements()
public int addElement(ElemId elemId)
elemId
- an ElemId object of the instance element.public void removeElement(ElemId elemId)
index
- the index of the instance element to be removed.public void addRelatedInstance(ElemId relIe) throws AoException
relIe
- the related instance.AoException
public void removeRelatedInstance(ElemId relIe) throws AoException
relIe
- the related instance.AoException
public InstanceElement[] getRelatedInstances()
public ApplicationRelation[] getRelation(InstanceElement ieObj) throws AoException
AoException