Java Code Examples for org.apache.catalina.Service#getExecutor()

The following examples show how to use org.apache.catalina.Service#getExecutor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConnectorCreateRule.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
/**
 * Process the beginning of this element.
 *
 * @param namespace the namespace URI of the matching element, or an
 *   empty string if the parser is not namespace aware or the element has
 *   no namespace
 * @param name the local name if the parser is namespace aware, or just
 *   the element name otherwise
 * @param attributes The attribute list for this element
 */
@Override
public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
    Service svc = (Service)digester.peek();
    Executor ex = null;
    if ( attributes.getValue("executor")!=null ) {
        ex = svc.getExecutor(attributes.getValue("executor"));
    }
    Connector con = new Connector(attributes.getValue("protocol"));
    if (ex != null) {
        setExecutor(con, ex);
    }
    String sslImplementationName = attributes.getValue("sslImplementationName");
    if (sslImplementationName != null) {
        setSSLImplementationName(con, sslImplementationName);
    }
    digester.push(con);
}
 
Example 2
Source File: ConnectorCreateRule.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
/**
 * Process the beginning of this element.
 *
 * @param namespace the namespace URI of the matching element, or an 
 *   empty string if the parser is not namespace aware or the element has
 *   no namespace
 * @param name the local name if the parser is namespace aware, or just 
 *   the element name otherwise
 * @param attributes The attribute list for this element
 */
@Override
public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
    Service svc = (Service)digester.peek();
    Executor ex = null;
    if ( attributes.getValue("executor")!=null ) {
        ex = svc.getExecutor(attributes.getValue("executor"));
    }
    Connector con = new Connector(attributes.getValue("protocol"));
    if ( ex != null )  _setExecutor(con,ex);
    
    digester.push(con);
}
 
Example 3
Source File: ConnectorCreateRule.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
/**
 * Process the beginning of this element.
 *
 * @param namespace the namespace URI of the matching element, or an 
 *   empty string if the parser is not namespace aware or the element has
 *   no namespace
 * @param name the local name if the parser is namespace aware, or just 
 *   the element name otherwise
 * @param attributes The attribute list for this element
 */
@Override
public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
    Service svc = (Service)digester.peek();
    Executor ex = null;
    if ( attributes.getValue("executor")!=null ) {
        ex = svc.getExecutor(attributes.getValue("executor"));
    }
    Connector con = new Connector(attributes.getValue("protocol"));
    if ( ex != null )  _setExecutor(con,ex);
    
    digester.push(con);
}
 
Example 4
Source File: TomcatCustomServer.java    From nano-framework with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("rawtypes")
protected void initConnector() {
    final TypeReference<ConnectorConf> type = new TypeReference<ConnectorConf>() {
    };
    final ConnectorConf conf = new ConnectorConf(JSON.parseObject(context.getProperty(TOMCAT_CONNECTOR), type));
    LOGGER.debug("{}", conf.toString());
    final Connector connector = conf.init();
    final Service service = getService();
    final Executor executor = service.getExecutor(conf.getExecutor());
    ((AbstractProtocol) connector.getProtocolHandler()).setExecutor(executor);
    setConnector(connector);
    service.addConnector(connector);
}
 
Example 5
Source File: ServiceMBean.java    From Tomcat8-Source-Read with MIT License 2 votes vote down vote up
/**
 * Retrieves executor by name
 * @param name Name of the executor to be retrieved
 * @return a string representation of the executor
 * @throws MBeanException error accessing the associated service
 */
public String getExecutor(String name) throws MBeanException{
    Service service = doGetManagedResource();
    Executor executor = service.getExecutor(name);
    return executor.toString();
}