CADI.Proxy
Class Proxy

java.lang.Object
  extended by CADI.Proxy.Proxy

public class Proxy
extends java.lang.Object

Version:
1.0 2009/08/22
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
private  CADILog log
          It is an object that will be used to log the server process
private  boolean logEnabled
          Indicates whether the log is enabled or disabled.
private  java.lang.String logFile
          It is the file name where the server logs are stored.
private  int numOfWorkers
          Indicates the number of threads of the Worker that will be running.
private  int[] ports
          Ports where the server is listening to the client requests.
private  ProxyCacheLogicalTargets proxyCachelogicalTargets
          Is the proxy's cache where the logical targets will be cached.
private  ProxyMutex proxyMutex
           
private  ProxyPrefetching proxyPrefetching
           
private  int proxyType
          Indicates the type of proxy that will be used.
private  ProxyRequestedWOIs requestedWOIs
           
private  RequestListener[] requestListenersPool
          This thread pool will listen to in a port to receive client requests.
private  RequestQueue requestQueue
          It is a queue where the client request are stored.
private  ProxyWorker[] workersPool
          This thread pool will process the client requests and will send the server responses to the client.
private  boolean XMLLogFormat
          Indicates whether the log information is stored in XML format or simple text format.
 
Constructor Summary
Proxy(int[] ports, int numOfWorkers, boolean logEnabled, int logLevel, java.lang.String logFile, boolean XMLLogFormat)
          Constructor.
 
Method Summary
private  void launchListeners()
          This method creates and launches the proxy listeners.
private  void launchProxyPrefetching()
           
private  void launchProxyWorkers()
          This method creates and launches the proxy workers.
 void list(java.io.PrintStream out)
          Prints this Proxy out to the specified output stream.
 void run()
           
 void setProxyType(int proxyType)
          Sets the proxyType attribute.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ports

private int[] ports
Ports where the server is listening to the client requests.


numOfWorkers

private int numOfWorkers
Indicates the number of threads of the Worker that will be running.


logFile

private java.lang.String logFile
It is the file name where the server logs are stored.


XMLLogFormat

private boolean XMLLogFormat
Indicates whether the log information is stored in XML format or simple text format.


logEnabled

private boolean logEnabled
Indicates whether the log is enabled or disabled.


proxyType

private int proxyType
Indicates the type of proxy that will be used.

Further information, see ProxyDefaultValues.PROXY_TYPE.


requestListenersPool

private RequestListener[] requestListenersPool
This thread pool will listen to in a port to receive client requests.


requestQueue

private RequestQueue requestQueue
It is a queue where the client request are stored. This queue is shared memory between the daemon which stored the client requests and the RequestDispatcher which gets them to process.


workersPool

private ProxyWorker[] workersPool
This thread pool will process the client requests and will send the server responses to the client.


proxyPrefetching

private ProxyPrefetching proxyPrefetching

requestedWOIs

private ProxyRequestedWOIs requestedWOIs

log

private CADILog log
It is an object that will be used to log the server process


proxyCachelogicalTargets

private ProxyCacheLogicalTargets proxyCachelogicalTargets
Is the proxy's cache where the logical targets will be cached.


proxyMutex

private ProxyMutex proxyMutex
Constructor Detail

Proxy

public Proxy(int[] ports,
             int numOfWorkers,
             boolean logEnabled,
             int logLevel,
             java.lang.String logFile,
             boolean XMLLogFormat)
Constructor.

Parameters:
ports -
numOfWorkers -
logEnabled -
logLevel -
logFile -
XMLLogFormat -
Method Detail

setProxyType

public void setProxyType(int proxyType)
Sets the proxyType attribute.

Parameters:
proxyType - definition in proxyType.

run

public void run()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

list

public void list(java.io.PrintStream out)
Prints this Proxy out to the specified output stream. This method is useful for debugging.

Parameters:
out - an output stream.

launchListeners

private void launchListeners()
                      throws ErrorException
This method creates and launches the proxy listeners.

Throws:
ErrorException

launchProxyWorkers

private void launchProxyWorkers()
This method creates and launches the proxy workers.


launchProxyPrefetching

private void launchProxyPrefetching()


CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Group on Interactive Coding of Images (GICI) (contact)