org.naftulin.configmgr.content
Class MasterRecordImpl

java.lang.Object
  extended by org.naftulin.configmgr.content.AbstractRecordImpl
      extended by org.naftulin.configmgr.content.MasterRecordImpl

public class MasterRecordImpl
extends AbstractRecordImpl

Parses config.xml file: properties file, log4j xml or log4j properties. Once a master record is created, parsers are called for each of the entries to be parsed and stored in config manager. Entry is similar to config manager entry, yet there is no content (since the entry was not parsed yet).

Since:
1.0
Author:
Henry Naftulin

Constructor Summary
MasterRecordImpl()
          Constructs a record without specifying the key or file name.
MasterRecordImpl(java.lang.String key, java.lang.String fileName)
          Constructs a record with the key and file name specified.
 
Method Summary
 void addRecord(AbstractRecordImpl record)
          Adds a record to the list of records to be processed.
 ConfigEntryParser getParser()
          Returns master record parser.
 java.util.List<AbstractRecordImpl> getRecords()
          Returns the unmodifiable list of records from the cofiguration file.
 boolean isJmx()
          Returns Jmx setting for configuration manager.
 void setJmx(boolean jmx)
          Sets Jmx setting for configuration manager.
 java.lang.String toString()
          Returns the string representation of the master record.
 
Methods inherited from class org.naftulin.configmgr.content.AbstractRecordImpl
getFileName, getKey, isGetUrlForFile, setFileName, setKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MasterRecordImpl

public MasterRecordImpl()
Constructs a record without specifying the key or file name.


MasterRecordImpl

public MasterRecordImpl(java.lang.String key,
                        java.lang.String fileName)
Constructs a record with the key and file name specified.

Parameters:
key - the key associated with the record.
fileName - the file name associated with the record.
Method Detail

isJmx

public boolean isJmx()
Returns Jmx setting for configuration manager. By defaul the jmx setting is true, which means that configuration manager will try to connect to JMX MBean server.

Returns:
returns Jmx setting for configuration manager.

setJmx

public void setJmx(boolean jmx)
Sets Jmx setting for configuration manager. When Jmx setting equals true, configuration manager will try to connect to JMX MBean server.

Parameters:
jmx - jmx setting

addRecord

public void addRecord(AbstractRecordImpl record)
Adds a record to the list of records to be processed. Mirrors the master file which consists of configuration records.

Parameters:
record - the record to be processed, read from the master configuration file

getRecords

public java.util.List<AbstractRecordImpl> getRecords()
Returns the unmodifiable list of records from the cofiguration file.

Returns:
a list of records from the cofiguration file.

getParser

public ConfigEntryParser getParser()
Returns master record parser. The master record is processed by configuration manager with a special parser; and is not re-parsed when transofrmed to configuration manager entry.

Specified by:
getParser in class AbstractRecordImpl
Returns:
Returns master record parser.

toString

public java.lang.String toString()
Returns the string representation of the master record.

Overrides:
toString in class AbstractRecordImpl
Returns:
the string representation of the master record.


Copyright © 2009. All Rights Reserved.