Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.net
Class LoadBalancer.SocketHandler

    java.lang.Object
      com.tangosol.util.Base
          com.tangosol.util.Daemon
              com.tangosol.net.LoadBalancer.SocketHandler

All Implemented Interfaces:
  Guardable, java.lang.Runnable

Direct Known Subclasses:
  LoadBalancer.RequestHandler, LoadBalancer.ResponseHandler

Enclosing class:
  LoadBalancer

    public abstract static class LoadBalancer.SocketHandler

extends Daemon

A SocketHandler is an abstract daemon thread.

Nested Class Summary

Nested classes/interfaces inherited from class com.tangosol.util.Daemon
`Daemon.DaemonWorker`

Field Summary
`protected byte[]` | `m_abBuf` The buffer to use for reading from a stream.

Constructor Summary
`LoadBalancer.SocketHandler(java.lang.String sName)` Construct a SocketHandler with a given daemon thread name.

Method Summary
`protected void` | `copy(java.io.InputStream streamIn, java.io.OutputStream streamOut, byte[] abBuf)` Process the transfer of data from one stream to another.
`protected byte[]` | `ensureBuffer(java.net.Socket socket)` Return the existing buffer, if there is one, or create one to use for reading from the passed socket.
`protected void` | `process(java.net.Socket socketIn, java.net.Socket socketOut)` Process the transfer of data from one socket to another.
`abstract void` | `run()` Processing loop for the SocketHandler.

Methods inherited from class com.tangosol.util.Daemon
`changeState, configureWorker, finishStarting, getConfiguredName, getConfiguredPriority, getDescription, getGuardContext, getGuardRegisterAction, getMaxWaitMillis, getState, getThread, getThreadContextClassLoader, getWorker, guardIfNeeded, heartbeat, heartbeat, instantiateWorker, isGuarded, isOnWorkerThread, isRunning, isStopping, recover, setConfiguredName, setConfiguredPriority, setContext, setGuardPolicy, setGuardRegisterAction, setThreadContextClassLoader, start, stop, terminate, toStateString, toString`

Field Detail

### m_abBuf

    protected byte[] m_abBuf

  The buffer to use for reading from a stream.

Constructor Detail

### LoadBalancer.SocketHandler

    public LoadBalancer.SocketHandler(java.lang.String sName)

  Construct a SocketHandler with a given daemon thread name.

Method Detail

### run

    public abstract void run()

  Processing loop for the SocketHandler.

  Specified by:
    `run` in interface `java.lang.Runnable`
  Specified by:
    `run` in class `Daemon`

### process

    protected void process(java.net.Socket socketIn,
                           java.net.Socket socketOut)
                    throws java.io.IOException

  Process the transfer of data from one socket to another.

  Parameters:
    `socketIn` - the socket to read from
    `socketOut` - the socket to write to
  Throws:
    `java.io.IOException`

### copy

    protected void copy(java.io.InputStream streamIn,
                        java.io.OutputStream streamOut,
                        byte[] abBuf)
                 throws java.io.IOException

  Process the transfer of data from one stream to another.

  Parameters:
    `streamIn` - the stream to read from
    `streamOut` - the stream to write to
    `abBuf` - the byte array to use as a buffer to read into and write from
  Throws:
    `java.io.IOException`

### ensureBuffer

    protected byte[] ensureBuffer(java.net.Socket socket)

  Return the existing buffer, if there is one, or create one to use for reading from the passed socket.

  Parameters:
    `socket` - the socket that the buffer will be used to read from
  Returns:
    a byte array to use as a read buffer

Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2010, Oracle. All rights reserved.