|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimple.http.Pipeline
public class Pipeline
This is a Pipeline
object that is used to represent
a HTTP Pipeline
. This contains methods that allow
attributes to be associated with a Pipeline
. It is
implements the Attributes
interface which allows
objects to be stored with the Pipeline
.
This implements a close that allows the Pipeline
to
be closed. This ensures that both objects are closed i.e. both
the InputStream
and the OutputStream
will be closed after the close
method is invoked.
Field Summary | |
---|---|
protected java.net.Socket |
sock
This is the socket that provides the input and output. |
protected java.util.Hashtable |
table
This is used to store properties for this connection. |
Constructor Summary | |
---|---|
protected |
Pipeline()
This constructor allows the Pipeline to be extended
in such a way that it does not involve ant initialization of the
Pipeline itself. |
|
Pipeline(java.net.Socket sock)
This creates a Pipeline from a Socket
object. |
Method Summary | |
---|---|
void |
close()
This is a close method that ensures the communication link is shutdown. |
boolean |
contains(java.lang.String name)
This can be used to determine if an attribute of a given name is present int the attribute object. |
java.lang.Object |
get(java.lang.String name)
This will retrieve an attribute from this attributes class. |
java.net.InetAddress |
getInetAddress()
This corresponds to the identity of the host that created the connection. |
java.io.InputStream |
getInputStream()
Retrieves the InputStream . |
java.io.OutputStream |
getOutputStream()
Retrieves the OutputStream . |
java.util.Set |
keySet()
This will provide an Set object for attribute
names for this pipeline object. |
void |
put(java.lang.String name,
java.lang.Object obj)
This can be used to set an attribute. |
void |
remove(java.lang.String name)
This removes the attribute from this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Hashtable table
protected java.net.Socket sock
Constructor Detail |
---|
protected Pipeline()
Pipeline
to be extended
in such a way that it does not involve ant initialization of the
Pipeline
itself. This is used if there is no need
for a Socket
or Hashtable
reference.
This is used by FilterPipeline
.
public Pipeline(java.net.Socket sock) throws java.io.IOException
Pipeline
from a Socket
object. Any sub classes of the Pipeline
object may
use this constructor to ensure that all the data is initialized
for the Pipeline
.
sock
- the Socket
that contains the streams
java.io.IOException
- if the object could not be createdMethod Detail |
---|
public java.io.InputStream getInputStream() throws java.io.IOException
InputStream
. This is a communication
channel between the client and the server. The stream returned
is the same as the Socket.getInputStream
.
InputStream
from the client, i.e. the
Pipeline
java.io.IOException
- thrown if there is an I/O problem.public java.io.OutputStream getOutputStream() throws java.io.IOException
OutputStream
. This is a communication
channel from the server to the client. The stream returned is
the same as the Socket.getOuputStream
.
OutputStream
to the client, i.e. the
Pipeline
java.io.IOException
- thrown if there is an I/O problempublic java.net.InetAddress getInetAddress()
public java.lang.Object get(java.lang.String name)
get
in interface Attributes
name
- the name of the attribute to be retrieved
public boolean contains(java.lang.String name)
contains
in interface Attributes
name
- the name of the attribute the is being queried
public void remove(java.lang.String name)
Set
of the names returned to become stale.
remove
in interface Attributes
name
- the name of the attribute to be removedpublic void put(java.lang.String name, java.lang.Object obj)
Set
of the attribute names that was retrieved.
put
in interface Attributes
name
- the name of the attribute that is being addedobj
- the value of the attribute that is being addedpublic java.util.Set keySet()
Set
object for attribute
names for this pipeline object. This may not update if there
are concurrent remove and set operations when this is used.
keySet
in interface Attributes
public void close()
InputStream
and the
OutputStream
of the Socket
. This
method will not propagate any exceptions.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |