public class Client extends Connector
RestletHelper instance that is used by this client to handle the
calls via the "org.restlet.engine.helper" attribute stored in the
Context object.| Constructor and Description |
|---|
Client(Context context,
java.util.List<Protocol> protocols)
Constructor.
|
Client(Context context,
java.util.List<Protocol> protocols,
java.lang.String helperClass)
Constructor.
|
Client(Context context,
Protocol protocol)
Constructor.
|
Client(java.util.List<Protocol> protocols)
Constructor.
|
Client(Protocol protocol)
Constructor.
|
Client(java.lang.String protocolName)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
handle(Request request,
Response response)
Handles a call.
|
boolean |
isAvailable()
Indicates the underlying connector helper is available.
|
void |
start()
Starts the Restlet.
|
void |
stop()
Stops the Restlet.
|
getProtocols, setProtocolscreateFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwnerpublic Client(Context context, java.util.List<Protocol> protocols)
context - The context.protocols - The connector protocols.public Client(Context context, java.util.List<Protocol> protocols, java.lang.String helperClass)
context - The context.protocols - The connector protocols.helperClass - Optional helper class name.public Client(Context context, Protocol protocol)
context - The context.protocol - The connector protocol.public Client(java.util.List<Protocol> protocols)
protocols - The connector protocols.public Client(Protocol protocol)
protocol - The connector protocol.public Client(java.lang.String protocolName)
protocolName - The connector protocol.public void handle(Request request, Response response)
RestletContext.setCurrent(Context)
method and by attempting to start it, unless it was already started. If
an exception is thrown during the start action, then the response status
is set to Status.SERVER_ERROR_INTERNAL.
Subclasses overriding this method should make sure that they call super.handle(request, response) before adding their own logic.
public boolean isAvailable()
isAvailable in class Connectorpublic void start()
throws java.lang.Exception
Restletpublic void stop()
throws java.lang.Exception
RestletCopyright © 2005-2024 Restlet.