}
// Open a server socket listener
try{
serverSocket =
(ServerSocket)
AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws IOException
{
return createServerSocket();
}
});
} catch (PrivilegedActionException e) {
Exception e1 = e.getException();
// Test for UnknownHostException first since it's a
// subbclass of IOException (and consolePropertyMessage
// throws an exception when the severity is S (or U).
if (e1 instanceof UnknownHostException) {
consolePropertyMessage("DRDA_UnknownHost.S", hostArg);
} else if (e1 instanceof IOException) {
consolePropertyMessage("DRDA_ListenPort.S",
new String [] {
Integer.toString(portNumber),
hostArg,
// Since SocketException
// is used for a phletora
// of situations, we need
// to communicate the
// underlying exception
// string to the user.
e1.toString()});
} else {
throw e1;
}
} catch (Exception e) {
// If we find other (unexpected) errors, we ultimately exit--so make
// sure we print the error message before doing so (Beetle 5033).
throwUnexpectedException(e);
}
switch (getSSLMode()) {
default:
case SSL_OFF:
consolePropertyMessage("DRDA_Ready.I", new String []
{Integer.toString(portNumber), att_srvclsnm, versionString,
getFormattedTimestamp()});
break;
case SSL_BASIC:
consolePropertyMessage("DRDA_SSLReady.I", new String []
{Integer.toString(portNumber), att_srvclsnm, versionString,
getFormattedTimestamp()});
break;
case SSL_PEER_AUTHENTICATION:
consolePropertyMessage("DRDA_SSLClientAuthReady.I", new String []
{Integer.toString(portNumber), att_srvclsnm, versionString,
getFormattedTimestamp()});
break;
}
// We accept clients on a separate thread so we don't run into a problem
// blocking on the accept when trying to process a shutdown
final ClientThread clientThread =
(ClientThread) AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public Object run() throws Exception
{
return new ClientThread(thisControl,
serverSocket);
}