public class DefaultVertx extends java.lang.Object implements VertxInternal
| Constructor and Description |
|---|
DefaultVertx() |
DefaultVertx(int port,
java.lang.String hostname) |
DefaultVertx(java.lang.String hostname) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancelTimer(long id)
Cancel the timer with the specified
id. |
EventLoopContext |
createEventLoopContext() |
HttpClient |
createHttpClient()
Create a HTTP/HTTPS client
|
HttpServer |
createHttpServer()
Create an HTTP/HTTPS server
|
NetClient |
createNetClient()
Create a TCP/SSL client
|
NetServer |
createNetServer()
Create a TCP/SSL server
|
SockJSServer |
createSockJSServer(HttpServer httpServer)
Create a SockJS server that wraps an HTTP server
|
Context |
currentContext() |
EventBus |
eventBus()
The event bus
|
FileSystem |
fileSystem()
The File system object
|
java.util.concurrent.ExecutorService |
getBackgroundPool() |
DefaultContext |
getContext()
Get the current context
|
io.netty.channel.EventLoopGroup |
getEventLoopGroup() |
protected FileSystem |
getFileSystem() |
DefaultContext |
getOrCreateContext() |
boolean |
isEventLoop()
Is the current thread an event loop thread?
|
boolean |
isWorker()
Is the current thread an worker thread?
|
void |
reportException(java.lang.Throwable t) |
void |
runOnContext(Handler<java.lang.Void> task)
Put the handler on the event queue for the current loop (or worker context) so it will be run asynchronously ASAP after this event has
been processed
|
void |
setContext(DefaultContext context)
Set the current context
|
long |
setPeriodic(long delay,
Handler<java.lang.Long> handler)
Set a periodic timer to fire every
delay milliseconds, at which point handler will be called with
the id of the timer. |
long |
setTimer(long delay,
Handler<java.lang.Long> handler)
Set a one-shot timer to fire after
delay milliseconds, at which point handler will be called with
the id of the timer. |
SharedData |
sharedData()
The shared data object
|
java.util.Map<ServerID,DefaultHttpServer> |
sharedHttpServers() |
java.util.Map<ServerID,DefaultNetServer> |
sharedNetServers() |
DefaultContext |
startInBackground(java.lang.Runnable runnable,
boolean multiThreaded) |
DefaultContext |
startOnEventLoop(java.lang.Runnable runnable) |
void |
stop()
Stop the eventbus and any resource managed by the eventbus.
|
public DefaultVertx()
public DefaultVertx(java.lang.String hostname)
public DefaultVertx(int port,
java.lang.String hostname)
protected FileSystem getFileSystem()
public NetServer createNetServer()
VertxcreateNetServer in interface Vertxpublic NetClient createNetClient()
VertxcreateNetClient in interface Vertxpublic FileSystem fileSystem()
VertxfileSystem in interface Vertxpublic SharedData sharedData()
VertxsharedData in interface Vertxpublic HttpServer createHttpServer()
VertxcreateHttpServer in interface Vertxpublic HttpClient createHttpClient()
VertxcreateHttpClient in interface Vertxpublic SockJSServer createSockJSServer(HttpServer httpServer)
VertxcreateSockJSServer in interface Vertxpublic DefaultContext startOnEventLoop(java.lang.Runnable runnable)
startOnEventLoop in interface VertxInternalpublic DefaultContext startInBackground(java.lang.Runnable runnable, boolean multiThreaded)
startInBackground in interface VertxInternalpublic boolean isEventLoop()
VertxisEventLoop in interface Vertxpublic boolean isWorker()
Vertxpublic long setPeriodic(long delay,
Handler<java.lang.Long> handler)
Vertxdelay milliseconds, at which point handler will be called with
the id of the timer.setPeriodic in interface Vertxpublic long setTimer(long delay,
Handler<java.lang.Long> handler)
Vertxdelay milliseconds, at which point handler will be called with
the id of the timer.public void runOnContext(Handler<java.lang.Void> task)
VertxrunOnContext in interface Vertxpublic Context currentContext()
currentContext in interface Vertxpublic java.util.concurrent.ExecutorService getBackgroundPool()
getBackgroundPool in interface VertxInternalpublic io.netty.channel.EventLoopGroup getEventLoopGroup()
getEventLoopGroup in interface VertxInternalpublic DefaultContext getOrCreateContext()
getOrCreateContext in interface VertxInternalpublic void reportException(java.lang.Throwable t)
reportException in interface VertxInternalpublic java.util.Map<ServerID,DefaultHttpServer> sharedHttpServers()
sharedHttpServers in interface VertxInternalpublic java.util.Map<ServerID,DefaultNetServer> sharedNetServers()
sharedNetServers in interface VertxInternalpublic boolean cancelTimer(long id)
Vertxid. Returns true if the timer was successfully cancelled, or
false if the timer does not exist.cancelTimer in interface Vertxpublic EventLoopContext createEventLoopContext()
createEventLoopContext in interface VertxInternalpublic void setContext(DefaultContext context)
VertxInternalsetContext in interface VertxInternalpublic DefaultContext getContext()
VertxInternalgetContext in interface VertxInternal