Package javax.net

Examples of javax.net.ServerSocketFactory


    public SimpleSSLSocketFactory() {
        super();
    }
   
    public ServerSocket createServerSocket(int port) throws IOException {
        ServerSocketFactory socketfactory = getSSLContext().getServerSocketFactory();
        return socketfactory.createServerSocket(port);
    }
View Full Code Here


     */
    public TransportServer doBind(String brokerId, final URI location) throws IOException {
        try {
            Map<String, String> options = new HashMap<String, String>(URISupport.parseParamters(location));

            ServerSocketFactory serverSocketFactory = createServerSocketFactory();
            SslTransportServer server = new SslTransportServer(this, location, (SSLServerSocketFactory)serverSocketFactory);
            server.setWireFormatFactory(createWireFormatFactory(options));
            IntrospectionSupport.setProperties(server, options);
            Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport.");
            server.setTransportOption(transportOptions);
View Full Code Here

    public TransportServer doBind(String brokerId, final URI location) throws IOException {
        try {
            Map<String, String> options = new HashMap<String, String>(URISupport.parseParamters(location));

            ServerSocketFactory serverSocketFactory = createServerSocketFactory();
            TcpTransportServer server = createTcpTransportServer(location, serverSocketFactory);
            server.setWireFormatFactory(createWireFormatFactory(options));
            IntrospectionSupport.setProperties(server, options);
            Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport.");
            server.setTransportOption(transportOptions);
View Full Code Here

            System.setProperty("javax.net.ssl.keyStore", path);
            System.setProperty("javax.net.ssl.keyStorePassword", password);
            System.setProperty("javax.net.ssl.trustStore", path);
            System.setProperty("javax.net.ssl.trustStorePassword", password);

            ServerSocketFactory server = SSLServerSocketFactory.getDefault();
            // Let the operating system just choose an available port:
            ServerSocket serverSocket = server.createServerSocket(0);
            serverSocket.setSoTimeout(30000);
            int port = serverSocket.getLocalPort();
            // System.out.println("\nlistening on port: " + port);

            SSLSocketFactory ssf = SSLSocketFactory.getSocketFactory();
View Full Code Here

         * @return the server socket
         */
    public static ServerSocket createServerSocket(int port, InetAddress bindAddress) throws IOException {
        ServerSocket socket = null;
        setKeystore();
        ServerSocketFactory f = SSLServerSocketFactory.getDefault();
        SSLServerSocket secureSocket;
        if (bindAddress == null) {
            secureSocket = (SSLServerSocket) f.createServerSocket(port);
        } else {
            secureSocket = (SSLServerSocket) f.createServerSocket(port, 0, bindAddress);
        }
        if (SysProperties.ENABLE_ANONYMOUS_SSL) {
            String[] list = secureSocket.getEnabledCipherSuites();
            list = addAnonymous(list);
            secureSocket.setEnabledCipherSuites(list);
View Full Code Here

   /**
    * @see org.jboss.remoting.security.SSLSocketBuilderMBean#createSSLServerSocketFactory(org.jboss.remoting.security.CustomSSLServerSocketFactory)
    */
   public ServerSocketFactory createSSLServerSocketFactory(CustomSSLServerSocketFactory wrapper) throws IOException
   {
      ServerSocketFactory ssf = null;

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

      {
         createServerSocketFactorySSLContext();
         initializeServerSocketFactorySSLContext();
      }

      ServerSocketFactory ssf = sslContextServerSocketFactory.getServerSocketFactory();

      wrapper.setFactory((SSLServerSocketFactory) ssf);

      return wrapper;
   }
View Full Code Here

     */
    public TransportServer doBind(final URI location) throws IOException {
        try {
            Map<String, String> options = new HashMap<String, String>(URISupport.parseParamters(location));

            ServerSocketFactory serverSocketFactory = createServerSocketFactory();
            SslTransportServer server = new SslTransportServer(this, location, (SSLServerSocketFactory)serverSocketFactory);
            server.setWireFormatFactory(createWireFormatFactory(options));
            IntrospectionSupport.setProperties(server, options);
            Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport.");
            server.setTransportOption(transportOptions);
View Full Code Here

    public TransportServer doBind(final URI location) throws IOException {
        try {
            Map<String, String> options = new HashMap<String, String>(URISupport.parseParamters(location));

            ServerSocketFactory serverSocketFactory = createServerSocketFactory();
            TcpTransportServer server = createTcpTransportServer(location, serverSocketFactory);
            server.setWireFormatFactory(createWireFormatFactory(options));
            IntrospectionSupport.setProperties(server, options);
            Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport.");
            server.setTransportOption(transportOptions);
View Full Code Here

            }
        }

        static Socket getSocket(int port, int backlog) throws IOException{
            if(ss == null){
                ServerSocketFactory ssf = ServerSocketFactory.getDefault();
                ss = ssf.createServerSocket(port, backlog);
            }
            return ss.accept();
        }
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.