本文整理汇总了Java中io.undertow.client.UndertowClient类的典型用法代码示例。如果您正苦于以下问题:Java UndertowClient类的具体用法?Java UndertowClient怎么用?Java UndertowClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UndertowClient类属于io.undertow.client包,在下文中一共展示了UndertowClient类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ProxyConnectionPool
import io.undertow.client.UndertowClient; //导入依赖的package包/类
public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, InetSocketAddress bindAddress,URI uri, XnioSsl ssl, UndertowClient client, OptionMap options) {
this.connectionPoolManager = connectionPoolManager;
this.maxConnections = Math.max(connectionPoolManager.getMaxConnections(), 1);
this.maxCachedConnections = Math.max(connectionPoolManager.getMaxCachedConnections(), 0);
this.sMaxConnections = Math.max(connectionPoolManager.getSMaxConnections(), 0);
this.maxRequestQueueSize = Math.max(connectionPoolManager.getMaxQueueSize(), 0);
this.ttl = connectionPoolManager.getTtl();
this.bindAddress = bindAddress;
this.uri = uri;
this.ssl = ssl;
this.client = client;
this.options = options;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:ProxyConnectionPool.java
示例2: MultiAppProxyClient
import io.undertow.client.UndertowClient; //导入依赖的package包/类
public MultiAppProxyClient(BouncrConfiguration config, KeyValueStore store, RealmCache realmCache, JsonWebToken jwt) {
client = UndertowClient.getInstance();
this.config = config;
this.store = store;
this.realmCache = realmCache;
this.jwt = jwt;
this.jwtHeader = builder(new JwtHeader())
.set(JwtHeader::setAlg, "none")
.build();
}
开发者ID:kawasima,项目名称:bouncr,代码行数:11,代码来源:MultiAppProxyClient.java
示例3: UndertowXhrTransport
import io.undertow.client.UndertowClient; //导入依赖的package包/类
public UndertowXhrTransport(OptionMap optionMap) throws IOException {
Assert.notNull(optionMap, "OptionMap is required");
this.optionMap = optionMap;
this.httpClient = UndertowClient.getInstance();
this.worker = Xnio.getInstance().createWorker(optionMap);
this.undertowBufferSupport =
(undertow13Present ? new Undertow13BufferSupport() : new UndertowXnioBufferSupport());
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:UndertowXhrTransport.java
示例4: UndertowXnioBufferSupport
import io.undertow.client.UndertowClient; //导入依赖的package包/类
public UndertowXnioBufferSupport() {
this.xnioBufferPool = new org.xnio.ByteBufferSlicePool(1048, 1048);
this.httpClientConnectCallbackMethod = ReflectionUtils.findMethod(UndertowClient.class, "connect",
ClientCallback.class, URI.class, XnioWorker.class, Pool.class, OptionMap.class);
this.httpClientConnectMethod = ReflectionUtils.findMethod(UndertowClient.class, "connect",
URI.class, XnioWorker.class, Pool.class, OptionMap.class);
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:UndertowXhrTransport.java
示例5: httpClientConnect
import io.undertow.client.UndertowClient; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public IoFuture<ClientConnection> httpClientConnect(UndertowClient httpClient, URI uri,
XnioWorker worker, OptionMap options) {
return (IoFuture<ClientConnection>) ReflectionUtils.invokeMethod(httpClientConnectMethod, httpClient, uri,
worker, this.xnioBufferPool, options);
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:UndertowXhrTransport.java
示例6: Undertow13BufferSupport
import io.undertow.client.UndertowClient; //导入依赖的package包/类
public Undertow13BufferSupport() {
this.undertowBufferPool = new DefaultByteBufferPool(false, 1024, -1, 2);
this.httpClientConnectCallbackMethod = ReflectionUtils.findMethod(UndertowClient.class, "connect",
ClientCallback.class, URI.class, XnioWorker.class, ByteBufferPool.class, OptionMap.class);
this.httpClientConnectMethod = ReflectionUtils.findMethod(UndertowClient.class, "connect",
URI.class, XnioWorker.class, ByteBufferPool.class, OptionMap.class);
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:UndertowXhrTransport.java
示例7: ConnectionFactory
import io.undertow.client.UndertowClient; //导入依赖的package包/类
private ConnectionFactory(URI kubernetesMasterUri) {
this.kubernetesMasterUri = kubernetesMasterUri;
undertowClient = UndertowClient.getInstance();
Xnio xnio = Xnio.getInstance(Undertow.class.getClassLoader());
try {
ssl = new UndertowXnioSsl(xnio, OptionMap.EMPTY);
} catch (Exception e) {
throw new RuntimeException(e);
}
byteBufferPool = createByteBufferPool();
}
开发者ID:hawkular,项目名称:hawkular-metrics,代码行数:12,代码来源:TokenAuthenticator.java
示例8: main
import io.undertow.client.UndertowClient; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
final OptionMap options = OptionMap.builder()
.set(WORKER_IO_THREADS, 8)
.set(TCP_NODELAY, true)
.set(KEEP_ALIVE, true)
.set(WORKER_NAME, "Client")
.getMap();
final Xnio xnio = Xnio.getInstance();
final XnioWorker worker = xnio.createWorker(null, options);
final UndertowClient client = UndertowClient.getInstance();
final URI serverAddress = new URI(SERVER_URL);
final ClientConnection connection = client.connect(serverAddress, worker, new ByteBufferSlicePool(1024, 1024), EMPTY).get();
final CountDownLatch latch = new CountDownLatch(1);
try {
connection.getIoThread().execute(new Runnable() {
@Override
public void run() {
final ClientRequest request = new ClientRequest().setMethod(GET).setPath("/");
request.getRequestHeaders().add(UPGRADE, HORNETQ_REMOTING);
String secretKey = HandshakeUtil.createSecretKey();
request.getRequestHeaders().add(HttpString.tryFromString(HandshakeUtil.SEC_HORNETQ_REMOTING_KEY), secretKey);
connection.sendRequest(request, createClientCallback(latch, secretKey));
}
});
latch.await(10, TimeUnit.MINUTES);
if (connection.isUpgraded()) {
StreamConnection streamConnection = connection.performUpgrade();
switchToHornetQProtocol(streamConnection);
}
} finally {
IoUtils.safeClose(connection);
worker.shutdown();
}
}
开发者ID:jmesnil,项目名称:hornetq-undertow-client,代码行数:38,代码来源:Client.java
示例9: SimpleProxyClientProvider
import io.undertow.client.UndertowClient; //导入依赖的package包/类
public SimpleProxyClientProvider(URI uri) {
this.uri = uri;
client = UndertowClient.getInstance();
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SimpleProxyClientProvider.java
示例10: LoadBalancingProxyClient
import io.undertow.client.UndertowClient; //导入依赖的package包/类
public LoadBalancingProxyClient() {
this(UndertowClient.getInstance());
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:LoadBalancingProxyClient.java
示例11: getHttpClient
import io.undertow.client.UndertowClient; //导入依赖的package包/类
/**
* Return Undertow's native HTTP client
*/
public UndertowClient getHttpClient() {
return this.httpClient;
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:7,代码来源:UndertowXhrTransport.java
示例12: process
import io.undertow.client.UndertowClient; //导入依赖的package包/类
@Override
public boolean process(Exchange exchange, AsyncCallback callback) {
ClientConnection connection = null;
try {
final UndertowClient client = UndertowClient.getInstance();
IoFuture<ClientConnection> connect = client.connect(endpoint.getHttpURI(), worker, pool, options);
// creating the url to use takes 2-steps
String url = UndertowHelper.createURL(exchange, getEndpoint());
URI uri = UndertowHelper.createURI(exchange, url, getEndpoint());
// get the url from the uri
url = uri.toASCIIString();
// what http method to use
HttpString method = UndertowHelper.createMethod(exchange, endpoint, exchange.getIn().getBody() != null);
ClientRequest request = new ClientRequest();
request.setProtocol(Protocols.HTTP_1_1);
request.setPath(url);
request.setMethod(method);
Object body = getRequestBody(request, exchange);
TypeConverter tc = endpoint.getCamelContext().getTypeConverter();
ByteBuffer bodyAsByte = tc.tryConvertTo(ByteBuffer.class, body);
if (body != null) {
request.getRequestHeaders().put(Headers.CONTENT_LENGTH, bodyAsByte.array().length);
}
if (LOG.isDebugEnabled()) {
LOG.debug("Executing http {} method: {}", method, url);
}
connection = connect.get();
connection.sendRequest(request, new UndertowProducerCallback(connection, bodyAsByte, exchange, callback));
} catch (Exception e) {
IOHelper.close(connection);
exchange.setException(e);
callback.done(true);
return true;
}
// use async routing engine
return false;
}
开发者ID:HydAu,项目名称:Camel,代码行数:49,代码来源:UndertowProducer.java
示例13: TokenReplacingProxyHandler
import io.undertow.client.UndertowClient; //导入依赖的package包/类
public TokenReplacingProxyHandler() {
client = UndertowClient.getInstance();
}
开发者ID:jpkrohling,项目名称:secret-store,代码行数:4,代码来源:TokenReplacingProxyHandler.java
注:本文中的io.undertow.client.UndertowClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论