org.iaccess.TNProtocol
Class JBOSS

java.lang.Object
  extended by java.lang.Thread
      extended by org.iaccess.TNProtocol.JBOSS
All Implemented Interfaces:
java.lang.Runnable

public class JBOSS
extends java.lang.Thread

Simutales a JBOSS server. It uses TCP/IP sockets to send/receive information. Should be deprecated in future releases and implemented with another application server, like Tomcat, Glassfish etc.

More details are given to each of the functions in the class.

See Also:
CredentialsConfig, iAccessDispatcher

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int queueLength
          Specifies the maximum queue length for incoming connection indications (a request to connect) is set to 500 by default.
static int RequestLength
          Specifies the maximum lenght of message in bytes.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JBOSS(iAccessDispatcher AccessDispatcher)
          Creates a new instance of the JBOSS class.
 
Method Summary
static byte[] GetRawRequest(TRequest Request)
          Transforms the hight level request (TNProtocol.TRequest class) to the the raw request (array of bytes of RequestLength elements) wchich can be sent over TCP/IP.
protected static javax.net.ssl.SSLContext getSSLContext()
           
static TRequest GetTRequest(byte[] RawRequest)
          Transforms the received raw request (array of bytes of RequestLength elements) to hight level TNProtocol.TRequest class.
 void run()
           
static java.lang.String sendRequestSSL(TRequest Request, java.net.InetAddress inetAddress)
          Sends the counter-request and awaits for the result.
static void sendResponseSSL(TRequest Request, int Result, javax.net.ssl.SSLSocket s)
          Sends response to the request and closes the connection.
 void Stop()
          Sends the stopWorking message to JBOSS server.
 
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, 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

queueLength

public static int queueLength
Specifies the maximum queue length for incoming connection indications (a request to connect) is set to 500 by default. If a connection indication arrives when the queue is full, the connection is refused.


RequestLength

public static int RequestLength
Specifies the maximum lenght of message in bytes.

Constructor Detail

JBOSS

public JBOSS(iAccessDispatcher AccessDispatcher)
Creates a new instance of the JBOSS class. Class java.util.Thread is inherited by JBOSS, i.e. JBOSS is always run in a new thread.

Method Detail

getSSLContext

protected static javax.net.ssl.SSLContext getSSLContext()

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

sendResponseSSL

public static void sendResponseSSL(TRequest Request,
                                   int Result,
                                   javax.net.ssl.SSLSocket s)
                            throws java.lang.Exception
Sends response to the request and closes the connection. TCPportOut defined at TSessioninfo is used for the connection.

Parameters:
Result - grant(1) or deny(0).
s - Denotes the socket awaiting for result.
Throws:
java.lang.Exception - is thrown when the remote connection fails.
See Also:
TSessionInfo

sendRequestSSL

public static java.lang.String sendRequestSSL(TRequest Request,
                                              java.net.InetAddress inetAddress)
                                       throws java.lang.Exception
Sends the counter-request and awaits for the result.

Parameters:
Request - Specifies the request which should be sent.
inetAddress - All requests are sent to this address to TCPportOut defined at TSessioninfo.
Returns:
the result of request. It may be grant(1) or deny(0).
Throws:
java.lang.Exception - is thrown when it is not possible to establish a remote connection.
See Also:
TSessionInfo

GetTRequest

public static TRequest GetTRequest(byte[] RawRequest)
Transforms the received raw request (array of bytes of RequestLength elements) to hight level TNProtocol.TRequest class. After this transformation the request is redirected to the iAccessDispatcher.

See Also:
TRequest

GetRawRequest

public static byte[] GetRawRequest(TRequest Request)
Transforms the hight level request (TNProtocol.TRequest class) to the the raw request (array of bytes of RequestLength elements) wchich can be sent over TCP/IP.

See Also:
TRequest

Stop

public void Stop()
Sends the stopWorking message to JBOSS server. No any more messages will be accepted by the server.