if (J2EEUtil.isContained())
{
throw new IllegalStateException("XAFileStorageConnectionFactory is only for J2EE non-contained mode");
}
FileManagedConnectionFactory mcf = new FileManagedConnectionFactory();
mcf.setPersistenceConnection(true);
mcf.setInputConnection(false);
mcf.setOutgoingDirectory(m_fragment.getDataDirectory());
mcf.setOutgoingTempDirectory(m_fragment.getTemporaryDirectory());
mcf.setMaxNameSplits(m_fragment.getMaxNameSplits());
mcf.setNameSplitSize(m_fragment.getNameSplitSize());
File journalPath = new File(m_fragment.getJournalPath());
if (!journalPath.isAbsolute())
{
try
{
journalPath = new File(new GenericConfig().createDataDirectory(),
m_fragment.getJournalPath());
}
catch (IOException e)
{
return null;
}
}
mcf.setJournalDirectory(journalPath.getAbsolutePath());
try
{
m_factory = (FileConnectionFactory)mcf.createConnectionFactory();
return m_factory;
}
catch (ResourceException ex)
{
return null;