@SuppressWarnings("unchecked")
	@Override
	public void init() throws Exception {
		endpoint.setName(getName());
		endpoint.setHandler(cHandler);

		// Verify the validity of the configured socket factory
		try {
			if (isSSLEnabled()) {
				sslImplementation = (SSLImplementation<NioChannel>) SSLImplementation
						.getInstance(NioJSSEImplementation.class.getName());
				socketFactory = sslImplementation
						.getServerSocketChannelFactory();
				endpoint.setServerSocketChannelFactory(socketFactory);
			}
		} catch (Exception ex) {
			log.error(sm.getString("http11protocol.socketfactory.initerror"),
					ex);
			throw ex;
		}

		if (socketFactory != null) {
			Iterator<String> attE = attributes.keySet().iterator();
			while (attE.hasNext()) {
				String key = attE.next();
				Object v = attributes.get(key);
				socketFactory.setAttribute(key, v);
			}
		}

		int maxThreads = 0;
		// Setting the max thread number
		String property = System.getProperty(Constants.MAX_THREAD_NAME);
		if (property != null) {
			try {
				maxThreads = Integer.valueOf(property);
				log.info("Configure max thread number : " + maxThreads);
			} catch (Exception e) {
				log.warn("Invalid MAX-THREAD number, using the default value "
						+ maxThreads);
			}
		}

		this.endpoint.setMaxThreads(maxThreads);

		// Setting the max connection number
		int maxConnections = 2 * maxThreads;
		property = System.getProperty(Constants.MAX_CONNECTIONS_NAME);
		if (property != null) {
			try {
				maxConnections = Integer.valueOf(property);
				log.info("Configure max connection number : " + maxConnections);
			} catch (Exception e) {
				log.warn("Invalid MAX-CONNECTION number, using the default value "
						+ maxConnections);
			}
		}

		this.endpoint.setMaxConnections(maxConnections);

		try {
			endpoint.setKeepAliveTimeout(this.timeout);
			endpoint.init();
		} catch (Exception ex) {
			log.error(sm.getString("http11protocol.endpoint.initerror"), ex);
			throw ex;
		}
		//
		log.info(sm.getString("http11protocol.init", getName()));
	}