edu.ucsb.cs.jicos.services.external.services
Class Collector

java.lang.Object
  extended by java.lang.Thread
      extended by edu.ucsb.cs.jicos.services.external.services.Collector
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
CollectorHttp, CollectorSoap

public abstract class Collector
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.lang.String host
          Name of this host.
protected  edu.ucsb.cs.jicos.services.ClientToHsp hsp
          Host Service Provider for this collector to use.
protected  int port
          Port that this collector is listening.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Collector()
          Default, no argument, constructor.
Collector(edu.ucsb.cs.jicos.services.ClientToHsp hsp)
          Create a collector associated with a particular HSP.
Collector(edu.ucsb.cs.jicos.services.ClientToHsp hsp, int port)
          Create a collector associated with a particular HSP and port.
 
Method Summary
 java.lang.String getHost()
          Return the name of this host.
 java.lang.String getHostPort()
          Return a useful combination of hostname and port.
 edu.ucsb.cs.jicos.services.ClientToHsp getHsp()
          Get the HSP this collector is associated with.
 int getPort()
          Get the port being listened on by this collector.
abstract  void run()
          Force sub-classes to implement this method.
 void setHost(java.lang.String host)
          Set the name of this host (for the purposes of the collector).
 void setHsp(edu.ucsb.cs.jicos.services.ClientToHsp hsp)
          Set the HSP to associate with.
 void setPort(int port)
          Set the port to listen to.
 
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

hsp

protected edu.ucsb.cs.jicos.services.ClientToHsp hsp
Host Service Provider for this collector to use.


port

protected int port
Port that this collector is listening.


host

protected java.lang.String host
Name of this host.

Constructor Detail

Collector

public Collector()
Default, no argument, constructor.


Collector

public Collector(edu.ucsb.cs.jicos.services.ClientToHsp hsp)
Create a collector associated with a particular HSP.

Parameters:
hsp - The specific HSP to use to send external requests.

Collector

public Collector(edu.ucsb.cs.jicos.services.ClientToHsp hsp,
                 int port)
Create a collector associated with a particular HSP and port.

Parameters:
hsp - The specific HSP to use to send external requests.
port - The TCP/UDP port being listened on.
Method Detail

getHsp

public edu.ucsb.cs.jicos.services.ClientToHsp getHsp()
Get the HSP this collector is associated with.

Returns:
A Hosting Service Provider (HSP).

getPort

public int getPort()
Get the port being listened on by this collector.

Returns:
bound port number.

getHost

public java.lang.String getHost()
Return the name of this host.

Returns:
This host name.

getHostPort

public java.lang.String getHostPort()
Return a useful combination of hostname and port.

Returns:
The "hostname:port"

setHsp

public void setHsp(edu.ucsb.cs.jicos.services.ClientToHsp hsp)
Set the HSP to associate with.

Parameters:
hsp - The HSP.

setPort

public void setPort(int port)
Set the port to listen to.

Parameters:
port - The port.

setHost

public void setHost(java.lang.String host)
Set the name of this host (for the purposes of the collector).

Parameters:
host - Host name.

run

public abstract void run()
Force sub-classes to implement this method.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread


Jicos: http://cs.ucsb.edu/projects/jicos