|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.esw.service.ClassServer
Field Summary | |
protected static java.lang.String |
CLASS_NOT_FOUND
|
protected java.lang.String |
codebase
|
protected static java.lang.String |
CODEBASE_PROPERTY
|
protected static java.lang.String |
COLON
|
protected static java.lang.String |
CONTENT_LENGTH
|
protected static java.lang.String |
CONTENT_TYPE
|
protected static java.lang.String |
CONTENT_TYPE2
|
protected static java.lang.String |
CR
|
protected static java.lang.String |
DOT_CLASS
|
protected static java.lang.String |
END_CONTENT_LENGTH
|
protected static java.lang.String |
GET
|
protected static java.lang.String |
HTTP
|
protected static java.lang.String |
HTTP_START
|
protected java.net.URLClassLoader |
loader
|
protected int |
port
|
protected java.net.ServerSocket |
server
|
protected static java.lang.String |
SLASH
|
protected static java.lang.String |
SPACE
|
Constructor Summary | |
ClassServer()
Creates a new ClassServer utilizing any availiable port. |
|
ClassServer(int aPort)
Creates a new ClassServer utilizing the specified port. |
Method Summary | |
protected void |
establishCodebase()
This adds the codebase for this exporter to the list of codebases stored under the java.rmi.server.codebase property. |
protected byte[] |
getByteArrayFromInputStream(java.io.InputStream inputstream,
int i)
Gets a byte array from an inputStream, one byte at a time. |
protected byte[] |
getByteArrayFromInputStream(java.io.InputStream inputstream,
int i,
int bufferSize)
Gets a byte array from an inputStream, one byte at a time. |
protected byte[] |
getByteCodes(java.lang.String aClassname)
Return the bytecodes for the named class. |
protected byte[] |
getClassFromJarURLs(java.lang.String s)
Attempts to retrieve the requested resource from a jar that's part of the loader list |
protected java.lang.String |
getCodebase()
Return the codebase URL that identifies this exporter. |
protected boolean |
isJarFile(java.lang.String s)
Checks to see if this string indicates a jar file |
void |
run()
Services a socket returned by the server socket |
void |
shutdown()
Shuts down the server socket. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.net.ServerSocket server
protected java.lang.String codebase
protected int port
protected java.net.URLClassLoader loader
protected static final java.lang.String CODEBASE_PROPERTY
protected static final java.lang.String HTTP
protected static final java.lang.String COLON
protected static final java.lang.String SLASH
protected static final java.lang.String SPACE
protected static final java.lang.String HTTP_START
protected static final java.lang.String CONTENT_LENGTH
protected static final java.lang.String END_CONTENT_LENGTH
protected static final java.lang.String CONTENT_TYPE
protected static final java.lang.String CLASS_NOT_FOUND
protected static final java.lang.String CR
protected static final java.lang.String CONTENT_TYPE2
protected static final java.lang.String GET
protected static final java.lang.String DOT_CLASS
Constructor Detail |
public ClassServer() throws java.io.IOException
java.io.IOException
- If there was a problem initializing the
server socket.public ClassServer(int aPort) throws java.io.IOException, java.net.UnknownHostException
aPort
- The port on which to run the server. Passing in 0 states that
any open port may be utilized.java.io.IOException
- If there was a problem initializing the
server socket.java.net.UnknownHostException
- If the current hostname could not
be determined (required for setting the
codebase).Method Detail |
public void shutdown()
public void run()
run
in interface java.lang.Runnable
protected byte[] getByteCodes(java.lang.String aClassname) throws java.lang.ClassNotFoundException
aClassname
- The class to fetch the bytecodes for.java.lang.ClassNotFoundException
- If the named class cannot be found.protected java.lang.String getCodebase() throws java.net.UnknownHostException
java.net.UnknownHostException
- If the local hostname could not
be determined.protected void establishCodebase() throws java.net.UnknownHostException
java.net.UnknownHostException
- If the local hostname could not be
determined.protected byte[] getClassFromJarURLs(java.lang.String s)
String
- The path descriptor of the resourceprotected boolean isJarFile(java.lang.String s)
String
- the name of the resourceprotected byte[] getByteArrayFromInputStream(java.io.InputStream inputstream, int i) throws java.io.IOException
InputStream
- the stream to be read fromint
- the initial size of the buffered output streamjava.io.IOException
- If there is a problem reading from the streamprotected byte[] getByteArrayFromInputStream(java.io.InputStream inputstream, int i, int bufferSize) throws java.io.IOException
InputStream
- the stream to be read fromint
- the initial size of the buffered output streamint
- the number of bytes to read at each passjava.io.IOException
- If there is a problem reading from the stream
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |