org.restlet.engine

## Class ServerHelper

- java.lang.Object
- - org.restlet.engine.Helper
  - - org.restlet.engine.RestletHelper<T>
    - - org.restlet.engine.ConnectorHelper<Server>
      - - org.restlet.engine.ServerHelper

Direct Known Subclasses:
  HttpServerHelper, RiapServerHelper

    public class ServerHelper
    extends ConnectorHelper<Server>

Server connector helper.

Author:
  Jerome Louvel

### Constructor Summary

Constructors
Constructor and Description
`ServerHelper(Server server)` Constructor.

### Method Summary

Methods
`void` `handle(Request request, Response response)` Handles a call by invoking the helped Server's `Server.handle(Request, Response)` method.
`void` `setEphemeralPort(int localPort)` Sets the ephemeral port in the attributes map if necessary.
`void` `setEphemeralPort(java.net.ServerSocket socket)` Sets the ephemeral port in the attributes map if necessary.
`void` `stop()` Stop callback.

### Methods inherited from class org.restlet.engine.ConnectorHelper

`getConnectorService, getContext, getProtocols, start, update`

### Methods inherited from class org.restlet.engine.RestletHelper

`getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped`

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

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

### Constructor Detail

#### ServerHelper

    public ServerHelper(Server server)

Constructor.

Parameters:
  `server` - The client to help.

### Method Detail

#### handle

    public void handle(Request request,
              Response response)

Handles a call by invoking the helped Server's `Server.handle(Request, Response)` method.

Overrides:
  `handle` in class `RestletHelper<Server>`
Parameters:
  `request` - The request to handle.
  `response` - The response to update.

#### setEphemeralPort

    public void setEphemeralPort(int localPort)

Sets the ephemeral port in the attributes map if necessary.

Parameters:
  `localPort` - The ephemeral local port.

#### setEphemeralPort

    public void setEphemeralPort(java.net.ServerSocket socket)

Sets the ephemeral port in the attributes map if necessary.

Parameters:
  `socket` - The bound server socket.

#### stop

    public void stop()
              throws java.lang.Exception

Description copied from class: `RestletHelper`
Stop callback.

Overrides:
  `stop` in class `ConnectorHelper<Server>`
Throws:
  `java.lang.Exception`