当前位置: 首页>>代码示例>>Java>>正文


Java SecurityDomain类代码示例

本文整理汇总了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();
}
 
开发者ID:FroMage,项目名称:redpipe,代码行数:8,代码来源:VertxPluginRequestHandler.java

示例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);

}
 
开发者ID:sdcuike,项目名称:dubbo-rpc-rest,代码行数:42,代码来源:RestProtocolTest.java

示例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;
}
 
开发者ID:mp911de,项目名称:rest-api-test,代码行数:16,代码来源:InMemoryRestServer.java

示例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();

}
 
开发者ID:buzzxu,项目名称:resteasy-netty-guice,代码行数:11,代码来源:NettyBootstrap.java

示例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;
}
 
开发者ID:FroMage,项目名称:redpipe,代码行数:6,代码来源:PluginRequestDispatcher.java

示例6: setSecurityDomain

import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
@Override
public void setSecurityDomain(SecurityDomain sc) {
    this.domain = sc;
}
 
开发者ID:tiglabs,项目名称:jsf-sdk,代码行数:5,代码来源:NettyJaxrsServer.java

示例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();

}
 
开发者ID:sdcuike,项目名称:book-reading,代码行数:71,代码来源:DubboDemoClient2Version.java

示例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();

}
 
开发者ID:sdcuike,项目名称:book-reading,代码行数:59,代码来源:DubboDemoClient.java

示例9: withDefaults

import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
private void withDefaults(SecurityDomain securityDomain) {
    this.securityDomain = securityDomain;
    this.resteasyClient = new ResteasyClientBuilder().build();
}
 
开发者ID:mp911de,项目名称:rest-api-test,代码行数:5,代码来源:InMemoryRestServer.java

示例10: setSecurityDomain

import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
@Override
public void setSecurityDomain(SecurityDomain sc)
{
   this.domain = sc;
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:6,代码来源:NettyJaxrsServer.java

示例11: GuiceRequestDispatcher

import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
public GuiceRequestDispatcher(SynchronousDispatcher dispatcher, ResteasyProviderFactory providerFactory, SecurityDomain domain) {
    super(dispatcher, providerFactory, domain);
}
 
开发者ID:buzzxu,项目名称:resteasy-netty-guice,代码行数:4,代码来源:GuiceRequestDispatcher.java

示例12: CDIRequestDispatcher

import org.jboss.resteasy.plugins.server.embedded.SecurityDomain; //导入依赖的package包/类
public CDIRequestDispatcher(SynchronousDispatcher dispatcher, ResteasyProviderFactory providerFactory,
                            SecurityDomain domain) {
    super(dispatcher,providerFactory,domain);
}
 
开发者ID:johnament,项目名称:resteasy-netty-cdi,代码行数:5,代码来源:CDIRequestDispatcher.java


注:本文中的org.jboss.resteasy.plugins.server.embedded.SecurityDomain类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。