com.objectwave.customClassLoader.cclp
Class CclpURLConnection

java.lang.Object
  |
  +--java.net.URLConnection
        |
        +--com.objectwave.customClassLoader.cclp.CclpURLConnection

public class CclpURLConnection
extends java.net.URLConnection

My new URL protocol CCLP is handled by this connection.


Field Summary
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
CclpURLConnection(java.net.URL url)
           
 
Method Summary
 void connect()
          When we 'connect' we locate the CustomClassLoader for which we are going to retrieve data.
 java.lang.Object getContent()
          Get the content...beware, not all objects are serializable.
 java.io.InputStream getInputStream()
           
static void registerClassLoader(int id, MultiClassLoader loader)
          The host of a CCLP URL is going to be the hashcode of the CustomClassLoader that should process the URL request.
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CclpURLConnection

public CclpURLConnection(java.net.URL url)
Method Detail

connect

public void connect()
             throws java.io.IOException
When we 'connect' we locate the CustomClassLoader for which we are going to retrieve data.

Specified by:
connect in class java.net.URLConnection
java.io.IOException

getContent

public java.lang.Object getContent()
                            throws java.io.IOException
Get the content...beware, not all objects are serializable. Now that may not be an issue for your needs, but if you are sending the results over a socket connection it may be better to use getInputStream().

Overrides:
getContent in class java.net.URLConnection
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Overrides:
getInputStream in class java.net.URLConnection
Returns:
The resource reference by the URL as an InputStream.
java.io.IOException

registerClassLoader

public static void registerClassLoader(int id,
                                       MultiClassLoader loader)
The host of a CCLP URL is going to be the hashcode of the CustomClassLoader that should process the URL request.