Java Code Examples for ims.configuration.gen.ConfigFlag.getConfigFlag()

The following are Jave code examples for showing how to use getConfigFlag() of the ims.configuration.gen.ConfigFlag class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: ConfigFlagsImpl.java   Source Code and License Vote up 4 votes
private void saveFlag(String flagName, String flagValue)
{
	try
	{
		AFlag flag = ConfigFlag.getConfigFlag(flagName);			
		if (flag == null) 
			return;			
		flag.setValue(flagValue);
		
		
		if (flagName.equals(ConfigFlag.GEN.LOGGING_LEVEL.getName()))
		{
			EnvironmentConfig.SetLoggingLevel(ConfigFlag.GEN.LOGGING_LEVEL.getValue());
			Logging.setLoggingLevel(ConfigFlag.GEN.LOGGING_LEVEL.getValue());
		}
		else if (flagName.equals(ConfigFlag.GEN.LOG_FILE.getName()))
		{
			Logging.setMaximsAppenderFile(ConfigFlag.GEN.LOG_FILE.getValue());
		}
		
		/*else if (flagName.equals(ConfigFlag.GEN.SHOW_SQL.getName()))
		{
			setShowSql(ConfigFlag.GEN.SHOW_SQL.getValue());
		}
		else if (flagName.equals(ConfigFlag.GEN.HIBERNATE_STATISTICS_ENABLED.getName()))
		{
			setHibernateStatisticsEnabled(ConfigFlag.GEN.HIBERNATE_STATISTICS_ENABLED.getValue());
		}
		else if (flagName.equals(ConfigFlag.GEN.FORMAT_SQL.getName()))
		{
			this.getDomainFactory().setFormatSql(ConfigFlag.GEN.FORMAT_SQL.getValue());
		}*/			
		/*else if (flagName.equals(ConfigFlag.DOM.MAIN_DATASOURCE_NAME.getName()))
		{
			String dsName = ConfigFlag.DOM.MAIN_DATASOURCE_NAME.getValue();
			this.getDomainFactory().setDatasource(dsName);
			this.reloadConfiguration();
		}	*/		
		/*else if (flagName.equals(ConfigFlag.DOM.CACHE_PROVIDER.getName()))
		{
			Registry.getInstance().setCacheProvider();
			this.reloadConfiguration();
		}*/
		else if (flagName.equals(ConfigFlag.GEN.SESSION_TIMEOUT.getName()))
		{
			SessionManager.setSessionTimeout(ConfigFlag.GEN.SESSION_TIMEOUT.getValue());
		}
		else if (flagName.equals(ConfigFlag.ENABLE_DB_CONNECTION_TRACE.getName()))
		{
			if (this.getDbType().equals(DbType.ORACLE))
			{
				DomainFactory factory = getDomainFactory();		
				Connection conn = factory.getJdbcConnection();
				if (ConfigFlag.ENABLE_DB_CONNECTION_TRACE.getValue())
				{
					//conn.createStatement().execute("ALTER SESSION SET TIMED_STATISTICS = TRUE");
					conn.createStatement().execute("ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL 4'");						
				}
				else
				{
					//conn.createStatement().execute("ALTER SESSION SET TIMED_STATISTICS = FALSE");
					conn.createStatement().execute("ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT OFF'");						
				}
			}
		}
	}
	catch (Exception e)
	{
		throw new DomainRuntimeException(e);
	}
}