|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.hq.transport.util.InputStreamServiceImpl
public class InputStreamServiceImpl
The input stream service implementation that resides on the remote source
from which a RemoteInputStream
reads its data.
It is expected that the remote source will retrieve a remote stream instance,
send it to the remote client, and then, within a single thread, the remote
source write the buffers to the remote stream until the end of stream is signaled.
To prevent an excessive amount of buffered data from residing in main memory
(on the source or client), buffer writes and reads are serialized such that
only one buffer of data may be stored at any time in the remote source and
the remote client.
Field Summary | |
---|---|
static int |
DEFAULT_INPUTSTREAM_TIMEOUT
The default remote input stream timeout (60 seconds). |
static java.lang.String |
INPUTSTREAM_TIMEOUT
The system property key for the remote input stream timeout (in seconds). |
Method Summary | |
---|---|
static InputStreamServiceImpl |
getInstance()
|
StreamBuffer |
getNextBuffer(java.lang.String streamId)
Retrieve the next buffer of data for the RemoteInputStream |
RemoteInputStream |
getRemoteStream()
Retrieve the remote stream to send to the remote client. |
void |
signalEndOfRemoteStream(java.lang.String streamId)
Signal that the end of stream has been reached for a given remote stream. |
void |
writeBufferToRemoteStream(java.lang.String streamId,
byte[] buffer)
Write a buffer to the remote stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String INPUTSTREAM_TIMEOUT
public static final int DEFAULT_INPUTSTREAM_TIMEOUT
Method Detail |
---|
public static InputStreamServiceImpl getInstance()
public StreamBuffer getNextBuffer(java.lang.String streamId) throws java.io.IOException
InputStreamService
RemoteInputStream
getNextBuffer
in interface InputStreamService
streamId
- The remote input stream id.
java.io.IOException
- if there is no remote stream registered for the given stream id
or if there is no buffered data available to be read.InputStreamService.getNextBuffer(java.lang.String)
public RemoteInputStream getRemoteStream()
public void writeBufferToRemoteStream(java.lang.String streamId, byte[] buffer) throws java.lang.InterruptedException, java.io.IOException
streamId
- The remote input stream id.buffer
- The buffer to write to the remote stream.
java.io.IOException
- if there is no remote stream registered for the given stream id
or if the DEFAULT_INPUTSTREAM_TIMEOUT
is reached.
java.lang.NullPointerException
- if the buffer is null
.
java.lang.IllegalArgumentException
- if the buffer is empty.
java.lang.InterruptedException
public void signalEndOfRemoteStream(java.lang.String streamId) throws java.lang.InterruptedException, java.io.IOException
streamId
- The remote input stream id.
java.io.IOException
- if there is no remote stream registered for the given stream id
or if the DEFAULT_INPUTSTREAM_TIMEOUT
is reached.
java.lang.InterruptedException
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |