public class VertxImpl extends Object implements VertxInternal
Modifier and Type | Method and Description |
---|---|
boolean |
cancelTimer(long id)
Cancel the timer with the specified
id . |
void |
close()
Stop the eventbus and any resource managed by the eventbus.
|
void |
close(Handler<AsyncResult<Void>> completionHandler)
Stop the eventbus and any resource managed by the eventbus.
|
static Context |
context() |
DatagramSocket |
createDatagramSocket(DatagramSocketOptions options) |
DnsClient |
createDnsClient(int port,
String host)
Return the
DnsClient |
EventLoopContext |
createEventLoopContext(String deploymentID,
JsonObject config,
ClassLoader tccl) |
HttpClient |
createHttpClient(HttpClientOptions options)
Create a HTTP/HTTPS client
|
HttpServer |
createHttpServer(HttpServerOptions serverOptions)
Create an HTTP/HTTPS server
|
NetClient |
createNetClient(NetClientOptions options)
Create a TCP/SSL client
|
NetServer |
createNetServer(NetServerOptions options)
Create a TCP/SSL server
|
ContextImpl |
createWorkerContext(boolean multiThreaded,
String deploymentID,
JsonObject config,
ClassLoader tccl) |
Set<String> |
deployments() |
void |
deployVerticle(String identifier) |
void |
deployVerticle(String identifier,
DeploymentOptions options) |
void |
deployVerticle(String identifier,
DeploymentOptions options,
Handler<AsyncResult<String>> completionHandler) |
void |
deployVerticle(String identifier,
Handler<AsyncResult<String>> completionHandler) |
void |
deployVerticle(Verticle verticle) |
void |
deployVerticle(Verticle verticle,
DeploymentOptions options) |
void |
deployVerticle(Verticle verticle,
DeploymentOptions options,
Handler<AsyncResult<String>> completionHandler) |
void |
deployVerticle(Verticle verticle,
Handler<AsyncResult<String>> completionHandler) |
EventBus |
eventBus()
The event bus
|
<T> void |
executeBlocking(Action<T> action,
Handler<AsyncResult<T>> resultHandler) |
<T> void |
executeBlocking(Handler<Future<T>> blockingCodeHandler,
Handler<AsyncResult<T>> asyncResultHandler) |
void |
failDuringFailover(boolean fail) |
void |
failoverCompleteHandler(Handler<Boolean> failoverCompleteHandler) |
FileSystem |
fileSystem()
The File system object
|
ContextImpl |
getContext()
Get the current context
|
Deployment |
getDeployment(String deploymentID) |
io.netty.channel.EventLoopGroup |
getEventLoopGroup() |
protected FileSystem |
getFileSystem() |
String |
getNodeID() |
ContextImpl |
getOrCreateContext()
Gets the current context, or creates one if there isn’t one
|
ExecutorService |
getWorkerPool() |
boolean |
isKilled() |
String |
metricBaseName()
The metric base name
|
Map<String,JsonObject> |
metrics()
Will return the metrics that correspond with this measured object.
|
VertxMetrics |
metricsSPI() |
TimeoutStream |
periodicStream(long delay)
Returns a periodic timer as a read stream.
|
void |
registerVerticleFactory(VerticleFactory factory) |
File |
resolveFile(String fileName) |
void |
runOnContext(Handler<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
|
long |
setPeriodic(long delay,
Handler<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<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
|
Map<ServerID,HttpServerImpl> |
sharedHttpServers() |
Map<ServerID,NetServerImpl> |
sharedNetServers() |
void |
simulateEventBusUnresponsive() |
void |
simulateKill() |
TimeoutStream |
timerStream(long delay)
Returns a one-shot timer as a read stream.
|
void |
undeployVerticle(String deploymentID) |
void |
undeployVerticle(String deploymentID,
Handler<AsyncResult<Void>> completionHandler) |
void |
unregisterVerticleFactory(VerticleFactory factory) |
Set<VerticleFactory> |
verticleFactories() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clusteredVertx, currentContext, vertx, vertx
protected FileSystem getFileSystem()
public DatagramSocket createDatagramSocket(DatagramSocketOptions options)
createDatagramSocket
in interface Vertx
public NetServer createNetServer(NetServerOptions options)
Vertx
Create a TCP/SSL server
createNetServer
in interface Vertx
public NetClient createNetClient(NetClientOptions options)
Vertx
Create a TCP/SSL client
createNetClient
in interface Vertx
public FileSystem fileSystem()
Vertx
The File system object
fileSystem
in interface Vertx
public SharedData sharedData()
Vertx
The shared data object
sharedData
in interface Vertx
public HttpServer createHttpServer(HttpServerOptions serverOptions)
Vertx
Create an HTTP/HTTPS server
createHttpServer
in interface Vertx
public HttpClient createHttpClient(HttpClientOptions options)
Vertx
Create a HTTP/HTTPS client
createHttpClient
in interface Vertx
public long setPeriodic(long delay, Handler<Long> handler)
Vertx
Set a periodic timer to fire every delay
milliseconds, at which point handler
will be called with
the id of the timer.
setPeriodic
in interface Vertx
public TimeoutStream periodicStream(long delay)
Vertx
Returns a periodic timer as a read stream. The timer will be fired every delay
milliseconds after
the ReadStream.handler(io.vertx.core.Handler<T>)
has been called.
periodicStream
in interface Vertx
public long setTimer(long delay, Handler<Long> handler)
Vertx
Set a one-shot timer to fire after delay
milliseconds, at which point handler
will be called with
the id of the timer.
public TimeoutStream timerStream(long delay)
Vertx
Returns a one-shot timer as a read stream. The timer will be fired after delay
milliseconds after
the ReadStream.handler(io.vertx.core.Handler<T>)
has been called.
timerStream
in interface Vertx
public void runOnContext(Handler<Void> task)
Vertx
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
runOnContext
in interface Vertx
public ExecutorService getWorkerPool()
getWorkerPool
in interface VertxInternal
public io.netty.channel.EventLoopGroup getEventLoopGroup()
getEventLoopGroup
in interface VertxInternal
public ContextImpl getOrCreateContext()
Vertx
Gets the current context, or creates one if there isn’t one
getOrCreateContext
in interface VertxInternal
getOrCreateContext
in interface Vertx
public Map<ServerID,HttpServerImpl> sharedHttpServers()
sharedHttpServers
in interface VertxInternal
public Map<ServerID,NetServerImpl> sharedNetServers()
sharedNetServers
in interface VertxInternal
public String metricBaseName()
Measured
The metric base name
metricBaseName
in interface Measured
public Map<String,JsonObject> metrics()
Measured
Will return the metrics that correspond with this measured object.
public boolean cancelTimer(long id)
Vertx
Cancel the timer with the specified id
. Returns true if the timer was successfully cancelled, or
false
if the timer does not exist.
cancelTimer
in interface Vertx
public EventLoopContext createEventLoopContext(String deploymentID, JsonObject config, ClassLoader tccl)
createEventLoopContext
in interface VertxInternal
public DnsClient createDnsClient(int port, String host)
Vertx
Return the DnsClient
createDnsClient
in interface Vertx
public ContextImpl createWorkerContext(boolean multiThreaded, String deploymentID, JsonObject config, ClassLoader tccl)
createWorkerContext
in interface VertxInternal
public static Context context()
public ContextImpl getContext()
VertxInternal
Get the current context
getContext
in interface VertxInternal
public void close()
Vertx
Stop the eventbus and any resource managed by the eventbus.
public void close(Handler<AsyncResult<Void>> completionHandler)
Vertx
Stop the eventbus and any resource managed by the eventbus.
public void deployVerticle(Verticle verticle)
deployVerticle
in interface Vertx
public void deployVerticle(Verticle verticle, Handler<AsyncResult<String>> completionHandler)
deployVerticle
in interface Vertx
public void deployVerticle(String identifier, Handler<AsyncResult<String>> completionHandler)
deployVerticle
in interface Vertx
public void deployVerticle(Verticle verticle, DeploymentOptions options)
deployVerticle
in interface Vertx
public void deployVerticle(Verticle verticle, DeploymentOptions options, Handler<AsyncResult<String>> completionHandler)
deployVerticle
in interface Vertx
public void deployVerticle(String identifier)
deployVerticle
in interface Vertx
public void deployVerticle(String identifier, DeploymentOptions options)
deployVerticle
in interface Vertx
public void deployVerticle(String identifier, DeploymentOptions options, Handler<AsyncResult<String>> completionHandler)
deployVerticle
in interface Vertx
public String getNodeID()
getNodeID
in interface VertxInternal
public void undeployVerticle(String deploymentID)
undeployVerticle
in interface Vertx
public void undeployVerticle(String deploymentID, Handler<AsyncResult<Void>> completionHandler)
undeployVerticle
in interface Vertx
public Set<String> deployments()
deployments
in interface Vertx
public void registerVerticleFactory(VerticleFactory factory)
registerVerticleFactory
in interface Vertx
public void unregisterVerticleFactory(VerticleFactory factory)
unregisterVerticleFactory
in interface Vertx
public Set<VerticleFactory> verticleFactories()
verticleFactories
in interface Vertx
public <T> void executeBlocking(Action<T> action, Handler<AsyncResult<T>> resultHandler)
executeBlocking
in interface VertxSPI
public <T> void executeBlocking(Handler<Future<T>> blockingCodeHandler, Handler<AsyncResult<T>> asyncResultHandler)
executeBlocking
in interface Vertx
public void simulateKill()
simulateKill
in interface VertxInternal
public void simulateEventBusUnresponsive()
simulateEventBusUnresponsive
in interface VertxInternal
public Deployment getDeployment(String deploymentID)
getDeployment
in interface VertxInternal
public void failoverCompleteHandler(Handler<Boolean> failoverCompleteHandler)
failoverCompleteHandler
in interface VertxInternal
public boolean isKilled()
isKilled
in interface VertxInternal
public void failDuringFailover(boolean fail)
failDuringFailover
in interface VertxInternal
public VertxMetrics metricsSPI()
metricsSPI
in interface VertxInternal
public File resolveFile(String fileName)
resolveFile
in interface VertxInternal
Copyright © 2014. All Rights Reserved.