本文整理汇总了Java中org.jboss.remoting3.Endpoint.getConnectionProviderInterface方法的典型用法代码示例。如果您正苦于以下问题:Java Endpoint.getConnectionProviderInterface方法的具体用法?Java Endpoint.getConnectionProviderInterface怎么用?Java Endpoint.getConnectionProviderInterface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.remoting3.Endpoint
的用法示例。
在下文中一共展示了Endpoint.getConnectionProviderInterface方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.jboss.remoting3.Endpoint; //导入方法依赖的package包/类
public static ChannelServer create(final Configuration configuration) throws IOException {
if (configuration == null) {
throw new IllegalArgumentException("Null configuration");
}
configuration.validate();
// Hack WFCORE-3302/REM3-303 workaround
if (firstCreate) {
firstCreate = false;
} else {
try {
// wait in case the previous socket has not closed
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
// TODO WFCORE-3302 -- Endpoint.getCurrent() should be ok
final Endpoint endpoint = Endpoint.builder().setEndpointName(configuration.getEndpointName()).build();
final NetworkServerProvider networkServerProvider = endpoint.getConnectionProviderInterface(configuration.getUriScheme(), NetworkServerProvider.class);
final SecurityDomain.Builder domainBuilder = SecurityDomain.builder();
final SimpleMapBackedSecurityRealm realm = new SimpleMapBackedSecurityRealm();
domainBuilder.addRealm("default", realm).build();
domainBuilder.setDefaultRealmName("default");
domainBuilder.setPermissionMapper((permissionMappable, roles) -> PermissionVerifier.ALL);
SecurityDomain testDomain = domainBuilder.build();
SaslAuthenticationFactory saslAuthenticationFactory = SaslAuthenticationFactory.builder()
.setSecurityDomain(testDomain)
.setMechanismConfigurationSelector(mechanismInformation -> "ANONYMOUS".equals(mechanismInformation.getMechanismName()) ? MechanismConfiguration.EMPTY : null)
.setFactory(new AnonymousServerFactory())
.build();
System.out.println(configuration.getBindAddress());
AcceptingChannel<StreamConnection> streamServer = networkServerProvider.createServer(configuration.getBindAddress(), OptionMap.EMPTY, saslAuthenticationFactory, null);
return new ChannelServer(endpoint, null, streamServer);
}
示例2: create
import org.jboss.remoting3.Endpoint; //导入方法依赖的package包/类
public static ChannelServer create(final Configuration configuration) throws IOException {
if (configuration == null) {
throw new IllegalArgumentException("Null configuration");
}
configuration.validate();
// Hack WFCORE-3302/REM3-303 workaround
if (firstCreate) {
firstCreate = false;
} else {
try {
// wait in case the previous socket has not closed
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
// TODO WFCORE-3302 -- Endpoint.getCurrent() should be ok
final Endpoint endpoint = Endpoint.builder().setEndpointName(configuration.getEndpointName()).build();
final NetworkServerProvider networkServerProvider = endpoint.getConnectionProviderInterface(configuration.getUriScheme(), NetworkServerProvider.class);
final SecurityDomain.Builder domainBuilder = SecurityDomain.builder();
final SimpleMapBackedSecurityRealm realm = new SimpleMapBackedSecurityRealm();
realm.setPasswordMap("bob", ClearPassword.createRaw(ClearPassword.ALGORITHM_CLEAR, "pass".toCharArray()));
domainBuilder.addRealm("default", realm).build();
domainBuilder.setDefaultRealmName("default");
domainBuilder.setPermissionMapper((permissionMappable, roles) -> PermissionVerifier.ALL);
SecurityDomain testDomain = domainBuilder.build();
SaslAuthenticationFactory saslAuthenticationFactory = SaslAuthenticationFactory.builder()
.setSecurityDomain(testDomain)
.setMechanismConfigurationSelector(mechanismInformation -> {
switch (mechanismInformation.getMechanismName()) {
case "ANONYMOUS":
case "PLAIN": {
return MechanismConfiguration.EMPTY;
}
default: return null;
}
})
.setFactory(SaslFactories.getElytronSaslServerFactory())
.build();
AcceptingChannel<StreamConnection> streamServer = networkServerProvider.createServer(configuration.getBindAddress(), OptionMap.EMPTY, saslAuthenticationFactory, null);
return new ChannelServer(endpoint, streamServer);
}