Sei sulla pagina 1di 5

// Decompiled by DJ v3.12.12.96 Copyright 2011 Atanas Neshkov Date: 11/7/2013 2 :32:20 PM // Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov .com/dj.

html - Check often for new version! // Decompiler options: packimports(3) // Source File Name: MiddlewareHelper.java package symbols.framework.eai.middleware; import java.util.Hashtable; import symbols.framework.eai.middleware.pool.MiddlewareConnectionPool; // Referenced classes of package symbols.framework.eai.middleware: // MiddlewareConnection, MiddlewareException, MiddlewareProperties, M iddlewareConnector public class MiddlewareHelper { public MiddlewareHelper() { } public static MiddlewareConnection start(boolean _transReqd) throws Exception { MiddlewareConnection conn; if(MiddlewareProperties.POOL_MAINTENANCE) conn = MiddlewareConnectionPool.getInstance().getConnection(); else conn = new MiddlewareConnection(); conn.setTransaction(_transReqd); conn.setTimeout((int)MiddlewareProperties.TRANSACTION_TIMEOUT); return conn; } public static MiddlewareConnection start(String _systemName, boolean _transR eqd) throws Exception { MiddlewareConnection conn; if(MiddlewareProperties.POOL_MAINTENANCE) conn = MiddlewareConnectionPool.getInstance().getConnection(); else conn = new MiddlewareConnection(); conn.setTransaction(_transReqd); return conn; } public static MiddlewareConnection start(String _systemName, boolean _transR eqd, int _timeout) throws Exception { MiddlewareConnection conn; if(MiddlewareProperties.POOL_MAINTENANCE) conn = MiddlewareConnectionPool.getInstance().getConnection(); else conn = new MiddlewareConnection(); conn.setTransaction(_transReqd); conn.setTimeout(_timeout);

return conn; } public static void end(MiddlewareConnection _conn) throws Exception { if(_conn != null) { if(MiddlewareProperties.POOL_MAINTENANCE) MiddlewareConnectionPool.getInstance().release(_conn); else _conn.close(); _conn = null; } } public static void execute(MiddlewareConnection _conn, String _backendSystem , String _serviceCode, String _parms[], int _inputParms, int _outputParms) throws Exception { generate(_conn, _backendSystem, _serviceCode, _parms, _inputParms, _outp utParms); } public static String[] generate(MiddlewareConnection _conn, String _backendS ystem, String _serviceCode, String _parms[], int _inputParms, int _outputParms) throws Exception { if(_conn == null) throw new MiddlewareException("ERROR: No connection to Middleware!!! "); String argument[] = new String[_inputParms + _outputParms + 2]; argument[0] = _backendSystem; argument[1] = _serviceCode; for(int i = 0; i < _outputParms; i++) argument[i + 2] = " "; for(int i = 0; i < _inputParms; i++) { if(_parms[i].equals("") || _parms[i] == "") _parms[i] = " "; argument[i + 2 + _outputParms] = _parms[i]; } _conn.getConnection().executeService(argument, _outputParms); return argument; } public static String[] generate(MiddlewareConnection _conn, String _backendS ystem, String _serviceCode, String _parms[], int _inputParms, int _outputParms, byte _byteBuffer[][]) throws Exception { if(_conn == null) throw new MiddlewareException("ERROR: No connection to Middleware!!! "); String argument[] = new String[_inputParms + _outputParms + 2]; argument[0] = _backendSystem; argument[1] = _serviceCode; for(int i = 0; i < _outputParms; i++)

argument[i + 2] = " "; for(int i = 0; i < _inputParms; i++) { if(_parms[i].equals("") || _parms[i] == "") _parms[i] = " "; argument[i + 2 + _outputParms] = _parms[i]; } _conn.getConnection().executeService(argument, _outputParms, _byteBuffer ); return argument; } public static Hashtable query(MiddlewareConnection _conn, String _backendSys tem, String _serviceCode, String _txnId) throws Exception { if(_conn == null) { throw new MiddlewareException("ERROR: No connection to Middleware!!! "); } else { Hashtable rs = new Hashtable(); _conn.getConnection().getData(_backendSystem, _serviceCode, new Inte ger(_txnId), rs); return rs; } } public static Hashtable query(MiddlewareConnection _conn, String _backendSys tem, String _serviceCode, String _txnId, int _startRec, int _endRec) throws Exception { if(_conn == null) { throw new MiddlewareException("ERROR: No connection to Middleware!!! "); } else { Hashtable rs = new Hashtable(); _conn.getConnection().getData(_backendSystem, _serviceCode, new Inte ger(_txnId), _startRec, _endRec, rs); return rs; } } public static void commit(MiddlewareConnection _conn) throws Exception { if(_conn == null) throw new MiddlewareException("ERROR: No connection to Middleware!!! "); _conn.getConnection().commit(); end(_conn); break MISSING_BLOCK_LABEL_35; Exception exception; exception; end(_conn);

throw exception; } public static void rollback(MiddlewareConnection _conn) throws Exception { if(_conn == null) throw new MiddlewareException("ERROR: No connection to Middleware!!! "); _conn.getConnection().rollback(); end(_conn); break MISSING_BLOCK_LABEL_35; Exception exception; exception; end(_conn); throw exception; } public static byte[][] getSignature(MiddlewareConnection _conn, String _back endSystem, String _serviceCode, String _parms[], int _inputParms, int _outputPar ms) throws Exception { if(_conn == null) throw new MiddlewareException("ERROR: No connection to Middleware!!! "); String argument[] = new String[_inputParms + _outputParms + 2]; argument[0] = _backendSystem; argument[1] = _serviceCode; for(int i = 0; i < _outputParms; i++) argument[i + 2] = " "; for(int i = 0; i < _inputParms; i++) argument[i + 2 + _outputParms] = _parms[i]; byte buffer[][] = (byte[][])null; try { buffer = _conn.getConnection().getSignature(argument, _outputParms); } catch(Exception e) { throw e; } for(int i = 0; i < _outputParms; i++) _parms[i] = argument[i]; return buffer; } public static void getFile(MiddlewareConnection _conn, String _backendSystem , String _hostDirobj, String _dir, String _filename, int _bufferSize) throws Exception { int retOffset = 1; try { while(retOffset > 0) retOffset = _conn.getConnection().getDataFile(_backendSystem, _h ostDirobj, _dir, _filename, _bufferSize, retOffset);

} catch(Exception e) { throw e; } } public static void putFile(MiddlewareConnection _conn, String _backendSystem , String _branchCode, byte _data[], int _len, String _filStat, int _fOffset) throws Exception { try { _conn.getConnection().putDataFile(_backendSystem, _branchCode, _data , _len, _filStat, _fOffset); } catch(Exception e) { throw e; } } private static final String NULLSTR = " "; }

Potrebbero piacerti anche