com.sun.jini.tool
Class ClassServer.Task

java.lang.Object
  extended by java.lang.Thread
      extended by com.sun.jini.tool.ClassServer.Task
All Implemented Interfaces:
Runnable
Enclosing class:
ClassServer

private class ClassServer.Task
extends Thread

Simple daemon task thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  Socket sock
          Socket for the incoming request
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ClassServer.Task(Socket sock)
          Simple constructor
 
Method Summary
private  String canon(String path)
          Canonicalize the path
private  byte[] getBytes(InputStream in, long length)
          Read specified number of bytes and always close the stream.
private  byte[] getBytes(String path)
          Return the bytes of the requested file, or null if not found.
 void run()
          Process the request
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sock

private Socket sock
Socket for the incoming request

Constructor Detail

ClassServer.Task

public ClassServer.Task(Socket sock)
Simple constructor

Method Detail

getBytes

private byte[] getBytes(InputStream in,
                        long length)
                 throws IOException
Read specified number of bytes and always close the stream.

Throws:
IOException

canon

private String canon(String path)
Canonicalize the path


getBytes

private byte[] getBytes(String path)
                 throws IOException
Return the bytes of the requested file, or null if not found.

Throws:
IOException

run

public void run()
Process the request

Specified by:
run in interface Runnable
Overrides:
run in class Thread


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.