cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/OortConfigServlet.java
/**
     * <p>Configures the Oort instance with servlet init parameters.</p>
     *
     * @param config the Servlet configuration
     * @param oort the Oort instance to configure
     * @throws Exception if the Oort instance cannot be configured
     */
Configures the Oort instance with servlet init parameters.
@param config the Servlet configuration
@param oort the Oort instance to configure
@throws Exception if the Oort instance cannot be configured
Configures the Oort instance with servlet init parameters . @param config the Servlet configuration @param oort the Oort instance to configure @throws Exception if the Oort instance cannot be configured
protected void configureOort(ServletConfig config, Oort oort) throws Exception {
        String secret = config.getInitParameter(OORT_SECRET_PARAM);
        if (secret != null) {
            oort.setSecret(secret);
        }
        String enableAckExtension = config.getInitParameter(OORT_ENABLE_ACK_EXTENSION_PARAM);
        if (enableAckExtension == null) {
            enableAckExtension = "true";
        }
        oort.setAckExtensionEnabled(Boolean.parseBoolean(enableAckExtension));
        String enableBinaryExtension = config.getInitParameter(OORT_ENABLE_BINARY_EXTENSION_PARAM);
        if (enableBinaryExtension == null) {
            enableBinaryExtension = "true";
        }
        oort.setBinaryExtensionEnabled(Boolean.parseBoolean(enableBinaryExtension));
        String jsonContext = config.getInitParameter(OORT_JSON_CONTEXT_PARAM);
        if (jsonContext != null) {
            Class<?> klass = getClass().getClassLoader().loadClass(jsonContext);
            oort.setJSONContextClient((JSONContext.Client)klass.getConstructor().newInstance());
        }
        String clientTransportFactories = config.getInitParameter(OORT_CLIENT_TRANSPORT_FACTORIES_PARAM);
        if (clientTransportFactories != null) {
            List<ClientTransport.Factory> factories = new ArrayList<>();
            for (String className : clientTransportFactories.split(",")) {
                Class<?> klass = getClass().getClassLoader().loadClass(className.trim());
                factories.add((ClientTransport.Factory)klass.getConstructor().newInstance());
            }
            oort.setClientTransportFactories(factories);
        }
    }
protected void configureOort ( ServletConfig config , Oort oort ) throws Exception { String secret = config . getInitParameter ( OORT_SECRET_PARAM ) ; if ( secret != null ) { oort . setSecret ( secret ) ; } String enableAckExtension = config . getInitParameter ( OORT_ENABLE_ACK_EXTENSION_PARAM ) ; if ( enableAckExtension == null ) { enableAckExtension = "true" ; } oort . setAckExtensionEnabled ( Boolean . parseBoolean ( enableAckExtension ) ) ; String enableBinaryExtension = config . getInitParameter ( OORT_ENABLE_BINARY_EXTENSION_PARAM ) ; if ( enableBinaryExtension == null ) { enableBinaryExtension = "true" ; } oort . setBinaryExtensionEnabled ( Boolean . parseBoolean ( enableBinaryExtension ) ) ; String jsonContext = config . getInitParameter ( OORT_JSON_CONTEXT_PARAM ) ; if ( jsonContext != null ) { Class < ? > klass = getClass ( ) . getClassLoader ( ) . loadClass ( jsonContext ) ; oort . setJSONContextClient ( ( JSONContext . Client ) klass . getConstructor ( ) . newInstance ( ) ) ; } String clientTransportFactories = config . getInitParameter ( OORT_CLIENT_TRANSPORT_FACTORIES_PARAM ) ; if ( clientTransportFactories != null ) { List < ClientTransport . Factory > factories = new ArrayList < > ( ) ; for ( String className : clientTransportFactories . split ( "," ) ) { Class < ? > klass = getClass ( ) . getClassLoader ( ) . loadClass ( className . trim ( ) ) ; factories . add ( ( ClientTransport . Factory ) klass . getConstructor ( ) . newInstance ( ) ) ; } oort . setClientTransportFactories ( factories ) ; } }
<p>Configures the Oort instance with servlet init parameters.</p>
 @param config the Servlet configuration
 @param oort the Oort instance to configure
 @throws Exception if the Oort instance cannot be configured
<p > Configures the Oort instance with servlet init parameters . < / p > @param config the Servlet configuration @param oort the Oort instance to configure @throws Exception if the Oort instance cannot be configured