public interface Endpoint<T>
| 限定符和类型 | 方法和说明 |
|---|---|
T |
connectionExceptionHandler(Thread.UncaughtExceptionHandler handler)
What to do when an exception occurs when attempting to read/write data
from/to the underlying connection. e.g.
|
Executor |
getExecutor()
Get main work executor that all handlers will execute on.
|
URI |
getUri()
Get base URI that endpoint is serving on (or connected to).
|
T |
setupSsl(InputStream keyStore,
String pass)
Setup SSL/TLS handler
This is shortcut for
setupSsl(keyStore, pass, pass). |
Future<? extends T> |
start()
Start in background.
|
Future<? extends T> |
stop()
Stop in background.
|
T |
uncaughtExceptionHandler(Thread.UncaughtExceptionHandler handler)
What to do when an exception gets thrown in a handler.
|
Future<? extends T> start()
Future.get() on the returned future.Future<? extends T> stop()
Future.get() on the returned future.T uncaughtExceptionHandler(Thread.UncaughtExceptionHandler handler)
PrintStackTraceExceptionHandler.
It is suggested that apps supply their own implementation (e.g. to log somewhere).T connectionExceptionHandler(Thread.UncaughtExceptionHandler handler)
SilentExceptionHandler
as this is a common thing to happen on a network, and most systems should not care.Executor getExecutor()
URI getUri()
T setupSsl(InputStream keyStore, String pass) throws WebbitException
setupSsl(keyStore, pass, pass).keyStore - Keystore InputStreampass - Store and key passwordWebbitException - A problem loading the keystore#setupSsl(String, String, String)Copyright © 2014. All rights reserved.