Fields Summary |
---|
private org.apache.james.services.MailServer | mailServerThe internal mail server service |
private org.apache.james.services.UsersRepository | usersThe user repository for this server - used to authenticate users. |
private int | lengthResetThe number of bytes to read before resetting
the connection timeout timer. Defaults to
20 KB. |
private org.apache.avalon.excalibur.pool.Pool | theHandlerPoolThe pool used to provide POP3 Handler objects |
private org.apache.avalon.excalibur.pool.ObjectFactory | theHandlerFactoryThe factory used to provide POP3 Handler objects |
private org.apache.james.util.watchdog.WatchdogFactory | theWatchdogFactoryThe factory used to generate Watchdog objects |
private POP3HandlerConfigurationData | theConfigDataThe configuration data to be passed to the handler |
Methods Summary |
---|
public void | configure(org.apache.avalon.framework.configuration.Configuration configuration)
super.configure(configuration);
if (isEnabled()) {
Configuration handlerConfiguration = configuration.getChild("handler");
lengthReset = handlerConfiguration.getChild("lengthReset").getValueAsInteger(lengthReset);
if (getLogger().isInfoEnabled()) {
getLogger().info("The idle timeout will be reset every " + lengthReset + " bytes.");
}
}
|
protected int | getDefaultPort()
return 110;
|
public java.lang.String | getServiceType()
return "POP3 Service";
|
public void | initialize()
super.initialize();
if (!isEnabled()) {
return;
}
if (connectionLimit != null) {
theHandlerPool = new HardResourceLimitingPool(theHandlerFactory, 5, connectionLimit.intValue());
getLogger().debug("Using a bounded pool for POP3 handlers with upper limit " + connectionLimit.intValue());
} else {
// NOTE: The maximum here is not a real maximum. The handler pool will continue to
// provide handlers beyond this value.
theHandlerPool = new DefaultPool(theHandlerFactory, null, 5, 30);
getLogger().debug("Using an unbounded pool for POP3 handlers.");
}
if (theHandlerPool instanceof LogEnabled) {
((LogEnabled)theHandlerPool).enableLogging(getLogger());
}
if (theHandlerPool instanceof Initializable) {
((Initializable)theHandlerPool).initialize();
}
theWatchdogFactory = getWatchdogFactory();
|
protected org.apache.avalon.cornerstone.services.connection.ConnectionHandler | newHandler()
POP3Handler theHandler = (POP3Handler)theHandlerPool.get();
Watchdog theWatchdog = theWatchdogFactory.getWatchdog(theHandler.getWatchdogTarget());
theHandler.setConfigurationData(theConfigData);
theHandler.setWatchdog(theWatchdog);
return theHandler;
|
public void | releaseConnectionHandler(org.apache.avalon.cornerstone.services.connection.ConnectionHandler connectionHandler)
if (!(connectionHandler instanceof POP3Handler)) {
throw new IllegalArgumentException("Attempted to return non-POP3Handler to pool.");
}
theHandlerPool.put((Poolable)connectionHandler);
|
public void | service(org.apache.avalon.framework.service.ServiceManager componentManager)
super.service(componentManager);
mailServer = (MailServer)componentManager.lookup( MailServer.ROLE );
users = (UsersRepository)componentManager.lookup( UsersRepository.ROLE );
|