use of org.apache.catalina.Engine in project tomcat by apache.
the class ManagerServlet method setWrapper.
/**
* Set the Wrapper with which we are associated.
*
* @param wrapper The new wrapper
*/
@Override
public void setWrapper(Wrapper wrapper) {
this.wrapper = wrapper;
if (wrapper == null) {
context = null;
host = null;
oname = null;
} else {
context = (Context) wrapper.getParent();
host = (Host) context.getParent();
Engine engine = (Engine) host.getParent();
String name = engine.getName() + ":type=Deployer,host=" + host.getName();
try {
oname = new ObjectName(name);
} catch (Exception e) {
log(sm.getString("managerServlet.objectNameFail", name), e);
}
}
// Retrieve the MBean server
mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
}
use of org.apache.catalina.Engine in project tomcat by apache.
the class MapperListener method startInternal.
// ------------------------------------------------------- Lifecycle Methods
@Override
public void startInternal() throws LifecycleException {
setState(LifecycleState.STARTING);
Engine engine = service.getContainer();
if (engine == null) {
return;
}
findDefaultHost();
addListeners(engine);
Container[] conHosts = engine.findChildren();
for (Container conHost : conHosts) {
Host host = (Host) conHost;
if (!LifecycleState.NEW.equals(host.getState())) {
// Registering the host will register the context and wrappers
registerHost(host);
}
}
}
use of org.apache.catalina.Engine in project tomcat by apache.
the class ManagerServlet method getConnectorCiphers.
protected Map<String, Set<String>> getConnectorCiphers() {
Map<String, Set<String>> result = new HashMap<>();
Engine e = (Engine) host.getParent();
Service s = e.getService();
Connector[] connectors = s.findConnectors();
for (Connector connector : connectors) {
if (Boolean.TRUE.equals(connector.getProperty("SSLEnabled"))) {
SSLHostConfig[] sslHostConfigs = connector.getProtocolHandler().findSslHostConfigs();
for (SSLHostConfig sslHostConfig : sslHostConfigs) {
String name = connector.toString() + "-" + sslHostConfig.getHostName();
Set<String> cipherList = new HashSet<>();
String[] cipherNames = sslHostConfig.getEnabledCiphers();
for (String cipherName : cipherNames) {
cipherList.add(cipherName);
}
result.put(name, cipherList);
}
} else {
Set<String> cipherList = new HashSet<>();
cipherList.add(sm.getString("managerServlet.notSslConnector"));
result.put(connector.toString(), cipherList);
}
}
return result;
}
use of org.apache.catalina.Engine in project tomcat by apache.
the class MapperListener method stopInternal.
@Override
public void stopInternal() throws LifecycleException {
setState(LifecycleState.STOPPING);
Engine engine = service.getContainer();
if (engine == null) {
return;
}
removeListeners(engine);
}
use of org.apache.catalina.Engine in project tomcat by apache.
the class SimpleTcpCluster method getManagerName.
@Override
public String getManagerName(String name, Manager manager) {
String clusterName = name;
if (clusterName == null)
clusterName = manager.getContext().getName();
if (getContainer() instanceof Engine) {
Context context = manager.getContext();
Container host = context.getParent();
if (host instanceof Host && clusterName != null && !(clusterName.startsWith(host.getName() + "#"))) {
clusterName = host.getName() + "#" + clusterName;
}
}
return clusterName;
}
Aggregations