public class DefaultVertx extends 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. |
Context |
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
|
EventBus |
eventBus()
The event bus
|
FileSystem |
fileSystem()
The File system object
|
java.util.concurrent.Executor |
getAcceptorPool() |
java.util.concurrent.ExecutorService |
getBackgroundPool() |
Context |
getOrAssignContext() |
org.jboss.netty.util.HashedWheelTimer |
getTimer() |
org.jboss.netty.channel.socket.nio.NioWorkerPool |
getWorkerPool() |
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 |
runOnLoop(Handler<java.lang.Void> handler)
Put the handler on the event queue for this loop so it will be run asynchronously ASAP after this event has
been processed
|
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() |
Context |
startInBackground(java.lang.Runnable runnable) |
Context |
startOnEventLoop(java.lang.Runnable runnable) |
public DefaultVertx()
public DefaultVertx(java.lang.String hostname)
public DefaultVertx(int port,
java.lang.String hostname)
public NetServer createNetServer()
VertxcreateNetServer in class Vertxpublic NetClient createNetClient()
VertxcreateNetClient in class Vertxpublic FileSystem fileSystem()
VertxfileSystem in class Vertxpublic SharedData sharedData()
VertxsharedData in class Vertxpublic HttpServer createHttpServer()
VertxcreateHttpServer in class Vertxpublic HttpClient createHttpClient()
VertxcreateHttpClient in class Vertxpublic SockJSServer createSockJSServer(HttpServer httpServer)
VertxcreateSockJSServer in class Vertxpublic Context startOnEventLoop(java.lang.Runnable runnable)
startOnEventLoop in class VertxInternalpublic Context startInBackground(java.lang.Runnable runnable)
startInBackground in class VertxInternalpublic boolean isEventLoop()
VertxisEventLoop in class 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 class 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 runOnLoop(Handler<java.lang.Void> handler)
Vertxpublic java.util.concurrent.ExecutorService getBackgroundPool()
getBackgroundPool in class VertxInternalpublic org.jboss.netty.channel.socket.nio.NioWorkerPool getWorkerPool()
public java.util.concurrent.Executor getAcceptorPool()
getAcceptorPool in class VertxInternalpublic Context getOrAssignContext()
getOrAssignContext in class VertxInternalpublic void reportException(java.lang.Throwable t)
reportException in class VertxInternalpublic java.util.Map<ServerID,DefaultHttpServer> sharedHttpServers()
sharedHttpServers in class VertxInternalpublic java.util.Map<ServerID,DefaultNetServer> sharedNetServers()
sharedNetServers in class VertxInternalpublic org.jboss.netty.util.HashedWheelTimer getTimer()
getTimer in class VertxInternalpublic boolean cancelTimer(long id)
Vertxid. Returns true if the timer was successfully cancelled, or
false if the timer does not exist.cancelTimer in class Vertxpublic Context createEventLoopContext()