use of org.apache.catalina.Executor in project tomcat by apache.
the class ServiceMBean method findExecutors.
/**
* Retrieves all executors.
* @return an array of string representations of the executors
* @throws MBeanException error accessing the associated service
*/
public String[] findExecutors() throws MBeanException {
Service service = doGetManagedResource();
Executor[] executors = service.findExecutors();
String[] str = new String[executors.length];
for (int i = 0; i < executors.length; i++) {
str[i] = executors[i].toString();
}
return str;
}
use of org.apache.catalina.Executor in project tomcat by apache.
the class ServiceMBean method addExecutor.
/**
* Adds a named executor to the service
* @param type Classname of the Executor to be added
* @throws MBeanException error creating the executor
*/
public void addExecutor(String type) throws MBeanException {
Service service = doGetManagedResource();
Executor executor = (Executor) newInstance(type);
service.addExecutor(executor);
}
use of org.apache.catalina.Executor in project tomcat by apache.
the class ServiceMBean method getExecutor.
/**
* 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();
}
use of org.apache.catalina.Executor in project tomcat by apache.
the class StandardServiceSF method storeChildren.
/**
* Store the specified service element children.
*
* @param aWriter Current output writer
* @param indent Indentation level
* @param aService Service to store
* @param parentDesc The element description
* @throws Exception Configuration storing error
*/
@Override
public void storeChildren(PrintWriter aWriter, int indent, Object aService, StoreDescription parentDesc) throws Exception {
if (aService instanceof StandardService) {
StandardService service = (StandardService) aService;
// Store nested <Listener> elements
LifecycleListener[] listeners = ((Lifecycle) service).findLifecycleListeners();
storeElementArray(aWriter, indent, listeners);
// Store nested <Executor> elements
Executor[] executors = service.findExecutors();
storeElementArray(aWriter, indent, executors);
Connector[] connectors = service.findConnectors();
storeElementArray(aWriter, indent, connectors);
// Store nested <Engine> element
Engine container = service.getContainer();
if (container != null) {
StoreDescription elementDesc = getRegistry().findDescription(container.getClass());
if (elementDesc != null) {
IStoreFactory factory = elementDesc.getStoreFactory();
factory.store(aWriter, indent, container);
}
}
}
}
use of org.apache.catalina.Executor in project tomcat by apache.
the class ConnectorCreateRule method begin.
// --------------------------------------------------------- Public Methods
/**
* 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);
}
Aggregations