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.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()
Vertx
createNetServer
in class Vertx
public NetClient createNetClient()
Vertx
createNetClient
in class Vertx
public FileSystem fileSystem()
Vertx
fileSystem
in class Vertx
public SharedData sharedData()
Vertx
sharedData
in class Vertx
public HttpServer createHttpServer()
Vertx
createHttpServer
in class Vertx
public HttpClient createHttpClient()
Vertx
createHttpClient
in class Vertx
public SockJSServer createSockJSServer(HttpServer httpServer)
Vertx
createSockJSServer
in class Vertx
public Context startOnEventLoop(java.lang.Runnable runnable)
startOnEventLoop
in class VertxInternal
public Context startInBackground(java.lang.Runnable runnable)
startInBackground
in class VertxInternal
public boolean isEventLoop()
Vertx
isEventLoop
in class Vertx
public boolean isWorker()
Vertx
public long setPeriodic(long delay, Handler<java.lang.Long> handler)
Vertx
delay
milliseconds, at which point handler
will be called with
the id of the timer.setPeriodic
in class Vertx
public long setTimer(long delay, Handler<java.lang.Long> handler)
Vertx
delay
milliseconds, at which point handler
will be called with
the id of the timer.public void runOnLoop(Handler<java.lang.Void> handler)
Vertx
public java.util.concurrent.ExecutorService getBackgroundPool()
getBackgroundPool
in class VertxInternal
public org.jboss.netty.channel.socket.nio.NioWorkerPool getWorkerPool()
public java.util.concurrent.Executor getAcceptorPool()
getAcceptorPool
in class VertxInternal
public Context getOrAssignContext()
getOrAssignContext
in class VertxInternal
public void reportException(java.lang.Throwable t)
reportException
in class VertxInternal
public java.util.Map<ServerID,DefaultHttpServer> sharedHttpServers()
sharedHttpServers
in class VertxInternal
public java.util.Map<ServerID,DefaultNetServer> sharedNetServers()
sharedNetServers
in class VertxInternal
public boolean cancelTimer(long id)
Vertx
id
. Returns
true if the timer was successfully cancelled, or
false
if the timer does not exist.cancelTimer
in class Vertx
public Context createEventLoopContext()