本文整理汇总了Java中org.apache.catalina.net.ServerSocketFactory类的典型用法代码示例。如果您正苦于以下问题:Java ServerSocketFactory类的具体用法?Java ServerSocketFactory怎么用?Java ServerSocketFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServerSocketFactory类属于org.apache.catalina.net包,在下文中一共展示了ServerSocketFactory类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFactory
import org.apache.catalina.net.ServerSocketFactory; //导入依赖的package包/类
/**
* Return the server socket factory used by this Container.
*/
public ServerSocketFactory getFactory() {
if (this.factory == null) {
synchronized (this) {
this.factory = new DefaultServerSocketFactory();
}
}
return (this.factory);
}
示例2: open
import org.apache.catalina.net.ServerSocketFactory; //导入依赖的package包/类
/**
* Open and return the server socket for this Connector. If an IP
* address has been specified, the socket will be opened only on that
* address; otherwise it will be opened on all addresses.
*
* @exception IOException input/output or network error
* @exception KeyStoreException error instantiating the
* KeyStore from file (SSL only)
* @exception NoSuchAlgorithmException KeyStore algorithm unsupported
* by current provider (SSL only)
* @exception CertificateException general certificate error (SSL only)
* @exception UnrecoverableKeyException internal KeyStore problem with
* the certificate (SSL only)
* @exception KeyManagementException problem in the key management
* layer (SSL only)
*/
private ServerSocket open()
throws IOException, KeyStoreException, NoSuchAlgorithmException,
CertificateException, UnrecoverableKeyException,
KeyManagementException
{
// Acquire the server socket factory for this Connector
ServerSocketFactory factory = getFactory();
// If no address is specified, open a connection on all addresses
if (address == null) {
log(sm.getString("httpConnector.allAddresses"));
return (factory.createSocket(port, acceptCount));
}
// Open a server socket on the specified address
InetAddress[] addresses =
InetAddress.getAllByName(InetAddress.getLocalHost().getHostName());
int i;
for (i = 0; i < addresses.length; i++) {
if (addresses[i].getHostAddress().equals(address))
break;
}
if (i < addresses.length) {
log(sm.getString("httpConnector.anAddress", address));
return (factory.createSocket(port, acceptCount, addresses[i]));
} else {
log(sm.getString("httpConnector.noAddress", address));
return (factory.createSocket(port, acceptCount));
}
}
示例3: storeFactory
import org.apache.catalina.net.ServerSocketFactory; //导入依赖的package包/类
/**
* Store the specified ServerSocketFactory properties.
*
* @param writer PrintWriter to which we are storing
* @param indent Number of spaces to indent this element
* @param factory Object whose properties are being stored
*
* @exception Exception if an exception occurs while storing
*/
private void storeFactory(PrintWriter writer, int indent,
ServerSocketFactory factory) throws Exception {
for (int i = 0; i < indent; i++) {
writer.print(' ');
}
writer.print("<Factory");
storeAttributes(writer, factory);
writer.println("/>");
}
示例4: storeConnector
import org.apache.catalina.net.ServerSocketFactory; //导入依赖的package包/类
/**
* Store the specified Connector properties.
*
* @param writer PrintWriter to which we are storing
* @param indent Number of spaces to indent this element
* @param connector Object whose properties are being stored
*
* @exception Exception if an exception occurs while storing
*/
private void storeConnector(PrintWriter writer, int indent,
Connector connector) throws Exception {
// Store the beginning of this element
for (int i = 0; i < indent; i++) {
writer.print(' ');
}
writer.print("<Connector");
storeAttributes(writer, connector);
writer.println(">");
// Store nested <Factory> element
ServerSocketFactory factory = connector.getFactory();
if (factory != null) {
storeFactory(writer, indent + 2, factory);
}
// Store nested <Listener> elements
if (connector instanceof Lifecycle) {
LifecycleListener listeners[] =
((Lifecycle) connector).findLifecycleListeners();
if (listeners == null) {
listeners = new LifecycleListener[0];
}
for (int i = 0; i < listeners.length; i++) {
if (listeners[i].getClass().getName().equals
(SERVER_LISTENER_CLASS_NAME)) {
continue;
}
storeListener(writer, indent + 2, listeners[i]);
}
}
// Store the ending of this element
for (int i = 0; i < indent; i++) {
writer.print(' ');
}
writer.println("</Connector>");
}
示例5: getFactory
import org.apache.catalina.net.ServerSocketFactory; //导入依赖的package包/类
@Override
public ServerSocketFactory getFactory() {
// TODO Auto-generated method stub
return null;
}
示例6: setFactory
import org.apache.catalina.net.ServerSocketFactory; //导入依赖的package包/类
@Override
public void setFactory(ServerSocketFactory factory) {
// TODO Auto-generated method stub
}
示例7: setFactory
import org.apache.catalina.net.ServerSocketFactory; //导入依赖的package包/类
/**
* Set the server socket factory used by this Container.
*
* @param factory The new server socket factory
*/
public void setFactory(ServerSocketFactory factory) {
this.factory = factory;
}
示例8: getFactory
import org.apache.catalina.net.ServerSocketFactory; //导入依赖的package包/类
/**
* Return the server socket factory used by this Container.
*/
public ServerSocketFactory getFactory();
示例9: setFactory
import org.apache.catalina.net.ServerSocketFactory; //导入依赖的package包/类
/**
* Set the server socket factory used by this Container.
*
* @param factory The new server socket factory
*/
public void setFactory(ServerSocketFactory factory);