|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.jafer.zserver.ZServerThread
org.jafer.zserver.operations.Operation
public abstract class Operation
Each operation runs in it's own thread and either terminates naturally by sending response PDU (or Diagnostic) or can be stopped by session which forces close of socket. Operations must implement abstract runOp() method. Also includes methods for building diagnostics and handling exceptions.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static java.lang.String |
BIB1_DIAGNOSTIC_OID
|
private PDUDriver |
pduDriver
|
private Session |
session
|
Fields inherited from class org.jafer.zserver.ZServerThread |
---|
logger, STATE_RUNNING, STATE_STOPPED, STATE_STOPPING |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Operation(Session session,
java.lang.String name)
|
Method Summary | |
---|---|
void |
close()
|
protected z3950.v3.DefaultDiagFormat |
getDiagnostic(z3950.v3.DefaultDiagFormat defaultDiagFormat,
int condition,
java.lang.String addInfo)
|
protected z3950.v3.DiagRec |
getDiagnostic(z3950.v3.DiagRec diagRec,
int condition,
java.lang.String addInfo)
|
protected z3950.v3.NamePlusRecord_record |
getDiagnostic(z3950.v3.NamePlusRecord_record name_record,
int condition,
java.lang.String addInfo)
|
Session |
getSession()
|
void |
run()
|
abstract z3950.v3.PDU |
runOp()
|
private void |
sendPDU(z3950.v3.PDU pduResponse)
|
void |
start()
|
Methods inherited from class org.jafer.zserver.ZServerThread |
---|
getActiveThreads, getNumberOfActiveThreads, getServerThreadId, getServerThreadState, getStartTime, getThreads, getUpTime, halt, hasThreads, isStopped, isStopping, purgeThreads, setStartTime, setStopped, setStopping, setThreadName, setThreads, startThread |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BIB1_DIAGNOSTIC_OID
private Session session
private PDUDriver pduDriver
Constructor Detail |
---|
public Operation(Session session, java.lang.String name)
Method Detail |
---|
public final void start()
start
in class java.lang.Thread
public abstract z3950.v3.PDU runOp() throws java.lang.Exception
java.lang.Exception
public final void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public final void close()
close
in class ZServerThread
public Session getSession()
private void sendPDU(z3950.v3.PDU pduResponse) throws ConnectionException
ConnectionException
protected z3950.v3.DefaultDiagFormat getDiagnostic(z3950.v3.DefaultDiagFormat defaultDiagFormat, int condition, java.lang.String addInfo)
protected z3950.v3.DiagRec getDiagnostic(z3950.v3.DiagRec diagRec, int condition, java.lang.String addInfo)
protected z3950.v3.NamePlusRecord_record getDiagnostic(z3950.v3.NamePlusRecord_record name_record, int condition, java.lang.String addInfo)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |