RemoteReceiverClient that writes serialized logging events to an
OutputStream.
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final OutputStream | |
| private BlockingQueue | |
| private final Socket |
| Access | Constructor and Description |
|---|---|
| public | RemoteReceiverStreamClient(String
identifier string for the client id, Socket socket to which logging events will be written socket)Constructs a new client. |
| pack-priv | RemoteReceiverStreamClient(String
identifier string for the client id, OutputStream output stream to which logging Events will be written outputStream)Constructs a new client. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements ch. |
| private ObjectOutputStream | |
| public boolean | offer(Serializable
the subject event event)Implements ch. |
| public void | |
| public void | setQueue(BlockingQueue<Serializable>
the queue to set queue)Implements ch. |
| clientId | back to summary |
|---|---|
| private final String clientId | |
| outputStream | back to summary |
|---|---|
| private final OutputStream outputStream | |
| queue | back to summary |
|---|---|
| private BlockingQueue<Serializable> queue | |
| socket | back to summary |
|---|---|
| private final Socket socket | |
| RemoteReceiverStreamClient | back to summary |
|---|---|
| public RemoteReceiverStreamClient(String id, Socket socket) Constructs a new client. | |
| RemoteReceiverStreamClient | back to summary |
|---|---|
| pack-priv RemoteReceiverStreamClient(String id, OutputStream outputStream) Constructs a new client. This constructor exists primarily to support unit tests where it is inconvenient to have to create a socket for the test.
| |
| close | back to summary |
|---|---|
| public void close() Implements ch. Doc from ch. Closes any resources that are held by the client.
Note that (as described in Doug Lea's discussion about interrupting I/O
operations in "Concurrent Programming in Java" - Addison-Wesley Professional,
2nd edition, 1999) this method is used to interrupt any blocked I/O operation
in the client when the server is shutting down. The client implementation
must anticipate this potential, and gracefully exit when the blocked I/O
operation throws the relevant
Note also, that unlike | |
| createObjectOutputStream | back to summary |
|---|---|
| private ObjectOutputStream createObjectOutputStream() throws IOException | |
| offer | back to summary |
|---|---|
| public boolean offer(Serializable event) Implements ch. Doc from ch. Offers an event to the client.
| |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation. | |
| setQueue | back to summary |
|---|---|
| public void setQueue(BlockingQueue<Serializable> queue) Implements ch. Doc from ch. Sets the client's event queue.
This method must be invoked before the
| |