org.jetlang.remote.acceptor

## Class JetlangClientHandler

- java.lang.Object
- - org.jetlang.remote.acceptor.JetlangClientHandler

All Implemented Interfaces:
  Acceptor.ClientHandler, ClientPublisher

    public class JetlangClientHandler
    extends Object
    implements Acceptor.ClientHandler, ClientPublisher

### Nested Class Summary

Nested Classes
`static interface` `JetlangClientHandler.FiberFactory`

### Constructor Summary

Constructors
Constructor and Description
`JetlangClientHandler(SerializerAdapter ser, NewSessionHandler channels, Executor exec, JetlangSessionConfig config, JetlangClientHandler.FiberFactory fiberFactory, ErrorHandler errorHandler)`
`JetlangClientHandler(SerializerFactory fact, NewSessionHandler channels, Executor exec, JetlangSessionConfig config, JetlangClientHandler.FiberFactory fiberFactory, ErrorHandler errorHandler)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `clientCount()`
`void` `close()`
`void` `enqueueToAllSubscribedClients(String topic, byte[] data)` Places the serialized bytes into the send q's for all subscribed clients.
`void` `publishToAllSubscribedClients(String topic, Object msg)` Publishes asynchronously on a separate global fiber, so be careful of message ordering when using with other fibers/threads.
`void` `startClient(Socket socket)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JetlangClientHandler

    public JetlangClientHandler(SerializerFactory fact,
                                NewSessionHandler channels,
                                Executor exec,
                                JetlangSessionConfig config,
                                JetlangClientHandler.FiberFactory fiberFactory,
                                ErrorHandler errorHandler)

#### JetlangClientHandler

    public JetlangClientHandler(SerializerAdapter ser,
                                NewSessionHandler channels,
                                Executor exec,
                                JetlangSessionConfig config,
                                JetlangClientHandler.FiberFactory fiberFactory,
                                ErrorHandler errorHandler)

### Method Detail

#### startClient

    public void startClient(Socket socket)

Specified by:
  `startClient` in interface `Acceptor.ClientHandler`

#### close

    public void close()

Specified by:
  `close` in interface `Acceptor.ClientHandler`

#### clientCount

    public int clientCount()

#### publishToAllSubscribedClients

    public void publishToAllSubscribedClients(String topic,
                                              Object msg)

Publishes asynchronously on a separate global fiber, so be careful of message ordering when using with other fibers/threads. Serialization and enqueueing are done on a separate fiber.

Specified by:
  `publishToAllSubscribedClients` in interface `ClientPublisher`

#### enqueueToAllSubscribedClients

    public void enqueueToAllSubscribedClients(String topic,
                                              byte[] data)

Places the serialized bytes into the send q's for all subscribed clients. Subscriptions are made on another thread so it is possible that this will enqueue a message to a client that hasn't been handled in a new session callback.