pl.edu.pjwstk.yaod.system.processes
Class SVRP

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--pl.edu.pjwstk.yaod.system.processes.SVRP
All Implemented Interfaces:
java.lang.Runnable

public class SVRP
extends java.lang.Thread

Obiekty tej klasy reprezentuja klienta po stronie serwera. Jeden obiekt klasy ServerProcess tworzony dla jednego nadchodzącego polaczenia od klienta.

Author:
M. Lentner, raist@ertel.com.pl

Field Summary
static int HTTP
           
static int YNET
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SVRP(DatabaseManager manager, java.net.Socket socket, int protocol)
          Tworzy nowy proces uslugowy: tworzy komunikator, pobiera liste oslon oslon, inicjalizuje menedzera obiektow i parser yaql.
 
Method Summary
static java.util.Vector execute(Interpreter qproc, java.lang.String cmd)
          Wykonuje instrukcje yaql.
 Interpreter getInterpreter()
          Zwraca obiekt reprezentujacy interpreter wykorzystywany przez ten proces uslugowy.
 ObjectManager getObjectManager()
          Zwraca menedzera obiektow wykorzystywanego przez ten proces.
 Wrappable getStoreByID(int id)
          Zwraca oslone skladu o podanym identyfikatorze.
 java.util.Enumeration getStores()
          Zwraca oslony wszystkich skladow.
 void run()
          Uruchamia watek realizujacy zadania procesu uslugowego: nasluchiwanie na zadania klientow, wykonywanie i wysylanie odpowiedzi.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

YNET

public static final int YNET

HTTP

public static final int HTTP
Constructor Detail

SVRP

public SVRP(DatabaseManager manager,
            java.net.Socket socket,
            int protocol)
     throws java.io.IOException
Tworzy nowy proces uslugowy: tworzy komunikator, pobiera liste oslon oslon, inicjalizuje menedzera obiektow i parser yaql.
Parameters:
manager - menedzer bazy danych, ktory uruchomil ten proces.
socket - gniazdko reprezentujace polaczenie z klientem.
Throws:
java.io.IOException - nie mozna stworzyc komunikatora.
Method Detail

getInterpreter

public Interpreter getInterpreter()
Zwraca obiekt reprezentujacy interpreter wykorzystywany przez ten proces uslugowy.
Returns:
obiekt interpretera.

getStoreByID

public Wrappable getStoreByID(int id)
Zwraca oslone skladu o podanym identyfikatorze.
Parameters:
id - identyfikator skladu.
Returns:
oslona skladu.

getStores

public java.util.Enumeration getStores()
Zwraca oslony wszystkich skladow.
Returns:
oslony wszystkich skladow.

getObjectManager

public ObjectManager getObjectManager()
Zwraca menedzera obiektow wykorzystywanego przez ten proces.
Returns:
obiekt menedzera obiektow.

run

public void run()
Uruchamia watek realizujacy zadania procesu uslugowego: nasluchiwanie na zadania klientow, wykonywanie i wysylanie odpowiedzi.
Overrides:
run in class java.lang.Thread

execute

public static java.util.Vector execute(Interpreter qproc,
                                       java.lang.String cmd)
                                throws SBQLException
Wykonuje instrukcje yaql. Tylko jedna sesja moze wykonac w tym samym czasie jakas instrukcje (prosta blokada gruboziarnista).
Parameters:
qproc - obiekt interpretera, ktory ma wykonac dany program yaql.
Returns:
wynik wykonania programu.
Throws:
SBQLException - blad wykonania programu.