Java源码示例:org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer

示例1
private void start() throws IOException {

        port = findFreePort();

        server = new TJWSEmbeddedJaxrsServer();
        server.setPort(port);
        server.setBindAddress(bindAddress);
        server.setSecurityDomain(securityDomain);

        for (Object object : objects) {
            if (object instanceof Application) {
                server.getDeployment().setApplication((Application) object);
            } else {
                server.getDeployment().getResources().add(object);
            }
        }

        for (Class resourceOrProvider : classes) {

            if (Application.class.isAssignableFrom(resourceOrProvider)) {
                server.getDeployment().setApplicationClass(resourceOrProvider.getName());
            } else {
                server.getDeployment().getProviderClasses().add(resourceOrProvider.getName());
            }
        }

        server.start();
    }
 
示例2
@BeforeClass
public static void startServer() throws IOException, NoSuchFieldException, IllegalAccessException,
        NoSuchMethodException, InvocationTargetException {
    bypassProActiveLogger();
    preventProActiveToChangeSecurityManager();
    server = new TJWSEmbeddedJaxrsServer();
    silentServerError();

    port = findFreePort();
    server.setPort(port);
    server.setRootResourcePath("/");
    server.start();
}
 
示例3
public TJWSEmbeddedJaxrsServer getJaxrsServer() {
   return tjws;
}
 
示例4
TJWSEmbeddedJaxrsServer getJaxrsServer() {
   return tjws;
}