|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object janus.net.Connection
public class Connection
Diese Klasse stellt die Verbindung der JAVA-Applikation über ein Gateway oder den TCP_TAN-Server zu den Servern auf einem Tandem-System her.
Das Gateway (TCP_RSC) muss auf einer Plattform installiert werden, die RSC unterstützt:
JVM <--(TCP/IP)--> TCP_RSC <--(RSC)--> TDP <--(PATHSEND)--> ServerAlternativ kann direkt der Prozess TCP_TAN auf dem Tandem-System installiert und angesprochen werden. Die Lösung kommt so ohne RSC-Lizenzen oder externe Gateway-Rechner aus:
JVM <--(TCP/IP)--> TCP_TAN <--(PATHSEND)--> Server
Field Summary | |
---|---|
protected static int |
ACCEPT_SIZE
Protokollkonstante |
protected static int |
ADDRESS_SIZE
Protokollkonstante |
protected String |
alias
UMS-Aliasname (Server) |
protected boolean |
connected
true, wenn Verbindung besteht |
protected boolean |
debug
Debug einschalten. |
protected PrintWriter |
debugStream
PrintWriter für Debugging |
static String |
DEFAULT_HOST
Standard TCP/IP-Name des Gatewayhosts |
static String |
DEFAULT_INIT
Standardtext für INIT-Nachricht ("$PM") |
static int |
DEFAULT_PORT
Standard TCP/IP-Portnummer des Gateways |
protected String |
destination
Zielfeld aus DATA-Nachricht |
protected static int |
DESTINATION_SIZE
Protokollkonstante |
protected CommException |
exception
Letzter Fehler |
protected static int |
HEADER_SIZE
Protokollkonstante |
protected String |
host
TCP/IP-Adresse des Gateway-Systems oder Hosts |
protected int |
id
ID für das Debugging |
protected String |
init
Initialisierungs-Information (Pathmon-Name oder RSC.INI-Datei) |
protected static int |
INIT_SIZE
Protokollkonstante |
protected InputStream |
input
TCP/IP-Eingabe-Strom |
protected byte[] |
io_buffer
Sende und Empfangspuffer |
protected static int |
IO_BUFFER_SIZE
Protokollkonstante |
protected int |
io_len
Gesamt-Pufferlänge |
protected static int |
IP_ADDRESS_SIZE
Protokollkonstante |
protected NumberString |
long_number
Hilfsfeld für große Zahlen |
protected static int |
LONG_NUMBER_SIZE
Protokollkonstante |
protected int |
message_type
Art der empfangenen Nachricht |
static int |
MT_ACCEPT
Nachrichtentyp Verbindungsannahme |
static int |
MT_ACK
Nachrichtentyp positive Quittung |
static int |
MT_AWAITIO
Nachrichtentyp Warten auf I/O-Completion |
static int |
MT_CANCEL
Nachrichtentyp I/O-Abbruch |
static int |
MT_DATA
Nachrichtentyp Server-Message |
static int |
MT_ERROR
Nachrichtentyp negative Quittung |
static int |
MT_INIT
Nachrichtentyp Initialisierung |
static int |
MT_REPLY
Nachrichtentyp Server-Antwort |
static int |
MT_TRANSACTION
Nachrichtentyp Transaktion |
protected static int |
MT_UNKNOWN
Nachrichtentyp unbekannt |
protected boolean |
nowait
true, wenn ein Nowait-I/O aussteht |
protected NumberString |
number
Hilfsfeld für Zahlen |
protected static int |
NUMBER_SIZE
Protokollkonstante |
protected byte[] |
nw_buffer
Verweis auf Puffer für Reply aus Nowait-I/O |
protected int |
nw_length
Maximale Länge des Nowait-Reply |
protected int |
nw_offset
Offset innerhalb des Nowait-Reply |
protected int |
option
Options-Bits |
protected static int |
OPTION_NOWAIT
Bedeutung der Optionen |
protected OutputStream |
output
TCP/IP-Ausgabe-Strom |
protected String |
partner
Prozessname des Gegenprozesses (TCP_TAN) fuer UMS Bei Servern die letzte adressierte Destination |
protected int |
port
TCP/IP-Port des Gateway-Systems oder Hosts |
protected int |
reply_len
Maximale Antwortlänge |
protected static int |
REPLY_SIZE
Protokollkonstante |
protected boolean |
server
true, wenn dies eine Serververbindung ist |
protected Socket |
socket
TCP/IP-Socket zum Gateway |
protected int |
success_hi
Oberer Grenzwert für erfolgreiche Transaktion |
protected int |
success_lo
Unterer Grenzwert für erfolgreiche Transaktion |
protected static String |
TAG_ACCEPT
Nachrichtentag Verbindungsannahme |
protected static String |
TAG_ACK
Nachrichtentag positive Quittung |
protected static String |
TAG_AWAITIO
Nachrichtentag Warten auf I/O-Completion |
protected static String |
TAG_CANCEL
Nachrichtentag I/O-Abbruch |
protected static String |
TAG_DATA
Nachrichtentag Server-Message |
protected static String |
TAG_ERROR
Nachrichtentag negative Quittung |
protected static String |
TAG_INIT
Nachrichtentag Initialisierung |
protected static String |
TAG_REPLY
Nachrichtentag Server-Antwort |
protected static int |
TAG_SIZE
Protokollkonstante |
protected static String |
TAG_TRANSACTION
Nachrichtentag Transaktion |
protected String |
terminal
UMS-Terminalname (Server) |
protected static int |
TEXT_SIZE
Protokollkonstante |
protected int |
timeout
Timeout-Wert (aus DATA-Nachricht oder AWAITIO) |
protected boolean |
transaction
true, wenn Transaktion aktiv |
protected static int |
TRANSACTION_SIZE
Protokollkonstante |
protected int |
transaction_type
Transaktionstyp |
static int |
TT_AUTOCOMMIT
Transaktionstyp - Automatische Transaktion |
static int |
TT_BEGIN
Transaktionstyp - BeginTransaction |
static int |
TT_COMMIT
Transaktionstyp - EndTransaction |
static int |
TT_IN_PROGRESS
Transaktionstyp - Transaktion aktiv (nur intern benutzt) |
static int |
TT_NONE
Transaktionstyp - Keine Transaktion |
static int |
TT_ROLLBACK
Transaktionstyp - AbortTransaktion |
static int |
TT_SINGLE
Transaktionstyp - Einzeltransaktion |
protected char |
type
Typ für das Debugging |
protected String |
ums_address
IP-Adresse (UMS) |
protected static int |
UMS_ALIAS_SIZE
Protokollkonstante |
protected int |
ums_port
IP-Port (UMS) |
protected static int |
UMS_TERMINAL_SIZE
Protokollkonstante |
protected ServerConnection |
umsConnection
UMS-Connection |
protected int |
user_code
Fehlernummer aus Nachricht |
protected int |
user_len
Länge der Nutzdaten |
protected int |
user_offset
Beginn der Nutzdaten |
protected Object |
userObject
User-Object (@see #setUserObject) |
Constructor Summary | |
---|---|
protected |
Connection()
Konstruktor ohne Parameter - für abgeleitete Klassen |
|
Connection(ConnectionParameter param)
Konstruktor - baut die Verbindung zum Tandem-System auf. |
|
Connection(ConnectionParameter param,
boolean debug)
Konstruktor - baut die Verbindung zum Tandem-System auf. |
|
Connection(String host,
int port,
String init)
Konstruktor - baut die Verbindung zum Tandem-System auf. |
|
Connection(String host,
int port,
String init,
boolean compress,
boolean debug)
Konstruktor - baut die Verbindung zum Tandem-System auf. |
|
Connection(String host,
int port,
String init,
boolean compress,
PrintWriter stream)
Konstruktor - baut die Verbindung zum Tandem-System auf. |
|
Connection(String host,
int port,
String init,
boolean compress,
String file)
Konstruktor - baut die Verbindung zum Tandem-System auf. |
Method Summary | |
---|---|
void |
abortTransaction()
Zurücknehmen einer Transaktion (Alias für rollbackTransaction.) |
ServerConnection |
acceptNew()
Umgekehrter Verbindungsaufbau für UMS |
protected Socket |
acceptUmsServerSocket(ServerSocket ss)
Nehme den UMS-Server-Socket an. |
void |
autoCommitTransaction(int success_lo,
int success_hi)
Automatisches Transaktionsende. |
int |
awaitIo(int timeout)
Warte auf I/O. |
void |
beginTransaction()
Beginn einer Transaktion. |
void |
cancel()
Breche Nowait-I/O ab. |
protected void |
checkConnection()
Test auf bestehende Verbindung. |
void |
commitTransaction()
Beenden einer Transaktion (Alias für endTransaction.) |
void |
connect()
Verbindungsaufbau mit den gespeicherten Parametern. |
void |
connect(String host,
int port,
String init)
Verbindungsaufbau. |
void |
connect(String host,
int port,
String init,
boolean compress)
Verbindungsaufbau. |
protected void |
createSocket()
Erzeuge den Client-Socket. |
protected ServerSocket |
createUmsServerSocket(int port)
Erzeuge den UMS-Server-Socket. |
void |
disconnect()
Verbindungsabbau |
void |
endTransaction()
Beenden einer Transaktion. |
void |
finalize()
Finalizer: Ruft disconnect() auf. |
String |
getAlias()
Rückgabe des UMS-Alias |
byte[] |
getBuffer()
Rückgabe des Byte-Puffers |
ConnectionParameter |
getConnectionParameter()
Rückgabe der Verbindungsparameter |
PrintWriter |
getDebugStream()
Rückgabe des DebugStream |
String |
getDestination()
Rückgabe der Destination der letzten DATA-Nachricht |
CommException |
getException()
Rückgabe des letzten Fehlers |
String |
getInit()
Rückgabe der Init-Nachricht bzw. der Antwort darauf |
int |
getIoLen()
Rückgabe des Byte-Puffers |
int |
getMessageType()
Rückgabe des Nachrichtentyps |
byte[] |
getNowaitBuffer()
Rückgabe des Nowait-Puffers |
String |
getPartner()
Rückgabe des Gegenprozesses (TCP_TAN) bzw. der Destination der letzten DATA-Nachricht |
int |
getReplyLen()
Rückgabe der erwarteten Antwortlänge |
int |
getSuccessHi()
Rückgabe des oberen Autocommitwertes |
int |
getSuccessLo()
Rückgabe des unteren Autocommitwertes |
String |
getTerminal()
Rückgabe des UMS-Terminalnamens |
int |
getTimeout()
Rückgabe des Timeouts |
int |
getTransactionType()
Rückgabe des Transaktionstyps |
String |
getUmsAddress()
Rückgabe der IP-Adresse für die UMS-Connection |
ServerConnection |
getUmsConnection()
Rückgabe der UMS-Connection |
int |
getUmsPort()
Rückgabe des IP-Ports für die UMS-Connection |
int |
getUserCode()
Rückgabe des Fehlercodes |
String |
getUserData()
Rückgabe der User-Daten als String. |
int |
getUserData(byte[] dst,
int offset,
int maxlen)
Rückgabe der User-Daten. |
int |
getUserLen()
Rückgabe der Länge der User-Daten |
Object |
getUserObject()
Zugriff auf das User-Objekt |
int |
getUserOffset()
Rückgabe des Offsets der User-Daten |
boolean |
isConnected()
Rückgabe des Verbindungsstatus |
boolean |
isDebug()
Rückgabe des Debug-Status |
boolean |
isNowait()
Rückgabe des Nowait-Status |
boolean |
isTransaction()
Rückgabe des Transaktionsstatus |
static void |
main(String[] args)
Test |
protected String |
makeUmsDest(String terminal,
String alias,
int reply_len)
Konstruiere die spezielle UMS-Destination |
void |
notImplemented(String caller)
Wirf CommException NOT_IMPLEMENTED |
void |
println(Object text)
Debugging |
void |
receiveBuffer()
Empfangen der Antwort in io_buffer. |
void |
rollbackTransaction()
Zurücknehmen einer Transaktion. |
protected void |
sendAccept(int port)
Accept-Nachricht. |
void |
sendBuffer(byte[] buffer,
int length)
Senden eines beliebigen Puffers. |
protected void |
sendBuffer(String tag,
int len,
int opt)
Senden einer Nachricht. |
protected void |
sendInit(String init)
Init-Nachricht. |
protected int |
sendMessage(String dest)
Message an Server. |
int |
sendMessage(String dest,
byte[] msg,
int msg_offset,
int msg_len,
byte[] reply,
int reply_offset,
int reply_len)
Message an Server. |
int |
sendMessage(String dest,
byte[] msg,
int msg_offset,
int msg_len,
byte[] reply,
int reply_offset,
int reply_len,
int timeout)
Message an Server mit Timeout. |
protected int |
sendMessage(String dest,
int timeout)
Message an Server mit Timeout. |
int |
sendMessage(String dest,
MessageElement[] msg,
MessageElement[] reply)
Message an Server. |
int |
sendMessage(String dest,
MessageElement[] msg,
MessageElement[] reply,
int timeout)
Message an Server mit Timeout. |
int |
sendMessage(String dest,
MessageElement msg,
int msg_len,
MessageElement reply)
Message an Server. |
int |
sendMessage(String dest,
MessageElement msg,
int msg_len,
MessageElement reply,
int timeout)
Message an Server mit Timeout. |
int |
sendMessage(String dest,
MessageElement msg,
MessageElement reply)
Message an Server. |
int |
sendMessage(String dest,
MessageElement msg,
MessageElement reply,
int timeout)
Message an Server mit Timeout. |
void |
sendTransaction(int type,
int success_lo,
int success_hi)
Transaktionsmessage. |
int |
sendUms(String terminal,
String alias,
byte[] msg,
int msg_offset,
int msg_len,
byte[] reply,
int reply_offset,
int reply_len)
Message an UMS-Client. |
int |
sendUms(String terminal,
String alias,
MessageElement msg,
int msg_len,
MessageElement reply)
Message an UMS-Client. |
int |
sendUms(String terminal,
String alias,
MessageElement msg,
MessageElement reply)
Message an UMS-Client. |
boolean |
setDebug(boolean debug)
Setzen des Debug-Status |
void |
setDebugStream(PrintWriter stream)
Setzen des debugStream und Debug-Status |
void |
setDebugStream(String file)
Setzen des debugStream und Debug-Status |
void |
setUserObject(Object obj)
Speichern eines User-Objektes Solche Objekte können zum Beispiel Puffer enthalten die pro Verbindung (in einem Pool) nur einmal erzeugt werden sollen Beispiel: conn = pool.getConnection( timeout ); MyMessage msg = (MyMessage) conn.getUserObject(); if ( msg == null ) { msg = new MyMessage(); conn.setUserObject( msg ); } |
void |
singleTransaction(int success_lo,
int success_hi)
Automatische Einzeltransaktion. |
protected void |
tcpRead(int offset,
int len)
Empfangen einer definierten Anzahl von Bytes über die Socket-Verbindung. |
protected void |
tcpWrite()
Senden des Puffers über die Socket-Verbindung. |
String |
toString()
Stringdarstellung |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int ACCEPT_SIZE
protected static final int ADDRESS_SIZE
protected String alias
protected boolean connected
protected boolean debug
protected PrintWriter debugStream
public static final String DEFAULT_HOST
public static final String DEFAULT_INIT
public static final int DEFAULT_PORT
protected String destination
protected static final int DESTINATION_SIZE
protected CommException exception
protected static final int HEADER_SIZE
protected String host
protected int id
protected String init
protected static final int INIT_SIZE
protected InputStream input
protected byte[] io_buffer
protected static final int IO_BUFFER_SIZE
protected int io_len
protected static final int IP_ADDRESS_SIZE
protected NumberString long_number
protected static final int LONG_NUMBER_SIZE
protected int message_type
public static final int MT_ACCEPT
public static final int MT_ACK
public static final int MT_AWAITIO
public static final int MT_CANCEL
public static final int MT_DATA
public static final int MT_ERROR
public static final int MT_INIT
public static final int MT_REPLY
public static final int MT_TRANSACTION
protected static final int MT_UNKNOWN
protected boolean nowait
protected NumberString number
protected static final int NUMBER_SIZE
protected byte[] nw_buffer
protected int nw_length
protected int nw_offset
protected int option
protected static final int OPTION_NOWAIT
protected OutputStream output
protected String partner
protected int port
protected int reply_len
protected static final int REPLY_SIZE
protected boolean server
protected Socket socket
protected int success_hi
protected int success_lo
protected static final String TAG_ACCEPT
protected static final String TAG_ACK
protected static final String TAG_AWAITIO
protected static final String TAG_CANCEL
protected static final String TAG_DATA
protected static final String TAG_ERROR
protected static final String TAG_INIT
protected static final String TAG_REPLY
protected static final int TAG_SIZE
protected static final String TAG_TRANSACTION
protected String terminal
protected static final int TEXT_SIZE
protected int timeout
protected boolean transaction
protected static final int TRANSACTION_SIZE
protected int transaction_type
public static final int TT_AUTOCOMMIT
public static final int TT_BEGIN
public static final int TT_COMMIT
public static final int TT_IN_PROGRESS
public static final int TT_NONE
public static final int TT_ROLLBACK
public static final int TT_SINGLE
protected char type
protected String ums_address
protected static final int UMS_ALIAS_SIZE
protected int ums_port
protected static final int UMS_TERMINAL_SIZE
protected ServerConnection umsConnection
protected int user_code
protected int user_len
protected int user_offset
protected Object userObject
Constructor Detail |
---|
protected Connection()
public Connection(ConnectionParameter param) throws CommException, TandemException
param
- Parameter zum Aufbau der Verbindung
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic Connection(ConnectionParameter param, boolean debug) throws CommException, TandemException
param
- Parameter zum Aufbau der Verbindungdebug
- Testinformationen auf debugStream ausgeben
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic Connection(String host, int port, String init) throws CommException, TandemException
host
- TCP/IP-Adresse des Gateway-Systemsport
- TCP/IP-Port des Gateway-Systemsinit
- Initialisierungs-Information (Pathmon oder RSC.INI-Datei)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic Connection(String host, int port, String init, boolean compress, boolean debug) throws CommException, TandemException
host
- TCP/IP-Adresse des Gateway-Systems oder Hostsport
- TCP/IP-Port des Gateway-Systems oder Hostsinit
- Initialisierungs-Information
(Name der RSC.INI-Datei oder Pathmon-Name)compress
- Kompression einschalten (ohne Funktion)debug
- Testinformationen auf debugStream ausgeben
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic Connection(String host, int port, String init, boolean compress, PrintWriter stream) throws CommException, TandemException
host
- TCP/IP-Adresse des Gateway-Systems oder Hostsport
- TCP/IP-Port des Gateway-Systems oder Hostsinit
- Initialisierungs-Information
(Name der RSC.INI-Datei oder Pathmon-Name)compress
- Kompression einschalten (ohne Funktion)stream
- Ausgabe-Stream f¨r Debugging
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic Connection(String host, int port, String init, boolean compress, String file) throws CommException, TandemException
host
- TCP/IP-Adresse des Gateway-Systems oder Hostsport
- TCP/IP-Port des Gateway-Systems oder Hostsinit
- Initialisierungs-Information
(Name der RSC.INI-Datei oder Pathmon-Name)compress
- Kompression einschalten (ohne Funktion)file
- Name der Debug-Datei
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-FehlerMethod Detail |
---|
public void abortTransaction() throws CommException, TandemException
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic ServerConnection acceptNew() throws CommException
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerprotected Socket acceptUmsServerSocket(ServerSocket ss) throws IOException
ss
- Server-Socket
IOException
public void autoCommitTransaction(int success_lo, int success_hi) throws CommException, TandemException
success_lo
- Unterer Vergleichswert für AUTOCOMMIT (16 Bit)success_hi
- Oberer Vergleichswert für AUTOCOMMIT (16 Bit)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-FehlersendMessage(java.lang.String, janus.util.MessageElement, janus.util.MessageElement)
,
singleTransaction(int, int)
,
isTransaction()
public int awaitIo(int timeout) throws CommException, TandemException
timeout
- Timeout (>=0 x0.01s)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic void beginTransaction() throws CommException, TandemException
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic void cancel() throws CommException, TandemException
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerprotected void checkConnection() throws CommException
CommException
- wenn keine Verbindung besteht.public void commitTransaction() throws CommException, TandemException
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic void connect() throws CommException, TandemException
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic void connect(String host, int port, String init) throws CommException, TandemException
host
- TCP/IP-Adresse des Gateway-Systems oder Hostsport
- TCP/IP-Port des Gateway-Systems oder Hostsinit
- Initialisierungs-Information
(Name der RSC.INI-Datei oder Pathmon-Name)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic void connect(String host, int port, String init, boolean compress) throws CommException, TandemException
host
- TCP/IP-Adresse des Gateway-Systems oder Hostsport
- TCP/IP-Port des Gateway-Systems oder Hostsinit
- Initialisierungs-Information
(Name der RSC.INI-Datei oder Pathmon-Name)compress
- Einschalten der Kompression (ohne Funktion)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerprotected void createSocket() throws IOException
IOException
protected ServerSocket createUmsServerSocket(int port) throws IOException
port
- Portnummer
IOException
public void disconnect()
public void endTransaction() throws CommException, TandemException
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic void finalize()
disconnect()
auf.
finalize
in class Object
public String getAlias()
public byte[] getBuffer()
public ConnectionParameter getConnectionParameter()
public PrintWriter getDebugStream()
public String getDestination()
public CommException getException()
public String getInit()
public int getIoLen()
public int getMessageType()
public byte[] getNowaitBuffer()
public String getPartner()
public int getReplyLen()
public int getSuccessHi()
public int getSuccessLo()
public String getTerminal()
public int getTimeout()
public int getTransactionType()
public String getUmsAddress()
public ServerConnection getUmsConnection()
public int getUmsPort()
public int getUserCode()
public String getUserData()
public int getUserData(byte[] dst, int offset, int maxlen) throws CommException
dst
- Zielbereich für die Datenoffset
- Offset innerhalb von dstmaxlen
- Maximale Länge
CommException
- Allgemeiner Kommunikationsfehlerpublic int getUserLen()
public Object getUserObject()
setUserObject(java.lang.Object)
public int getUserOffset()
public boolean isConnected()
public boolean isDebug()
public boolean isNowait()
public boolean isTransaction()
public static void main(String[] args) throws CommException
CommException
protected String makeUmsDest(String terminal, String alias, int reply_len)
terminal
- UMS-Terminalnamealias
- UMS-Aliasnamereply_len
- Maximale Länge der Antwort
public void notImplemented(String caller) throws CommException
caller
- Aufrufende Funktion
CommException
- nicht implementierte Funktionpublic void println(Object text)
public void receiveBuffer() throws CommException, TandemException
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic void rollbackTransaction() throws CommException, TandemException
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerprotected void sendAccept(int port) throws CommException, TandemException
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic void sendBuffer(byte[] buffer, int length) throws CommException
buffer
- Datenlength
- Länge der Daten
CommException
- Allgemeiner Kommunikationsfehlerprotected void sendBuffer(String tag, int len, int opt) throws CommException
tag
- Nachrichten-Tag ("INIT", "DATA", ...)len
- Länge der Nutzdaten ohne Headeropt
- Options-Flag
CommException
- Allgemeiner Kommunikationsfehlerprotected void sendInit(String init) throws CommException, TandemException
init
- Initialisierungs-Information
(Name der RSC.INI-Datei oder Pathmon-Name)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerprotected int sendMessage(String dest) throws CommException, TandemException
dest
- Name des Servers
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic int sendMessage(String dest, byte[] msg, int msg_offset, int msg_len, byte[] reply, int reply_offset, int reply_len) throws CommException, TandemException
dest
- Name des Serversmsg
- Message (Eingabe)msg_offset
- Offset innerhalb von Messagemsg_len
- Länge der Messagereply
- Antwort (Ausgabe)reply_offset
- Offset innerhalb der Antwortreply_len
- Maximale Länge der Antwort
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic int sendMessage(String dest, byte[] msg, int msg_offset, int msg_len, byte[] reply, int reply_offset, int reply_len, int timeout) throws CommException, TandemException
dest
- Name des Serversmsg
- Message (Eingabe)msg_offset
- Offset innerhalb von Messagemsg_len
- Länge der Messagereply
- Antwort (Ausgabe)reply_offset
- Offset innerhalb der Antwortreply_len
- Maximale Länge der Antworttimeout
- Timeout (-1 = ohne, 0 = Nowait, >0 = x0.01s)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerprotected int sendMessage(String dest, int timeout) throws CommException, TandemException
dest
- Name des Serverstimeout
- Timeout (-1 = ohne, 0 = Nowait, >0 = x0.01s)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic int sendMessage(String dest, MessageElement[] msg, MessageElement[] reply) throws CommException, TandemException
dest
- Name des Serversmsg
- Message (Eingabe)reply
- Antwort (Ausgabe)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic int sendMessage(String dest, MessageElement[] msg, MessageElement[] reply, int timeout) throws CommException, TandemException
dest
- Name des Serversmsg
- Message (Eingabe)reply
- Antwort (Ausgabe)timeout
- Timeout (-1 = ohne, 0 = Nowait, >0 = x0.01s)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic int sendMessage(String dest, MessageElement msg, int msg_len, MessageElement reply) throws CommException, TandemException
dest
- Name des Serversmsg
- Message (Eingabe)msg_len
- Länge der Messagereply
- Antwort (Ausgabe)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic int sendMessage(String dest, MessageElement msg, int msg_len, MessageElement reply, int timeout) throws CommException, TandemException
dest
- Name des Serversmsg
- Message (Eingabe)msg_len
- Länge der Messagereply
- Antwort (Ausgabe)timeout
- Timeout (-1 = ohne, 0 = Nowait, >0 = x0.01s)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic int sendMessage(String dest, MessageElement msg, MessageElement reply) throws CommException, TandemException
dest
- Name des Serversmsg
- Message (Eingabe)reply
- Antwort (Ausgabe)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic int sendMessage(String dest, MessageElement msg, MessageElement reply, int timeout) throws CommException, TandemException
dest
- Name des Serversmsg
- Message (Eingabe)reply
- Antwort (Ausgabe)timeout
- Timeout (-1 = ohne, 0 = Nowait, >0 = x0.01s)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic void sendTransaction(int type, int success_lo, int success_hi) throws CommException, TandemException
type
- Transaktionstyp (TT_BEGIN, TT_END, ...)success_lo
- Unterer Vergleichswert für AUTOCOMMIT (16 Bit)success_hi
- Oberer Vergleichswert für AUTOCOMMIT (16 Bit)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-Fehlerpublic int sendUms(String terminal, String alias, byte[] msg, int msg_offset, int msg_len, byte[] reply, int reply_offset, int reply_len) throws CommException
terminal
- UMS-Terminalnamealias
- UMS-Aliasnamemsg
- Message (Eingabe)msg_offset
- Offset innerhalb von Messagemsg_len
- Länge der Messagereply
- Antwort (Ausgabe)reply_offset
- Offset innerhalb der Antwortreply_len
- Maximale Länge der Antwort
CommException
- Allgemeiner Kommunikationsfehlerpublic int sendUms(String terminal, String alias, MessageElement msg, int msg_len, MessageElement reply) throws CommException
terminal
- UMS-Terminalnamealias
- UMS-Aliasnamemsg
- Message (Eingabe)msg_len
- Länge der Messagereply
- Antwort (Ausgabe)
CommException
- Allgemeiner Kommunikationsfehlerpublic int sendUms(String terminal, String alias, MessageElement msg, MessageElement reply) throws CommException
terminal
- UMS-Terminalnamealias
- UMS-Aliasnamemsg
- Message (Eingabe)reply
- Antwort (Ausgabe)
CommException
- Allgemeiner Kommunikationsfehlerpublic boolean setDebug(boolean debug)
debug
- Debug-Status
public void setDebugStream(PrintWriter stream)
stream
- Ausgabe-Stream für Debugausgabenpublic void setDebugStream(String file)
file
- Dateiname für Debugausgabenpublic void setUserObject(Object obj)
Solche Objekte können zum Beispiel Puffer enthalten die pro Verbindung (in einem Pool) nur einmal erzeugt werden sollen
Beispiel:
conn = pool.getConnection( timeout ); MyMessage msg = (MyMessage) conn.getUserObject(); if ( msg == null ) { msg = new MyMessage(); conn.setUserObject( msg ); }
obj
- Das Objektpublic void singleTransaction(int success_lo, int success_hi) throws CommException, TandemException
success_lo
- Unterer Vergleichswert für AUTOCOMMIT (16 Bit)success_hi
- Oberer Vergleichswert für AUTOCOMMIT (16 Bit)
CommException
- Allgemeiner Kommunikationsfehler
TandemException
- Tandem-FehlersendMessage(java.lang.String, janus.util.MessageElement, janus.util.MessageElement)
,
autoCommitTransaction(int, int)
,
isTransaction()
protected void tcpRead(int offset, int len) throws CommException
offset
- Position innerhalb von io_bufferlen
- Anzahl der Bytes
CommException
- Allgemeiner Kommunikationsfehlerprotected void tcpWrite() throws CommException
CommException
- Allgemeiner Kommunikationsfehlerpublic String toString()
toString
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |