本文整理汇总了Java中org.jboss.resteasy.plugins.server.embedded.SecurityDomain类的典型用法代码示例。如果您正苦于以下问题:Java SecurityDomain类的具体用法?Java SecurityDomain怎么用?Java SecurityDomain使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecurityDomain类属于org.jboss.resteasy.plugins.server.embedded包,在下文中一共展示了SecurityDomain类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VertxPluginRequestHandler
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
public VertxPluginRequestHandler(Vertx vertx, ResteasyDeployment deployment, String servletMappingPrefix, SecurityDomain domain, List<Plugin> plugins)
{
this.vertx = vertx;
this.dispatcher = new PluginRequestDispatcher((SynchronousDispatcher) deployment.getDispatcher(), deployment.getProviderFactory(), domain, plugins);
this.servletMappingPrefix = servletMappingPrefix;
appGlobals = AppGlobals.get();
}
示例2: test_host_for_LISTEN_ADDRESS
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
/**
* // lsof -i:8990
* // COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
*
* @throws InterruptedException
*/
@Test
public void test_host_for_LISTEN_ADDRESS() throws InterruptedException {
// String hostname = "10.100.0.25";
// String hostname = "127.0.0.1";//java 29782 username 146u IPv6 0x41980098a5e8db51 0t0 TCP localhost:8990 (LISTEN)
// String hostname = "localhost";
String hostname = "0.0.0.0";// java 29827 username 146u IPv6 0x41980098a5e8db51 0t0 TCP *:8990 (LISTEN)
int port = 8990;
SecurityDomain securityDomain = null;
String rootResourcePath = "/";
int ioWorkerCount = Runtime.getRuntime().availableProcessors() * 2;
int executorThreadCount = 12;
NettyJaxrsServer nettyJaxrsServer = new NettyJaxrsServer();
nettyJaxrsServer.setHostname(hostname);
nettyJaxrsServer.setPort(port);
nettyJaxrsServer.setSecurityDomain(securityDomain);
nettyJaxrsServer.setRootResourcePath(rootResourcePath);
nettyJaxrsServer.setIoWorkerCount(ioWorkerCount);
nettyJaxrsServer.setExecutorThreadCount(executorThreadCount);
ResteasyDeployment deployment = nettyJaxrsServer.getDeployment();
List<Object> resources = new ArrayList<Object>();
deployment.setResources(resources);
nettyJaxrsServer.start();
ResourceMethodRegistry resourceMethodRegistry = (ResourceMethodRegistry) deployment.getRegistry();
resourceMethodRegistry.setWiderMatching(true);// 不设置也可以
deployment.getRegistry().addSingletonResource(new RestServiceImpl());
// TimeUnit.MINUTES.sleep(1);
}
示例3: create
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
/**
* Create instance and pass given instances/classes as singletons/proviers.
*
* @param objects
* @return running instance of {@link InMemoryRestServer}
* @throws IOException
*/
public static InMemoryRestServer create(SecurityDomain securityDomain, Object... objects) throws IOException {
InMemoryRestServer inMemoryRestServer = new InMemoryRestServer(objects);
inMemoryRestServer.withDefaults(securityDomain);
inMemoryRestServer.start();
return inMemoryRestServer;
}
示例4: start
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
public void start(SecurityDomain domain){
if(deployment == null){
createDeployment();
}
createInjector();
GuiceNettyJaxrsServer server = this.injector.getInstance(GuiceNettyJaxrsServer.class);
server.setSecurityDomain(domain);
server.start();
}
示例5: PluginRequestDispatcher
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
public PluginRequestDispatcher(SynchronousDispatcher dispatcher, ResteasyProviderFactory providerFactory,
SecurityDomain domain, List<Plugin> plugins) {
super(dispatcher, providerFactory, domain);
this.plugins = plugins;
}
示例6: setSecurityDomain
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
@Override
public void setSecurityDomain(SecurityDomain sc) {
this.domain = sc;
}
示例7: main
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
/**
* @param args
* @throws InterruptedException
*/
public static void main(String[] args) throws InterruptedException {
String hostname = "0.0.0.0";
int port = 8889;
SecurityDomain securityDomain = null;
String rootResourcePath = "/";
int ioWorkerCount = Runtime.getRuntime().availableProcessors() * 2;
int executorThreadCount = 12;
NettyJaxrsServer nettyJaxrsServer = new NettyJaxrsServer();
nettyJaxrsServer.setHostname(hostname);
nettyJaxrsServer.setPort(port);
nettyJaxrsServer.setSecurityDomain(securityDomain);
nettyJaxrsServer.setRootResourcePath(rootResourcePath);
nettyJaxrsServer.setIoWorkerCount(ioWorkerCount);
nettyJaxrsServer.setExecutorThreadCount(executorThreadCount);
Map<ChannelOption, Object> channelOptions = new HashMap<ChannelOption, Object>();
channelOptions.put(ChannelOption.CONNECT_TIMEOUT_MILLIS, 100);
nettyJaxrsServer.setChannelOptions(channelOptions);
nettyJaxrsServer.setChildChannelOptions(channelOptions);
ResteasyDeployment deployment = nettyJaxrsServer.getDeployment();
List<Object> resources = new ArrayList<>();
// dubo 消费远程服务:当前应用配置
ApplicationConfig dubboApp = new ApplicationConfig();
dubboApp.setName("dubboAppClient");
// 注册中心配置
RegistryConfig registryConfig = new RegistryConfig();
registryConfig.setAddress("127.0.0.1:2181");
registryConfig.setProtocol("zookeeper");
registryConfig.setClient("curator");
registryConfig.setGroup("dubbo");
ReferenceConfig<DemoService> demoServiceReferenceConfig1 = new ReferenceConfig<>();
demoServiceReferenceConfig1.setApplication(dubboApp);
demoServiceReferenceConfig1.setRegistry(registryConfig);
demoServiceReferenceConfig1.setInterface(DemoService.class);
demoServiceReferenceConfig1.setVersion("1.0");
demoServiceReferenceConfig1.setCheck(false);
DemoService demoService1 = demoServiceReferenceConfig1.get();
ReferenceConfig<DemoService> demoServiceReferenceConfig2 = new ReferenceConfig<>();
demoServiceReferenceConfig2.setApplication(dubboApp);
demoServiceReferenceConfig2.setRegistry(registryConfig);
demoServiceReferenceConfig2.setInterface(DemoService.class);
demoServiceReferenceConfig2.setVersion("2.0");
demoServiceReferenceConfig2.setCheck(false);
DemoService demoService2 = demoServiceReferenceConfig2.get();
deployment.setResources(resources);
nettyJaxrsServer.start();
// resteasy 暴露服务
deployment.getProviderFactory().register(MyContainerRequestFilter.class);
deployment.getRegistry().addSingletonResource(demoService1, "1.0");
deployment.getRegistry().addSingletonResource(demoService2, "2.0");
// TimeUnit.SECONDS.sleep(6);
// nettyJaxrsServer.stop();
// demoServiceReferenceConfig.destroy();
}
示例8: main
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
/**
* @param args
* @throws InterruptedException
*/
public static void main(String[] args) throws InterruptedException {
String hostname = "0.0.0.0";
int port = 8889;
SecurityDomain securityDomain = null;
String rootResourcePath = "/";
int ioWorkerCount = Runtime.getRuntime().availableProcessors() * 2;
int executorThreadCount = 12;
NettyJaxrsServer nettyJaxrsServer = new NettyJaxrsServer();
nettyJaxrsServer.setHostname(hostname);
nettyJaxrsServer.setPort(port);
nettyJaxrsServer.setSecurityDomain(securityDomain);
nettyJaxrsServer.setRootResourcePath(rootResourcePath);
nettyJaxrsServer.setIoWorkerCount(ioWorkerCount);
nettyJaxrsServer.setExecutorThreadCount(executorThreadCount);
Map<ChannelOption, Object> channelOptions = new HashMap<ChannelOption, Object>();
channelOptions.put(ChannelOption.CONNECT_TIMEOUT_MILLIS, 100);
nettyJaxrsServer.setChannelOptions(channelOptions);
nettyJaxrsServer.setChildChannelOptions(channelOptions);
ResteasyDeployment deployment = nettyJaxrsServer.getDeployment();
List<Object> resources = new ArrayList<>();
// dubo 消费远程服务:当前应用配置
ApplicationConfig dubboApp = new ApplicationConfig();
dubboApp.setName("dubboAppClient");
// 注册中心配置
RegistryConfig registryConfig = new RegistryConfig();
registryConfig.setAddress("127.0.0.1:2181");
registryConfig.setProtocol("zookeeper");
registryConfig.setClient("curator");
registryConfig.setGroup("dubbo");
ReferenceConfig<DemoService> demoServiceReferenceConfig = new ReferenceConfig<>();
demoServiceReferenceConfig.setApplication(dubboApp);
demoServiceReferenceConfig.setRegistry(registryConfig);
demoServiceReferenceConfig.setInterface(DemoService.class);
demoServiceReferenceConfig.setCheck(false);
DemoService demoService = demoServiceReferenceConfig.get();
// resteasy 暴露服务
resources.add(demoService);
deployment.setResources(resources);
nettyJaxrsServer.start();
// TimeUnit.SECONDS.sleep(6);
// nettyJaxrsServer.stop();
// demoServiceReferenceConfig.destroy();
}
示例9: withDefaults
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
private void withDefaults(SecurityDomain securityDomain) {
this.securityDomain = securityDomain;
this.resteasyClient = new ResteasyClientBuilder().build();
}
示例10: setSecurityDomain
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
@Override
public void setSecurityDomain(SecurityDomain sc)
{
this.domain = sc;
}
示例11: GuiceRequestDispatcher
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
public GuiceRequestDispatcher(SynchronousDispatcher dispatcher, ResteasyProviderFactory providerFactory, SecurityDomain domain) {
super(dispatcher, providerFactory, domain);
}
示例12: CDIRequestDispatcher
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
public CDIRequestDispatcher(SynchronousDispatcher dispatcher, ResteasyProviderFactory providerFactory,
SecurityDomain domain) {
super(dispatcher,providerFactory,domain);
}