{
table_file.createNewFile ();
}
catch (IOException ex)
{
throw new ConfigurationException("Failed to create table file", ex);
}
}
else
{
if (table_file.isDirectory ())
{
throw new ConfigurationException("The table file is a directory! Please check " + table_file.getAbsolutePath());
}
if (! table_file.canRead())
{
throw new ConfigurationException("The table file is not readable! Please check " + table_file.getAbsolutePath());
}
if (! table_file.canWrite())
{
throw new ConfigurationException("The table file is not writable! Please check " + table_file.getAbsolutePath());
}
}
try
{
if (_new_table)
{
this.server_table = new ServerTable();
save_server_table(table_file);
}
else
{
try
{
ObjectInputStream _in =
new ObjectInputStream(new FileInputStream(table_file));
server_table = (ServerTable)_in.readObject();
_in.close();
}
catch (Exception ex)
{
logger.warn("Failed to read ServerTable -- creating an empty one");
server_table = new ServerTable();
save_server_table(table_file);
}
}
}
catch (FileOpFailed ex)
{
this.logger.error("Failed to read ServerTable", ex);
}
//should be set. if not, throw
this.iorFile = configuration.getAttribute("jacorb.imr.ior_file");
String _backup_file_str =
configuration.getAttribute("jacorb.imr.backup_file", "");
//set up server table backup file
if (_backup_file_str.length() == 0)
{
this.logger.warn("No backup file specified!. No backup file will be created");
}
if (_backup_file_str.length() > 0)
{
table_file_backup = new File(_backup_file_str);
// try to open backup file
if ( ! table_file_backup.exists ())
{
_new_table = true;
if (this.logger.isInfoEnabled())
{
this.logger.info("Backup file " + _backup_file_str +
" does not exist - autocreating it.");
}
try
{
table_file_backup.createNewFile();
}
catch (IOException ex)
{
throw new ConfigurationException("Failed to create backup file",
ex);
}
}
else
{
if (table_file_backup.isDirectory ())
{
throw new ConfigurationException("The backup file is a directory! Please check " + table_file_backup.getAbsolutePath());
}
if (! table_file_backup.canRead())
{
throw new ConfigurationException("The backup file is not readable! Please check " + table_file_backup.getAbsolutePath());
}
if (! table_file_backup.canWrite())
{
throw new ConfigurationException("The backup file is not writable! Please check " + table_file_backup.getAbsolutePath());
}
}
}
this.object_activation_retries =