Codota Logo
SocketFactory
Code IndexAdd Codota to your IDE (free)

How to use
SocketFactory
in
jrds.starter

Best Java code snippets using jrds.starter.SocketFactory (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: fbacchella/jrds

  @Override
  public Socket createSocket(HttpContext context) throws IOException {
    return ss.createSocket();
  }
};
origin: fbacchella/jrds

/**
 * @return the timeout
 */
public int getTimeout() {
  return getLevel().getTimeout();
}
origin: fbacchella/jrds

public Socket createSocket(String host, int port) throws IOException {
  if(!isStarted())
    return null;
  Socket s = getSocket();
  s.connect(new InetSocketAddress(host, port), getTimeout());
  return s;
}
origin: fbacchella/jrds

public Socket createSocket() throws IOException {
  if(!isStarted())
    return null;
  return getSocket();
}
origin: fbacchella/jrds

public ServerSocket createServerSocket(int port) throws IOException {
  if(!isStarted())
    return null;
  ServerSocket s = new ServerSocket(port) {
    /*
     * (non-Javadoc)
     * 
     * @see java.net.ServerSocket#accept()
     */
    @Override
    public Socket accept() throws IOException {
      Socket accepted = super.accept();
      accepted.setTcpNoDelay(true);
      return accepted;
    }
  };
  s.setSoTimeout(getTimeout() * 1000);
  return s;
}
origin: fbacchella/jrds

try {
  SocketFactory ss = find(SocketFactory.class);
  if(!ss.isStarted())
    return null;
  s = ss.createSocket(this, port);
} catch (Exception e) {
  log(Level.ERROR, e, "Connect error %s", e);
origin: fbacchella/jrds

  @Override
  public void connect(SocketAddress endpoint, int timeout) throws IOException {
    super.connect(endpoint, getTimeout() * 1000);
  }
};
origin: fbacchella/jrds

private HostStarter addConnection(Starter cnx) throws IOException {
  String truststore = getClass().getClassLoader().getResource("localhost.jks").getFile();
  PropertiesManager pm = Tools.makePm(testFolder, "timeout=1", "collectorThreads=1",
      "ssl.protocol=TLS", "ssl.strict=true", "ssl.truststore=" + truststore, "ssl.trustpassword=123456");
  HostStarter localhost = new HostStarter(new HostInfo("localhost"));
  Timer t = Tools.getDefaultTimer();
  localhost.setParent(t);
  localhost.getHost().setHostDir(testFolder.getRoot());
  t.registerStarter(new SSLStarter());
  t.registerStarter(new SocketFactory());
  t.configureStarters(pm);
  localhost.registerStarter(cnx);
  cnx.configure(pm);
  return localhost;
}
origin: fbacchella/jrds

@Override
public boolean isStarted(Object key) {
  return super.isStarted(key) && find(XmlProvider.class).isStarted() && find(SocketFactory.class).isStarted();
}
origin: fbacchella/jrds

public void connect(SocketAddress endpoint) throws IOException {
  super.connect(endpoint, getTimeout() * 1000);
}
origin: fbacchella/jrds

@SuppressWarnings("unused")
private void doTest(String proto, int port) throws Exception {
  mbi = new JrdsMBeanInfo(proto, "localhost", port);
  HostStarter host = new HostStarter(new HostInfo("localhost")) {
    public boolean isCollectRunning() {
      return true;
    }
  };
  host.setTimeout(1);
  JMXConnection cnx = getCnx(proto, port);
  host.registerStarter(new SocketFactory());
  host.registerStarter(new JmxSocketFactory());
  host.registerStarter(cnx);
  host.configureStarters(new PropertiesManager());
  host.startCollect();
  Assert.assertTrue("JMX Connection failed to start", cnx.isStarted());
  Assert.assertNotNull("Failed to read uptime", cnx.setUptime());
  if(false)
    enumerate((NativeJmxSource)cnx.getConnection());
}
origin: fbacchella/jrds

public Socket createSocket(StarterNode host, int port) throws IOException {
  if(!isStarted())
    return null;
  Resolver r = host.find(Resolver.class);
  if(r == null || !r.isStarted())
    return null;
  Socket s = getSocket();
  s.connect(new InetSocketAddress(r.getInetAddress(), port), getTimeout());
  return s;
}
origin: fbacchella/jrds

public JrdsSocketConnection(String host, int port, SocketFactory sf) throws IOException {
  super(sf.createSocket(host, port));
  this.host = host;
  this.port = port;
}
origin: fbacchella/jrds

private Socket getSocket() throws SocketException {
  Socket s = new Socket() {
    public void connect(SocketAddress endpoint) throws IOException {
      super.connect(endpoint, getTimeout() * 1000);
    }
    @Override
    public void connect(SocketAddress endpoint, int timeout) throws IOException {
      super.connect(endpoint, getTimeout() * 1000);
    }
  };
  s.setSoTimeout(getTimeout() * 1000);
  s.setTcpNoDelay(true);
  return s;
}
origin: fbacchella/jrds

@Override
public boolean startConnection() {
  SocketFactory ss = getLevel().find(SocketFactory.class);
  channel = new SocketChannels();
  try {
    channel.muninsSocket = ss.createSocket(getHostName(), port);
    channel.out = new PrintWriter(channel.muninsSocket.getOutputStream(), true);
    channel.in = new BufferedReader(new InputStreamReader(channel.muninsSocket.getInputStream()));
  } catch (IOException e) {
    log(Level.ERROR, e, "Connection error", e.getMessage());
    return false;
  }
  return true;
}
origin: fbacchella/jrds

Socket makeSocket(String host, int port) throws IOException {
  SocketFactory sf = getLevel().find(SocketFactory.class);
  return sf.createSocket(host, port);
}
origin: fbacchella/jrds

public Socket connect(String host, int port) throws NoSuchAlgorithmException, KeyManagementException, IOException {
  SocketFactory ss = getLevel().find(SocketFactory.class);
  Socket s = ss.createSocket(host, port);
  SSLSocketFactory ssf = getContext().getSocketFactory();
  s = ssf.createSocket(s, host, port, true);
  log(Level.DEBUG, "done SSL handshake for %s", host);
  return s;
}
origin: fbacchella/jrds

private Socket connect() throws NoSuchAlgorithmException, KeyManagementException, IOException {
  if(port == 23) {
    SocketFactory ss = find(SocketFactory.class);
    return ss.createSocket(iloHost, port);
  } else {
    return find(SSLStarter.class).connect(iloHost, port);
  }
}
origin: fbacchella/jrds

  public Socket createSocket(String host, int port) throws IOException {
    log(Level.DEBUG, "creating a RMI socket to %s:%d", host, port);
    return getLevel().find(SocketFactory.class).createSocket(host, port);
  }
}
origin: fbacchella/jrds

public Socket createSocket(String host, int port) throws IOException {
  log(Level.DEBUG, "creating a RMI socket to %s:%d", host, port);
  return getLevel().find(SocketFactory.class).createSocket(host, port);
}
jrds.starterSocketFactory

Most used methods

  • <init>
  • createSocket
  • getLevel
  • getSocket
  • getTimeout
  • isStarted

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JTable (javax.swing)
  • JTextField (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now