serverthreadmap.java

来自「SAP这个系统的一个转换器」· Java 代码 · 共 54 行

JAVA
54
字号
// 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:   ServerThreadMap.java

package com.sap.mw.jco.util;

import com.sap.mw.jco.JCO;
import java.util.Hashtable;

public class ServerThreadMap
{

    public ServerThreadMap()
    {
    }

    public static void addServerThread(com.sap.mw.jco.JCO.Server server)
    {
        if(serverThreads.get(Thread.currentThread()) != null)
        {
            throw new com.sap.mw.jco.JCO.Exception(106, "JCO_ERROR_RESOURCE", "An other server instance already set for the current thread");
        } else
        {
            serverThreads.put(Thread.currentThread(), server);
            return;
        }
    }

    public static void removeServerThread()
    {
        if(serverThreads.get(Thread.currentThread()) == null)
        {
            throw new com.sap.mw.jco.JCO.Exception(106, "JCO_ERROR_RESOURCE", "No server instance set for the current thread");
        } else
        {
            serverThreads.remove(Thread.currentThread());
            return;
        }
    }

    public static com.sap.mw.jco.JCO.Server getServerObject()
    {
        com.sap.mw.jco.JCO.Server server;
        if((server = (com.sap.mw.jco.JCO.Server)serverThreads.get(Thread.currentThread())) == null)
            throw new com.sap.mw.jco.JCO.Exception(106, "JCO_ERROR_RESOURCE", "No server instance set for the current thread");
        else
            return server;
    }

    private static Hashtable serverThreads = new Hashtable();

}

⌨️ 快捷键说明

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