Package javax.net

Examples of javax.net.ServerSocketFactory


            next.start();

            ServerSocket serverSocket;
            try {
                if (secure) {
                    ServerSocketFactory factory = SSLServerSocketFactory.getDefault();
                    serverSocket = factory.createServerSocket(port, backlog, address);
                    final String[] enabledCipherSuites = { "SSL_DH_anon_WITH_RC4_128_MD5" };
                    ((SSLServerSocket) serverSocket).setEnabledCipherSuites(enabledCipherSuites);
                } else {
                    serverSocket = new ServerSocket(port, backlog, address);
                }
View Full Code Here


               // Need to set the MBeanServer to use since there is no direct way to do it.
               setProperty(protocolHandler, "locator", getLocator().getLocatorURI());
               RemotingSSLImplementation.setMBeanServer(getLocator().getLocatorURI(), getMBeanServer());

               ServerSocketFactory svrSocketFactory = getServerSocketFactory();
               if(svrSocketFactory != null)
               {
                  RemotingServerSocketFactory.setServerSocketFactory(getLocator().getLocatorURI(), svrSocketFactory);
                  setProperty(protocolHandler, "SocketFactory", RemotingServerSocketFactory.class.getName());
               }
View Full Code Here

   protected ServerSocket createServerSocket(int serverBindPort,
                                             final int backlog,
                                             InetAddress bindAddress) throws IOException
   {
      ServerSocketFactory factory = getServerSocketFactory();
      ServerSocket ss = null;
     
      try
      {
         ss = factory.createServerSocket();
      }
      catch (SocketException e)
      {
         if (getReuseAddress())
            log.warn("Unable to create unbound ServerSocket: cannot set reuseAddress to true",e);
         ss = factory.createServerSocket(serverBindPort, backlog, bindAddress);
         configureServerSocket(ss);
         return ss;
      }
     
      ss.setReuseAddress(getReuseAddress());
View Full Code Here

      return ss;
   }
  
   protected void createServerSockets() throws IOException
   {
      ServerSocketFactory factory = getServerSocketFactory();

      Iterator it = getHomes().iterator();
      while (it.hasNext())
      {
         Home home = (Home) it.next();
         InetAddress inetAddress = getAddressByName(home.host);
        
         ServerSocket ss = null;
         try
         {
            ss = factory.createServerSocket();
            ss.setReuseAddress(getReuseAddress());
            configureServerSocket(ss);
            InetSocketAddress address = new InetSocketAddress(inetAddress, home.port);
            bind(ss, address, backlog);
            if (log.isDebugEnabled()) log.debug(this + " created " + ss);
         }
         catch (SocketException e)
         {
            if (getReuseAddress())
               log.warn("Unable to create unbound ServerSocket: cannot set reuseAddress to true");

            try
            {
               ss = factory.createServerSocket(home.port, backlog, inetAddress);
               configureServerSocket(ss);
            }
            catch (IOException e2)
            {
               String m = this + " error creating ServerSocket[" + home + "]: " + e2.getMessage();
View Full Code Here

               // Need to set the MBeanServer to use since there is no direct way to do it.
               setProperty(protocolHandler, "locator", getLocator().getLocatorURI());
               RemotingSSLImplementation.setMBeanServer(getLocator().getLocatorURI(), getMBeanServer());

               ServerSocketFactory svrSocketFactory = getServerSocketFactory();
               if(svrSocketFactory != null)
               {
                  RemotingServerSocketFactory.setServerSocketFactory(getLocator().getLocatorURI(), svrSocketFactory);
                  setProperty(protocolHandler, "SocketFactory", RemotingServerSocketFactory.class.getName());
               }
View Full Code Here

                     
    // Create the right kind of socket
    switch (getSSLMode()) {
    case SSL_OFF:
    default:
      ServerSocketFactory sf =
        ServerSocketFactory.getDefault();
      return sf.createServerSocket(portNumber
                     ,0,
                     hostAddress);
    case SSL_BASIC:
      SSLServerSocketFactory ssf =
        (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
View Full Code Here

    */
   public ServerSocketFactory createSSLServerSocketFactory()
         throws IOException, NoSuchAlgorithmException, KeyStoreException,
                CertificateException, UnrecoverableKeyException, KeyManagementException
   {
      ServerSocketFactory ssf = null;

      if(useSSLServerSocketFactory)
      {
         ssf = SSLServerSocketFactory.getDefault();
      }
View Full Code Here

    */
   private ServerSocketFactory createCustomServerSocketFactory()
         throws NoSuchAlgorithmException, KeyStoreException, IOException,
                CertificateException, UnrecoverableKeyException, KeyManagementException
   {
      ServerSocketFactory ssf = null;

      SSLContext sslContext = SSLContext.getInstance(secureSocketProtocol);
      KeyManagerFactory keyMgrFactory = getKeyManagerFactory();

      KeyManager[] keyManagers = keyMgrFactory.getKeyManagers();
View Full Code Here

            // Need to set the MBeanServer to use since there is no direct way to do it.
            setProperty(protocolHandler, "locator", getLocator().getLocatorURI());
            RemotingSSLImplementation.setMBeanServer(getLocator().getLocatorURI(), getMBeanServer());

            ServerSocketFactory svrSocketFactory = getServerSocketFactory();
            if(svrSocketFactory != null)
            {
               RemotingServerSocketFactory.setServerSocketFactory(getLocator().getLocatorURI(), svrSocketFactory);
               setProperty(protocolHandler, "SocketFactory", RemotingServerSocketFactory.class.getName());
            }
View Full Code Here

    class MockBroker extends Thread {
       
        public void run() {
           
            List<Socket> inProgress = new ArrayList<Socket>();
            ServerSocketFactory factory = ServerSocketFactory.getDefault();
            ServerSocket ss = null;
           
            try {
                ss = factory.createServerSocket(61616);
               
                while (!interrupted()) {
                    inProgress.add(ss.accept());    // eat socket
                }
            } catch (Exception e) {
View Full Code Here

TOP

Related Classes of javax.net.ServerSocketFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.