
io.vertx.core.impl.SyncContext Maven / Gradle / Ivy
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.vertx.core.impl;
import java.io.Serial;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import io.netty.channel.EventLoop;
import io.vertx.codegen.annotations.Nullable;
import io.vertx.core.AsyncResult;
import io.vertx.core.Context;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Promise;
import io.vertx.core.ThreadingModel;
import io.vertx.core.json.JsonObject;
import io.vertx.core.spi.tracing.VertxTracer;
/**
* This class is created to make vertx unit test easier
*/
@SuppressWarnings({"rawtypes"})
public class SyncContext extends ContextBase implements ContextInternal {
@Serial
private static final long serialVersionUID = -6209656149925076980L;
protected VertxInternal owner;
protected Executor executor = Executors.newSingleThreadExecutor();
public SyncContext() {
this(0);
}
public SyncContext(int localsLength) {
super(localsLength);
}
@Override
public VertxInternal owner() {
return owner;
}
@Override
public Context exceptionHandler(@Nullable Handler handler) {
return null;
}
@Override
public @Nullable Handler exceptionHandler() {
return null;
}
@Override
public boolean inThread() {
return false;
}
@Override
public void emit(T t, Handler handler) {
}
@Override
public void execute(Runnable runnable) {
}
@Override
public void execute(T t, Handler handler) {
}
@Override
public void reportException(Throwable throwable) {
}
@Override
public ConcurrentMap
© 2015 - 2025 Weber Informatics LLC | Privacy Policy