// Performance optimization used when a single protocol
// is supported by this Pipeline.
ProtocolHandler protocolHandler = null;
boolean cachedHandler = (mappedProtocols != null) &&
((protocolHandler = mappedProtocols.get(task.getSelectionKey())) != null);
SelectorThread selectorThread = task.getSelectorThread();
KeepAlivePipeline kap = (selectorThread == null) ? null
: selectorThread.getKeepAlivePipeline();
if (!isClbSet) {
String port = task.getSelectorThread().getPort() + "";
InetAddress inet = task.getSelectorThread().getInet();
// check if the port and address belong to admin listener
String adminport = ProxyConfig.getInstance().getAdminPort();
String adminaddress = ProxyConfig.getInstance().getAdminInet();
boolean isAdminPort = false;
if ((adminport != null) && (adminaddress != null)
&& (inet != null)) {
if (inet.getHostAddress().trim().equalsIgnoreCase(adminaddress) &&
port.trim().equals(adminport)) {
isAdminPort = true;
}
if (isAdminPort) {
removeProtocolFinder(sailfinProxyFinder);
removeProtocolHandler(sailfinProxyHandler);
}
if (logger.isLoggable(Level.FINE)){
logger.log(Level.FINE, "clb.proxy.portunif.disable_proxy", disableProxy);
}
}
isClbSet = true;
}
if (protocolFinders.isEmpty() || (kap == null) ||
protocolHandlers.isEmpty() ||
(task.getType() != Task.READ_TASK) ||
(kap.isKeepAlive(task.getSelectionKey()) && !cachedHandler &&
disableProxy)) {
if (logger.isLoggable(Level.FINEST)){
logger.log(Level.FINEST,
"clb.proxy.portunif.add_defaulttask");
}
super.addTask(task);
return;
}
task.getSelectionKey().attach(null);
if (!isSet) {
isRequestedTransportSecure = (task.getSelectorThread() instanceof SecureSelector)
? true : false;
isSet = true;
if (isRequestedTransportSecure) {
sslContext = ((SSLSelectorThread) task.getSelectorThread()).getSSLContext();
}
if (!isRequestedTransportSecure || (sslContext == null)) {
if (sslContext == null) {
Enumeration<SelectorThread> selectors = SelectorThread.getSelectors();
SelectorThread sel;
while (selectors.hasMoreElements()) {
sel = selectors.nextElement();
if (sel instanceof SSLSelectorThread) {