public final boolean initialize ( ) { notifyObservers ( ) ; try { this . cfg = ( Properties ) new MainParser ( this ) . parseFile ( getCfgFilename ( ) ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; //Deep trouble error = true ; return false ; } logger = ( JPMLogger ) newInstance ( getCfg ( ) . getProperty ( "logger-class" , "jpaoletti.jpm.core.log.Log4jLogger" ) ) ; logger . setName ( getCfg ( ) . getProperty ( "logger-name" , "jPM" ) ) ; error = false ; try { try { Class . forName ( getDefaultDataAccess ( ) ) ; logItem ( "Default Data Access" , getDefaultDataAccess ( ) , "*" ) ; } catch ( Exception e ) { logItem ( "Default Data Access" , getDefaultDataAccess ( ) , "?" ) ; } logItem ( "Template" , getTemplate ( ) , "*" ) ; logItem ( "Menu" , getMenu ( ) , "*" ) ; logItem ( "Application version" , getAppversion ( ) , "*" ) ; logItem ( "Title" , getTitle ( ) , "*" ) ; logItem ( "Subtitle" , getSubtitle ( ) , "*" ) ; logItem ( "Contact" , getContact ( ) , "*" ) ; logItem ( "Default Converter" , getDefaultConverterClass ( ) , "*" ) ; final String _securityConnector = getCfg ( ) . getProperty ( SECURITY_CONNECTOR ) ; if ( _securityConnector != null ) { try { securityConnector = ( PMSecurityConnector ) newInstance ( _securityConnector ) ; logItem ( "Security Connector" , _securityConnector , "*" ) ; } catch ( Exception e ) { error = true ; logItem ( "Security Connector" , _securityConnector , "?" ) ; } } else { securityConnector = null ; } persistenceManager = cfg . getProperty ( PERSISTENCE_MANAGER , "jpaoletti.jpm.core.PersistenceManagerVoid" ) ; try { newInstance ( persistenceManager ) ; logItem ( "Persistance Manager" , persistenceManager , "*" ) ; } catch ( Exception e ) { error = true ; logItem ( "Persistance Manager" , persistenceManager , "?" ) ; } loadEntities ( ) ; loadMonitors ( ) ; loadConverters ( ) ; loadClassConverters ( ) ; loadLocations ( ) ; createSessionChecker ( ) ; customLoad ( ) ; } catch ( Exception exception ) { error ( exception ) ; error = true ; } if ( error ) { error ( "error: One or more errors were found. Unable to start jPM" ) ; } return ! error ; }
Initialize the Presentation Manager .