| Method from org.springframework.remoting.support.SimpleHttpServerFactoryBean Detail: |
public void afterPropertiesSet() throws IOException {
InetSocketAddress address = (this.hostname != null ?
new InetSocketAddress(this.hostname, this.port) : new InetSocketAddress(this.port));
this.server = HttpServer.create(address, this.backlog);
if (this.executor != null) {
this.server.setExecutor(this.executor);
}
if (this.contexts != null) {
for (String key : this.contexts.keySet()) {
HttpContext httpContext = this.server.createContext(key, this.contexts.get(key));
if (this.filters != null) {
httpContext.getFilters().addAll(this.filters);
}
if (this.authenticator != null) {
httpContext.setAuthenticator(this.authenticator);
}
}
}
if (this.logger.isInfoEnabled()) {
this.logger.info("Starting HttpServer at address " + address);
}
this.server.start();
}
|
public void destroy() {
logger.info("Stopping HttpServer");
this.server.stop(this.shutdownDelay);
}
|
public Object getObject() {
return this.server;
}
|
public Class getObjectType() {
return (this.server != null ? this.server.getClass() : HttpServer.class);
}
|
public boolean isSingleton() {
return true;
}
|
public void setAuthenticator(Authenticator authenticator) {
this.authenticator = authenticator;
}
|
public void setBacklog(int backlog) {
this.backlog = backlog;
}
Specify the HTTP server's TCP backlog. Default is -1,
indicating the system's default value. |
public void setContexts(Map contexts) {
this.contexts = contexts;
}
|
public void setExecutor(Executor executor) {
this.executor = executor;
}
Set the JDK concurrent executor to use for dispatching incoming requests. |
public void setFilters(List filters) {
this.filters = filters;
}
|
public void setHostname(String hostname) {
this.hostname = hostname;
}
Specify the HTTP server's hostname to bind to. Default is localhost;
can be overridden with a specific network address to bind to. |
public void setPort(int port) {
this.port = port;
}
Specify the HTTP server's port. Default is 8080. |
public void setShutdownDelay(int shutdownDelay) {
this.shutdownDelay = shutdownDelay;
}
Specify the number of seconds to wait until HTTP exchanges have
completed when shutting down the HTTP server. Default is 0. |
public void setTaskExecutor(TaskExecutor executor) {
this.executor = new ConcurrentExecutorAdapter(executor);
}
Set the Spring TaskExecutor to use for dispatching incoming requests. |