com.jproxy.proxy.httpserver
Class ClassServer
java.lang.Object
|
+--com.jproxy.proxy.httpserver.ClassServer
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- ClassFileServer
- public abstract class ClassServer
- extends java.lang.Object
- implements java.lang.Runnable
The ClassServer class that supports Dynamic Class Dounloading and
recognizes special HTTP request for triggering polling.
Method Summary |
abstract byte[] |
getBytes(java.lang.String path)
Returns an array of bytes containing the bytecodes for
the class represented by the argument path. |
boolean |
isRunning()
|
void |
run()
The "listen" thread that accepts a connection to the
server, parses the header to obtain the class file name
and sends back the bytecodes for the class (or error
if the class is not found or the response was malformed). |
void |
setCallbackClient(CallbackClient cc)
Sets CallbackClient handler to trigger polling |
void |
start()
Starts a ClassServer that listens on port and |
void |
stop()
Stopss a ClassServer |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
callbackClient
public CallbackClient callbackClient
getBytes
public abstract byte[] getBytes(java.lang.String path)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Returns an array of bytes containing the bytecodes for
the class represented by the argument path.
The path is a dot separated class name with
the ".class" extension removed.
- Returns:
- the bytecodes for the class
- Throws:
java.lang.ClassNotFoundException
- if the class corresponding
to path could not be loaded.java.io.IOException
- if error occurs reading the class
isRunning
public boolean isRunning()
start
public void start()
throws java.io.IOException
- Starts a ClassServer that listens on port and
- Throws:
java.io.IOException
- if the ClassServer could not listen
on port.
stop
public void stop()
- Stopss a ClassServer
setCallbackClient
public void setCallbackClient(CallbackClient cc)
- Sets CallbackClient handler to trigger polling
- Parameters:
cc
- CallbackClint handler to trigger polling
run
public void run()
- The "listen" thread that accepts a connection to the
server, parses the header to obtain the class file name
and sends back the bytecodes for the class (or error
if the class is not found or the response was malformed).
- Specified by:
run
in interface java.lang.Runnable
Copyright © JProxy LLC. All Rights Reserved.