コード例 #1
0
 @Override
 protected boolean tearDownServer(boolean force) {
   if (select == null || !select.isRunning()) {
     return true;
   }
   select.stopEndpoint();
   return !select.isRunning();
 }
コード例 #2
0
 @Override
 protected void setupServer(ClassLoader classLoader) {
   SelectorThread select = selectorThread(adapter(classLoader));
   try {
     select.start();
   } catch (Exception e) {
     throw new RemotingException(this + " failed to start", e);
   }
 }
コード例 #3
0
 private SelectorThread newSelector(GrizzlyAdapter adapter) {
   SelectorThread selectorThread = new SelectorThread();
   Location location = getLocation();
   if (location != null) {
     selectorThread.setInet(location.toInetAddress());
     selectorThread.setPort(location.getPort());
   }
   selectorThread.setKeepAliveTimeoutInSeconds(keepAliveSeconds);
   selectorThread.setCoreThreads(coreThreads);
   selectorThread.setMaxThreads(maxThreads);
   selectorThread.setAdapter(adapter);
   try {
     selectorThread.initEndpoint();
   } catch (Exception e) {
     throw new RemotingException(
         this
             + " failed to set up selector thread "
             + selectorThread
             + " against "
             + adapter
             + "!",
         e);
   }
   return selectorThread;
 }
コード例 #4
0
 private int getLowLevelPort() {
   try {
     return select.getPortLowLevel();
   } catch (Exception e) {
     log.warn(this + " failed to get low level port from " + select + ", using 0", e);
     return 0;
   }
 }
コード例 #5
0
ファイル: BaseTest.java プロジェクト: pgier/narayana
  @AfterClass
  public static void afterClass() throws Exception {
    if (server != null) {
      server.stop();
      server = null;
    }

    if (threadSelector != null) {
      threadSelector.stopEndpoint();
      threadSelector = null;
    }
  }
コード例 #6
0
 @AfterClass
 public static void stopServer() throws Exception {
   selectorThread.stopEndpoint();
 }
コード例 #7
0
 static {
   SelectorThread.setWebAppRootPath(root().getAbsolutePath());
 }
コード例 #8
0
 private String getHostName() {
   InetAddress address = select.getAddress();
   return address == null ? LOCALHOST : address.getHostName();
 }