Methods Summary |
---|
private void | checkSocketFactory()Sanity check and socketFactory setup.
IMHO it is better to stop the show on a broken connector,
then leave Tomcat running and broken.
// -------------------- Various implementation classes --------------------
if(secure) {
try {
// The SSL setup code has been moved into
// SSLImplementation since SocketFactory doesn't
// provide a wide enough interface
sslImplementation=SSLImplementation.getInstance
(sslImplementationName);
socketFactory =
sslImplementation.getServerSocketFactory();
ep.setServerSocketFactory(socketFactory);
} catch (ClassNotFoundException e){
throw e;
}
}
else {
if (socketFactoryName != null) {
try {
socketFactory = string2SocketFactory(socketFactoryName);
ep.setServerSocketFactory(socketFactory);
} catch(Exception sfex) {
throw sfex;
}
}
}
|
protected void | create()
cHandler = new Http11ConnectionHandler( this );
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
|
public void | destroy()
log.info("Stoping http11 protocol on " + ep.getPort() + " " + tpOname);
ep.stopEndpoint();
if( tpOname!=null )
Registry.getRegistry().unregisterComponent(tpOname);
if( rgOname != null )
Registry.getRegistry().unregisterComponent(rgOname);
|
public Adapter | getAdapter()
return adapter;
|
public java.net.InetAddress | getAddress()
return ep.getAddress();
|
public java.lang.String | getAlgorithm()
return getProperty("algorithm");
|
public java.lang.Object | getAttribute(java.lang.String key)
return attributes.get(key);
|
public int | getBacklog()
return ep.getBacklog();
|
public boolean | getBlocking()
return blocking;
|
public int | getBufferSize()Return the request input buffer size
return requestBufferSize;
|
public java.lang.String | getCiphers()
return getProperty("ciphers");
|
public java.lang.String | getClientauth()
return getProperty("clientauth");
|
public java.lang.String | getCompression()
return compression;
|
public boolean | getDisableUploadTimeout()
return disableUploadTimeout;
|
public java.lang.String | getDomain()
return domain;
|
public java.lang.String | getKeyAlias()
return getProperty("keyAlias");
|
public java.lang.String | getKeypass()
return getProperty("keypass");
|
public java.lang.String | getKeystore()
return getProperty("keystore");
|
public java.lang.String | getKeytype()
return getProperty("keystoreType");
|
public int | getMaxHttpHeaderSize()
return maxHttpHeaderSize;
|
public int | getMaxKeepAliveRequests()
return maxKeepAliveRequests;
|
public int | getMaxPostSize()
return maxPostSize;
|
public int | getMaxSpareThreads()
return ep.getMaxSpareThreads();
|
public int | getMaxThreads()
return ep.getMaxThreads();
|
public int | getMinSpareThreads()
return ep.getMinSpareThreads();
|
public javax.management.ObjectName | getObjectName()
return oname;
|
public boolean | getPools()
// -------------------- Pool setup --------------------
return ep.isPoolOn();
|
public int | getPort()
return ep.getPort();
|
public java.lang.String | getProperty(java.lang.String name)Get a property
return (String)getAttribute(name);
|
public java.lang.String | getProtocol()
return getProperty("protocol");
|
public java.lang.String | getProtocols()
return getProperty("protocols");
|
public java.lang.String | getReportedname()
return reportedname;
|
public java.lang.String | getSSLImplementation()
return sslImplementationName;
|
public boolean | getSecure()
return secure;
|
public int | getServerSoTimeout()
return ep.getServerSoTimeout();
|
public int | getSoLinger()
return ep.getSoLinger();
|
public int | getSoTimeout()
return ep.getSoTimeout();
|
public int | getSocketCloseDelay()
return socketCloseDelay;
|
public java.lang.String | getSocketFactory()
return socketFactoryName;
|
public boolean | getTcpNoDelay()
return ep.getTcpNoDelay();
|
public int | getTimeout()
return timeout;
|
public void | init()Start the protocol
ep.setConnectionHandler( cHandler );
try {
checkSocketFactory();
} catch( Exception ex ) {
log.error(sm.getString("http11protocol.socketfactory.initerror"),
ex);
throw ex;
}
if( socketFactory!=null ) {
Enumeration attE=attributes.keys();
while( attE.hasMoreElements() ) {
String key=(String)attE.nextElement();
Object v=attributes.get( key );
socketFactory.setAttribute( key, v );
}
}
// XXX get domain from registration
try {
ep.initEndpoint();
} catch (Exception ex) {
log.error(sm.getString("http11protocol.endpoint.initerror"), ex);
throw ex;
}
log.info(sm.getString("http11protocol.init", "" + ep.getPort(),
System.getProperty("product.name")));
|
public void | postDeregister()
|
public void | postRegister(java.lang.Boolean registrationDone)
|
public void | preDeregister()
|
public javax.management.ObjectName | preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
oname=name;
mserver=server;
domain=name.getDomain();
return name;
|
public void | setAdapter(Adapter adapter)The adapter, used to call the connector
this.adapter=adapter;
|
public void | setAddress(java.net.InetAddress ia)
ep.setAddress( ia );
setAttribute("address", "" + ia);
|
public void | setAlgorithm(java.lang.String k)
setAttribute("algorithm", k);
|
public void | setAttribute(java.lang.String name, java.lang.Object value)Pass config info
if( log.isTraceEnabled())
log.trace(sm.getString("http11protocol.setattribute", name, value));
attributes.put(name, value);
/*
if ("maxKeepAliveRequests".equals(name)) {
maxKeepAliveRequests = Integer.parseInt((String) value.toString());
} else if ("port".equals(name)) {
setPort(Integer.parseInt((String) value.toString()));
}
*/
|
public void | setBacklog(int i)
ep.setBacklog(i);
setAttribute("backlog", "" + i);
|
public void | setBlocking(boolean b)
blocking=b;
setAttribute("blocking", "" + b);
|
public void | setBufferSize(int requestBufferSize)Set the request input buffer size
this.requestBufferSize = requestBufferSize;
|
public void | setCiphers(java.lang.String ciphers)
setAttribute("ciphers", ciphers);
|
public void | setClientauth(java.lang.String k)
setAttribute("clientauth", k);
|
public void | setCompression(java.lang.String valueS)
compression = valueS;
setAttribute("compression", valueS);
|
public void | setDisableUploadTimeout(boolean isDisabled)
disableUploadTimeout = isDisabled;
|
public void | setKeyAlias(java.lang.String keyAlias)
setAttribute("keyAlias", keyAlias);
|
public void | setKeypass(java.lang.String k)
attributes.put("keypass", k);
//setAttribute("keypass", k);
|
public void | setKeystore(java.lang.String k)
setAttribute("keystore", k);
|
public void | setKeytype(java.lang.String k)
setAttribute("keystoreType", k);
|
public void | setMaxHttpHeaderSize(int valueI)
maxHttpHeaderSize = valueI;
setAttribute("maxHttpHeaderSize", "" + valueI);
|
public void | setMaxKeepAliveRequests(int mkar)Set the maximum number of Keep-Alive requests that we will honor.
maxKeepAliveRequests = mkar;
setAttribute("maxKeepAliveRequests", "" + mkar);
|
public void | setMaxPostSize(int valueI)
maxPostSize = valueI;
setAttribute("maxPostSize", "" + valueI);
|
public void | setMaxSpareThreads(int maxThreads)
ep.setMaxSpareThreads(maxThreads);
setAttribute("maxSpareThreads", "" + maxThreads);
|
public void | setMaxThreads(int maxThreads)
ep.setMaxThreads(maxThreads);
setAttribute("maxThreads", "" + maxThreads);
|
public void | setMinSpareThreads(int minSpareThreads)
ep.setMinSpareThreads(minSpareThreads);
setAttribute("minSpareThreads", "" + minSpareThreads);
|
public void | setPools(boolean t)
ep.setPoolOn(t);
setAttribute("pools", "" + t);
|
public void | setPort(int port)
ep.setPort(port);
setAttribute("port", "" + port);
//this.port=port;
|
public void | setProperty(java.lang.String name, java.lang.String value)Set a property.
setAttribute(name, value);
|
public void | setProtocol(java.lang.String k)
setAttribute("protocol", k);
|
public void | setProtocols(java.lang.String k)
setAttribute("protocols", k);
|
public void | setReportedname(java.lang.String reportedName)
reportedname = reportedName;
|
public void | setSSLImplementation(java.lang.String valueS)
sslImplementationName=valueS;
setAttribute("sslImplementation", valueS);
|
public void | setSecure(boolean b)
secure=b;
setAttribute("secure", "" + b);
|
public void | setServerSoTimeout(int i)
ep.setServerSoTimeout(i);
setAttribute("serverSoTimeout", "" + i);
|
public void | setSoLinger(int i)
ep.setSoLinger( i );
setAttribute("soLinger", "" + i);
|
public void | setSoTimeout(int i)
ep.setSoTimeout(i);
setAttribute("soTimeout", "" + i);
|
public void | setSocketCloseDelay(int d)
socketCloseDelay=d;
setAttribute("socketCloseDelay", "" + d);
|
public void | setSocketFactory(java.lang.String valueS)
socketFactoryName = valueS;
setAttribute("socketFactory", valueS);
|
public void | setTcpNoDelay(boolean b)
ep.setTcpNoDelay( b );
setAttribute("tcpNoDelay", "" + b);
|
public void | setTimeout(int timeouts)
timeout = timeouts * 1000;
setAttribute("timeout", "" + timeouts);
|
public void | setTruststore(java.lang.String truststore)
setAttribute("truststore", truststore);
|
public void | setTruststoreType(java.lang.String truststoreType)
setAttribute("truststoreType", truststoreType);
|
public void | start()
if( this.domain != null ) {
try {
// XXX We should be able to configure it separately
// XXX It should be possible to use a single TP
tpOname=new ObjectName(domain + ":" + "type=ThreadPool,name=http" + ep.getPort());
Registry.getRegistry().registerComponent(tp, tpOname, null );
tp.setName("http" + ep.getPort());
tp.addThreadPoolListener(new MXPoolListener(this, tp));
} catch (Exception e) {
log.error("Can't register threadpool" );
}
rgOname=new ObjectName( domain +
":type=GlobalRequestProcessor,name=http" +
ep.getPort());
Registry.getRegistry().registerComponent( cHandler.global,
rgOname, null );
}
try {
ep.startEndpoint();
} catch (Exception ex) {
log.error(sm.getString("http11protocol.endpoint.starterror"), ex);
throw ex;
}
log.info(sm.getString("http11protocol.start", "" + ep.getPort(),
System.getProperty("product.name")));
|
protected static ServerSocketFactory | string2SocketFactory(java.lang.String val)
Class chC=Class.forName( val );
return (ServerSocketFactory)chC.newInstance();
|