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

📄 imiddleware.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:   IMiddleware.java

package com.sap.mw.jco;

import java.util.Hashtable;
import java.util.Properties;

// Referenced classes of package com.sap.mw.jco:
//            JCO

public abstract class IMiddleware
{
    public static interface IServer
    {

        public abstract String[][] getPropertyInfo();

        public abstract void initialize(JCO.Server server, Properties properties1);

        public abstract void listen(JCO.Server server, String s);

        public abstract void disconnect(JCO.Server server);

        public abstract void abort(JCO.Server server, String s);

        public abstract boolean isAlive(JCO.Server server);

        public abstract void getAttributes(JCO.Server server);
    }

    public static interface IClient
    {

        public abstract String[][] getPropertyInfo();

        public abstract void initialize(JCO.Client client, Properties properties1);

        public abstract void connect(JCO.Client client, String s);

        public abstract void disconnect(JCO.Client client);

        public abstract void abort(JCO.Client client, String s);

        public abstract void reset(JCO.Client client);

        public abstract boolean isAlive(JCO.Client client);

        public abstract void getAttributes(JCO.Client client);

        public abstract void execute(JCO.Client client, String s, JCO.ParameterList parameterlist, JCO.ParameterList parameterlist1, JCO.ParameterList parameterlist2, JCO.ParameterList parameterlist3, String s1, 
                String s2, int i);

        public abstract void confirmTID(JCO.Client client, String s);

        public abstract String createTID(JCO.Client client);
    }


    public IMiddleware()
    {
    }

    public abstract String[][] getPropertyInfo();

    public final Properties getProperties()
    {
        return properties;
    }

    public final String getProperty(String key)
    {
        return properties.getProperty(key);
    }

    public void setProperty(String key, String value)
    {
        if(key != null)
            if(value != null)
                properties.put(key, value);
            else
                properties.remove(key);
    }

    public final String getName()
    {
        return properties.getProperty("jco.middleware.name");
    }

    public final String getVersion()
    {
        return properties.getProperty("jco.middleware.version");
    }

    protected int getMaxStartupDelay()
    {
        return 3600;
    }

    public abstract void setTraceLevel(int i);

    public abstract IClient getClientInterface();

    public abstract IServer getServerInterface();

    protected String findProperty(String key, Properties props)
    {
        String value = props.getProperty(key);
        if(value == null)
        {
            key = key.substring(key.lastIndexOf('.') + 1);
            value = props.getProperty(key);
            if(value == null)
            {
                key = key.toUpperCase();
                value = props.getProperty(key);
            }
        }
        return value == null || value.length() <= 0 ? null : value;
    }

    protected String rightTrim(String str)
    {
        if(str != null)
        {
            int last = str.length() - 1;
            int i;
            for(i = last; i >= 0 && str.charAt(i) <= ' '; i--);
            if(i < last)
                str = str.substring(0, i + 1);
        }
        return str;
    }

    protected void removeProperty(String key, Properties props)
    {
        if(props.containsKey(key))
        {
            props.remove(key);
        } else
        {
            key = key.substring(key.lastIndexOf('.') + 1);
            if(props.containsKey(key))
            {
                props.remove(key);
            } else
            {
                key = key.toUpperCase();
                if(props.containsKey(key))
                    props.remove(key);
            }
        }
    }

    protected void setConnParams(JCO.Connection conn, String conn_params)
    {
        conn.conn_params = conn_params;
    }

    protected Object getConnObject(JCO.Connection conn)
    {
        return conn.conn_object;
    }

    protected void setConnObject(JCO.Connection conn, Object conn_object)
    {
        conn.conn_object = conn_object;
    }

    protected void setAttributes(JCO.Connection conn, JCO.Attributes attributes)
    {
        conn.attributes = attributes;
    }

    protected void setState(JCO.Server server, byte state)
    {
        server.setState(state);
    }

    protected void ensureBufferCapacity(JCO.Record record)
    {
        record.ensureBufferCapacity();
    }

    protected void appendRows(JCO.Table table, int num_rows)
    {
        if(num_rows == 1)
            table.appendRow();
        else
        if(num_rows > 1)
            table.appendRows(num_rows);
    }

    protected void trimToRows(JCO.Table table)
    {
        table.trimToRows();
        for(int i = 0; i < ((JCO.Record) (table)).opcode.length; i++)
            ((JCO.Record) (table)).opcode[i] = 0;

        table.delta = null;
    }

    protected JCO.Function getFunction(JCO.Server server, String function_name)
    {
        return server.getFunction(function_name);
    }

    protected boolean checkAuthorization(JCO.Server server, String function_name, int authorization_mode, String authorization_partner, byte authorization_key[])
    {
        return server.checkAuthorization(function_name, authorization_mode, authorization_partner, authorization_key);
    }

    protected void handleRequest(JCO.Server server, JCO.Function function)
        throws Exception
    {
        server.handleRequest(function);
    }

    protected void addTiming(JCO.Throughput throughput, long num_calls, long time_marshall, long time_unmarshall, 
            long time_middleware, long time_handle_request, long time_total, long num_sent_bytes, long num_received_bytes)
    {
        throughput.num_calls += num_calls;
        throughput.time_marshall += time_marshall;
        throughput.time_unmarshall += time_unmarshall;
        throughput.time_middleware += time_middleware;
        throughput.time_handle_request += time_handle_request;
        throughput.time_total += time_total;
        throughput.num_sent_bytes += num_sent_bytes;
        throughput.num_received_bytes += num_received_bytes;
    }

    protected boolean toBoolean(String arg)
    {
        if(arg == null)
        {
            return false;
        } else
        {
            arg = arg.trim().toLowerCase();
            return arg.equals("1") || arg.equals("true") || arg.equals("yes");
        }
    }

    protected static final String JCO_NAME = "jco.middleware.name";
    protected static final String JCO_VERSION = "jco.middleware.version";
    protected static final Properties properties = new Properties();

}

⌨️ 快捷键说明

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