amber.server.manager.handler
Class Application

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--amber.server.manager.handler.BaseHandler
              |
              +--amber.server.manager.handler.Application
All Implemented Interfaces:
HandlerInterface, java.lang.Runnable

public class Application
extends BaseHandler
implements HandlerInterface

This class handles the connection requirements for the particular incoming connection. This class handles the application systems.

See Also:
Core, HandlerInterface

Fields inherited from class amber.server.manager.handler.BaseHandler
dataDecoder, dataEncoder, encoderBytes, initPacket, loggingFile, mainServer, socket, type
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Application()
           
 
Method Summary
protected  boolean clientRequestedHandlers(java.net.Socket socket, Packet initPacket, AmberInputStream dd, int type)
          In the case with an invalid page ID this function checks to see if the client has requested the available ApplicationHandlers.
 ApplicationManager getApplicationManager()
          Returns the parent application manager for this object.
 void run()
          This function handles the connection requirements for the specified incoming connection.
protected  void sendHandlersPacket(java.net.Socket socket, java.lang.String username, java.lang.String password, int type)
           
 void setApplicationManager(ApplicationManager manager)
          Sets the parent application manager for this object.
 
Methods inherited from class amber.server.manager.handler.BaseHandler
connectToClient, sendPacket, setCore, setLogger
 
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
 
Methods inherited from interface amber.server.manager.handler.HandlerInterface
connectToClient, setCore, setLogger
 

Constructor Detail

Application

public Application()
Method Detail

setApplicationManager

public void setApplicationManager(ApplicationManager manager)
Sets the parent application manager for this object.
Parameters:
manager - ApplicationManager which is the parent manager.

getApplicationManager

public ApplicationManager getApplicationManager()
Returns the parent application manager for this object.
Returns:
ApplicationManager which is the parent manager.

run

public void run()
This function handles the connection requirements for the specified incoming connection. This is a one-shot thread which terminates once connection is complete. In this case the connection is from an application based system. The required variables have been set in the prior connectToClient function.
Overrides:
run in class java.lang.Thread

clientRequestedHandlers

protected boolean clientRequestedHandlers(java.net.Socket socket,
                                          Packet initPacket,
                                          AmberInputStream dd,
                                          int type)
                                   throws java.io.IOException
In the case with an invalid page ID this function checks to see if the client has requested the available ApplicationHandlers. In this case the server sends the available handlers in a return packet.
Parameters:
socket - Socket connection to the original requester.
initPacket - Packet containing the original requesting packet.
dd - AmberInputStream containing the encoded packet data.
type - The type of connection that is attempting to match the packet. This matches the constants in ListenerThread.
Returns:
boolean true if the client validly requested the handlers else false.
Throws:
java.io.IOException - containing decoding errors.

sendHandlersPacket

protected void sendHandlersPacket(java.net.Socket socket,
                                  java.lang.String username,
                                  java.lang.String password,
                                  int type)


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.