Package javax.net

Examples of javax.net.ServerSocketFactory


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

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


    private static final Log log = LogFactory.getLog(TcpTransportFactory.class);
    public TransportServer doBind(String brokerId, final URI location) throws IOException {
        try {
            Map options = new HashMap(URISupport.parseParamters(location));

            ServerSocketFactory serverSocketFactory = createServerSocketFactory();
            TcpTransportServer server = createTcpTransportServer(location, serverSocketFactory);
            server.setWireFormatFactory(createWireFormatFactory(options));
            IntrospectionSupport.setProperties(server, options);
            Map transportOptions = IntrospectionSupport.extractProperties(options, "transport.");
            server.setTransportOption(transportOptions);
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

   /** Test the JSSE installation
    */
   public void testJSSE() throws Exception
   {
      log.debug("+++ testJSSE");
      ServerSocketFactory factory =
         SSLServerSocketFactory.getDefault();
      SSLServerSocket sslSocket = (SSLServerSocket)
         factory.createServerSocket(0);
      int port = sslSocket.getLocalPort();

      String [] cipherSuites = sslSocket.getEnabledCipherSuites();
      for(int i = 0; i < cipherSuites.length; i++)
      {
View Full Code Here

      {
         log.error("Failed to init SSLContext", e);
         throw new IOException("Failed to get SSLContext for TLS algorithm");
      }

      ServerSocketFactory factory = sslCtx.getServerSocketFactory();
      ServerSocket serverSocket = factory.createServerSocket(0);
      getLog().debug("Created serverSocket: "+serverSocket);
      int port = serverSocket.getLocalPort();
      InetAddress addr = serverSocket.getInetAddress();
      httpsURL = "https://localhost:" + port + '/';
      AcceptThread thread = new AcceptThread(serverSocket, getLog(), httpsURL);
View Full Code Here

    @Override
    public ServerSocket createServerSocket(InetAddress address, int port, int backlog, Boolean reuse) throws IOException
    {
        try
        {
            ServerSocketFactory ssf = tls.getServerSocketFactory();
            return configure(ssf.createServerSocket(), reuse, new InetSocketAddress(address, port), backlog);
        }
        catch (IOException e)
        {
            throw e;
        }
View Full Code Here

    @Override
    public ServerSocket createServerSocket(int port, int backlog, Boolean reuse) throws IOException
    {
        try
        {
            ServerSocketFactory ssf = tls.getServerSocketFactory();
            return configure(ssf.createServerSocket(), reuse, new InetSocketAddress(port), backlog);
        }
        catch (IOException e)
        {
            throw e;
        }
View Full Code Here

        TCPSRequestInfo info = (TCPSRequestInfo) getRequestInfo();
        SSLProperties properties = info.getSSLProperties();
        if (properties != null) {
            SSLHelper.configure(properties);   
        }
        ServerSocketFactory factory =
                SSLServerSocketFactory.getDefault();
        SSLServerSocket socket = (SSLServerSocket) factory.createServerSocket(
                port, backlog, host);
        socket.setNeedClientAuth(info.getNeedClientAuth());
        return socket;
    }
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

    }
    if (keyPassword == null) {
      throw new IllegalArgumentException("the key password cannot be null");
    }

    ServerSocketFactory factory = null;

    try {

      KeyStore keyStore = KeyStore.getInstance("JKS");
      keyStore.load(keyStoreStream, keyStorePassword.toCharArray());
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.