Examples of SequentialFile


Examples of com.ibm.as400.access.SequentialFile

      // Write file ONLY if file exist because the format of the file is
      // needed!
      if (new IFSFile(mAS400System, mQSYSobjPathname.getPath()).exists())
      {
        // initiate the SequentialFile object
        mOriginFile = new SequentialFile(mAS400System, mQSYSobjPathname
            .getPath());

        // Retreive and set an record format of the file.
        AS400FileRecordDescription recordDescription = new AS400FileRecordDescription(
            mAS400System, mQSYSobjPathname.getPath());
View Full Code Here

Examples of com.ibm.as400.access.SequentialFile

  protected void setLock(AS400 as400System, String lockFilename)
      throws XException
  {
    try
    {
      SequentialFile seqFile = new SequentialFile(as400System,
          lockFilename);
      seqFile.lock(SequentialFile.WRITE_EXCLUSIVE_LOCK);
    } // try
    catch (Exception ex)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
View Full Code Here

Examples of com.ibm.as400.access.SequentialFile

   * @exception XException if the file lock can not be released
   */
  protected void releaseLock(AS400 as400System, String lockFilename)
      throws XException
  {
    SequentialFile lockFile = new SequentialFile(as400System, lockFilename);
    if (lockFile.getExplicitLocks().length > 0)
    { // There are locks.
      try
      {
        lockFile.releaseExplicitLocks();
      } // try
      catch (Exception ex)
      {
        List params = new Vector();
        params.add(lockFilename);
View Full Code Here

Examples of com.ibm.as400.access.SequentialFile

   * @throws XException if the file cannot be deleted for any reason
   */
  protected void deleteFile(AS400 mAS400System, String fileName)
      throws XException
  {
    SequentialFile file = new SequentialFile(mAS400System, fileName);
    try
    {
      file.delete();
    } // try
    catch (Exception ex)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
View Full Code Here

Examples of com.ibm.as400.access.SequentialFile

   * @throws XException if the member cannot be deleted for any reason
   */
  protected void deleteMember(AS400 as400System, String fileName)
      throws XException
  {
    SequentialFile srcFile = new SequentialFile(as400System, fileName);
    try
    {
      srcFile.deleteMember();
    } // try
    catch (Exception ex)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
View Full Code Here

Examples of com.ibm.as400.access.SequentialFile

      {
        Trace.info("Receiving data from "
            + xbusSystem.replaceAllMarkers(mConfigFilename)[0]);

        // initiate the SequentialFile object
        mOriginFile = new SequentialFile(mAS400System, mQSYSObject
            .getPath());

        // lock original file with the WRITE_EXCLUSIVE_LOCK lock type
        mOriginFile.lock(SequentialFile.WRITE_EXCLUSIVE_LOCK);
View Full Code Here

Examples of org.hornetq.core.journal.SequentialFile

      List<JournalFile> orderedFiles = new ArrayList<JournalFile>(fileNames.size());

      for (String fileName : fileNames)
      {
         SequentialFile file = fileFactory.createSequentialFile(fileName, filesRepository.getMaxAIO());

         file.open(1, false);

         try
         {

            JournalFileImpl jrnFile = readFileHeader(file);

            orderedFiles.add(jrnFile);
         }
         finally
         {
            file.close();
         }
      }

      // Now order them by ordering id - we can't use the file name for ordering
      // since we can re-use dataFiles
View Full Code Here

Examples of org.hornetq.core.journal.SequentialFile

         List<JournalFile> newDatafiles = null;

         JournalCompactor localCompactor = compactor;

         SequentialFile controlFile = createControlFile(dataFilesToProcess, compactor.getNewDataFiles(), null);

         compactingLock.writeLock().lock();
         try
         {
            // Need to clear the compactor here, or the replay commands will send commands back (infinite loop)
View Full Code Here

Examples of org.hornetq.core.journal.SequentialFile

   {
      ArrayList<String> dataFiles = new ArrayList<String>();
      ArrayList<String> newFiles = new ArrayList<String>();
      ArrayList<Pair<String, String>> renames = new ArrayList<Pair<String, String>>();

      SequentialFile controlFile = JournalCompactor.readControlFile(fileFactory, dataFiles, newFiles, renames);
      if (controlFile != null)
      {
         for (String dataFile : dataFiles)
         {
            SequentialFile file = fileFactory.createSequentialFile(dataFile, 1);
            if (file.exists())
            {
               file.delete();
            }
         }

         for (String newFile : newFiles)
         {
            SequentialFile file = fileFactory.createSequentialFile(newFile, 1);
            if (file.exists())
            {
               final String originalName = file.getFileName();
               final String newName = originalName.substring(0, originalName.lastIndexOf(".cmp"));
               file.renameTo(newName);
            }
         }

         for (Pair<String, String> rename : renames)
         {
            SequentialFile fileTmp = fileFactory.createSequentialFile(rename.a, 1);
            SequentialFile fileTo = fileFactory.createSequentialFile(rename.b, 1);
            // We should do the rename only if the tmp file still exist, or else we could
            // delete a valid file depending on where the crash occured during the control file delete
            if (fileTmp.exists())
            {
               fileTo.delete();
               fileTmp.renameTo(rename.b);
            }
         }

         controlFile.delete();
View Full Code Here

Examples of org.hornetq.core.journal.SequentialFile

         JournalImpl.log.warn("Temporary files were left unnatended after a crash on journal directory, deleting invalid files now");

         for (String fileToDelete : leftFiles)
         {
            JournalImpl.log.warn("Deleting unnatended file " + fileToDelete);
            SequentialFile file = fileFactory.createSequentialFile(fileToDelete, 1);
            file.delete();
         }
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.