Connect.connect
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.openejb.util.Connect.connect(Showing top 6 results out of 315)

origin: org.apache.openejb/openejb-server

public boolean start() {
  if (!connect()) {
    forkServerProcess();
    final int port = SystemInstance.get().getOptions().get("ejbd.port", 4201);
    return Connect.connect(10, "localhost", port);
  } else {
    System.out.println(":: server already started ::");
    return true;
  }
}
origin: org.apache.tomee/openejb-server

public static boolean connect() {
  final int port = SystemInstance.get().getOptions().get("ejbd.port", 4201);
  return Connect.connect(1, "localhost", port);
}
origin: org.apache.tomee/openejb-core

public static boolean connect(int tries, final String host, final int port) {
  Socket s = null;
  try {
    s = new Socket(host, port);
    s.getOutputStream().close();
  } catch (final Exception e) {
    if (tries < 2) {
      return false;
    } else {
      try {
        Thread.sleep(2000);
      } catch (final Exception e2) {
        e.printStackTrace();
      }
      return connect(--tries, host, port);
    }
  } finally {
    if (s != null) {
      try {
        s.close();
      } catch (final Throwable e) {
        //Ignore
      }
    }
  }
  return true;
}
origin: org.apache.tomee/openejb-server

public boolean start() {
  if (!connect()) {
    forkServerProcess();
    final int port = SystemInstance.get().getOptions().get("ejbd.port", 4201);
    return Connect.connect(10, "localhost", port);
  } else {
    System.out.println(":: server already started ::");
    return true;
  }
}
origin: org.apache.openejb/openejb-server

public static boolean connect() {
  final int port = SystemInstance.get().getOptions().get("ejbd.port", 4201);
  return Connect.connect(1, "localhost", port);
}
origin: org.apache.openejb/openejb-core

public static boolean connect(int tries, final String host, final int port) {
  Socket s = null;
  try {
    s = new Socket(host, port);
    s.getOutputStream().close();
  } catch (final Exception e) {
    if (tries < 2) {
      return false;
    } else {
      try {
        Thread.sleep(2000);
      } catch (final Exception e2) {
        e.printStackTrace();
      }
      return connect(--tries, host, port);
    }
  } finally {
    if (s != null) {
      try {
        s.close();
      } catch (final Throwable e) {
        //Ignore
      }
    }
  }
  return true;
}
org.apache.openejb.utilConnectconnect

Popular methods of Connect

    Popular classes and methods

    • requestLocationUpdates (LocationManager)
    • getSupportFragmentManager (FragmentActivity)
    • Table (com.google.common.collect)
      A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
    • Menu (java.awt)
    • String (java.lang)
      An immutable sequence of characters/code units ( chars). A String is represented by array of UTF-16
    • Proxy (java.net)
      This class represents a proxy setting, typically a type (http, socks) and a socket address. A Proxy
    • Map (java.util)
      A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
    • TimeZone (java.util)
      TimeZone represents a time zone, primarily used for configuring a Calendar or java.text.SimpleDateF
    • Reflections (org.reflections)
      Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t

    For IntelliJ IDEA,
    Android Studio or Eclipse

    • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
    • EnterpriseFAQAboutContact Us
    • Terms of usePrivacy policyCodeboxFind Usages
    Add Codota to your IDE (free)