⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfctest$tidmanager.java

📁 SAP这个系统的一个转换器
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   RfcTest.java

package com.sap.mw.jco.support;

import java.io.*;
import java.util.Arrays;

// Referenced classes of package com.sap.mw.jco.support:
//            RfcTest

static class RfcTest$TidManager
{

    void update_TID(String tid, String tid_state)
    {
        int idx = 0;
        byte line[] = new byte[60];
        RandomAccessFile ras = null;
        try
        {
            boolean eof = false;
            boolean found = false;
            ras = new RandomAccessFile(file, "rw");
            long file_offset = ras.getFilePointer();
            while(!eof) 
            {
                Arrays.fill(line, (byte)32);
                idx = 0;
                try
                {
                    file_offset = ras.getFilePointer();
                    byte byte0;
                    while((byte0 = ras.readByte()) != 10) 
                        if(idx < line.length)
                            line[idx++] = byte0;
                }
                catch(EOFException ex)
                {
                    eof = true;
                }
                file entry = rse(line);
                if(entry != null && entry.D.equals(tid))
                {
                    found = true;
                    entry.ate = tid_state;
                    ras.seek(file_offset);
                    ras.write((new RfcTest$TidEntry(tid, tid_state)).tBytes());
                }
            }
            if(!found)
                ras.write((new RfcTest$TidEntry(tid, tid_state)).tBytes());
        }
        catch(IOException ex)
        {
            System.out.println("Error during file operation: " + ex.toString());
        }
        finally
        {
            try
            {
                if(ras != null)
                    ras.close();
            }
            catch(IOException ex)
            {
                System.out.println("Error during file closing: " + ex.toString());
            }
        }
    }

    private String fileName;
    private File file;
    public static final String CHECKED = "CHECKED";
    public static final String CONFIRMED = "CONFIRMED";
    public static final String COMMITED = "COMMITED";
    public static final String ROLLBACKED = "ROLLBACKED";
    public static final String CREATED = "CREATED";

    RfcTest$TidManager(String fileName)
    {
        this.fileName = null;
        this.fileName = fileName;
        file = new File(fileName);
        RandomAccessFile ras = null;
        try
        {
            if(!file.exists())
                try
                {
                    ras = new RandomAccessFile(file, "rw");
                    ras.write("***   TID-MANAGEMENT FOR TRANSACTIONAL RFC (Server Program)   ***\n".getBytes("UTF8"));
                }
                catch(IOException ex)
                {
                    System.out.println("Error during file operation: " + ex.toString());
                }
        }
        finally
        {
            try
            {
                if(ras != null)
                    ras.close();
            }
            catch(IOException ex)
            {
                System.out.println("Error during file operation: " + ex.toString());
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -