本文整理汇总了Java中org.apache.catalina.Engine.findChildren方法的典型用法代码示例。如果您正苦于以下问题:Java Engine.findChildren方法的具体用法?Java Engine.findChildren怎么用?Java Engine.findChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.Engine
的用法示例。
在下文中一共展示了Engine.findChildren方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startInternal
import org.apache.catalina.Engine; //导入方法依赖的package包/类
@Override
public void startInternal() throws LifecycleException {
setState(LifecycleState.STARTING);
// Find any components that have already been initialized since the
// MBean listener won't be notified as those components will have
// already registered their MBeans
findDefaultHost();
Engine engine = (Engine) connector.getService().getContainer();
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);
}
}
}
示例2: reset
import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
* Reset configuration for a particular proxy following an error.
*/
protected void reset(int pos) {
Service[] services = ServerFactory.getServer().findServices();
for (int i = 0; i < services.length; i++) {
Engine engine = (Engine) services[i].getContainer();
removeAll((Engine) services[i].getContainer(), pos);
config(engine, pos);
Container[] children = engine.findChildren();
for (int j = 0; j < children.length; j++) {
Container[] children2 = children[j].findChildren();
for (int k = 0; k < children2.length; k++) {
addContext((Context) children2[k], pos);
}
}
}
}
示例3: startInternal
import org.apache.catalina.Engine; //导入方法依赖的package包/类
@Override
public void startInternal() throws LifecycleException {
setState(LifecycleState.STARTING);
// Find any components that have already been initialized since the
// MBean listener won't be notified as those components will have
// already registered their MBeans
findDefaultHost();
Engine engine = (Engine) connector.getService().getContainer();
//递归为所有的容器注册MapperListener监听器 对已经形成的容器建立体系 便于查找
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);
}
}
}
示例4: startInternal
import org.apache.catalina.Engine; //导入方法依赖的package包/类
@Override
public void startInternal() throws LifecycleException {
setState(LifecycleState.STARTING);
// Find any components that have already been initialized since the
// MBean listener won't be notified as those components will have
// already registered their MBeans
findDefaultHost();
Engine engine = (Engine) connector.getService().getContainer();
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);
}
}
}
示例5: findDefaultHost
import org.apache.catalina.Engine; //导入方法依赖的package包/类
private void findDefaultHost() {
Engine engine = (Engine) connector.getService().getContainer();
String defaultHost = engine.getDefaultHost();
boolean found = false;
if (defaultHost != null && defaultHost.length() >0) {
Container[] containers = engine.findChildren();
for (Container container : containers) {
Host host = (Host) container;
if (defaultHost.equalsIgnoreCase(host.getName())) {
found = true;
break;
}
String[] aliases = host.findAliases();
for (String alias : aliases) {
if (defaultHost.equalsIgnoreCase(alias)) {
found = true;
break;
}
}
}
}
if(found) {
mapper.setDefaultHostName(defaultHost);
} else {
log.warn(sm.getString("mapperListener.unknownDefaultHost",
defaultHost, connector));
}
}
示例6: registerListenersForEngine
import org.apache.catalina.Engine; //导入方法依赖的package包/类
private void registerListenersForEngine(Engine engine) {
for (Container hostContainer : engine.findChildren()) {
Host host = (Host) hostContainer;
host.addContainerListener(this);
registerListenersForHost(host);
}
}
示例7: createMBeans
import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
* Create the MBeans for the specified Engine and its nested components.
*
* @param engine Engine for which to create MBeans
*
* @exception Exception if an exception is thrown during MBean creation
*/
protected void createMBeans(Engine engine) throws Exception {
// Create the MBean for the Engine itself
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Engine " + engine);
}
//MBeanUtils.createMBean(engine);
engine.addContainerListener(this);
if (engine instanceof StandardEngine) {
((StandardEngine) engine).addPropertyChangeListener(this);
}
// Create the MBeans for the associated nested components
Realm eRealm = engine.getRealm();
if (eRealm != null) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Realm " + eRealm);
//MBeanUtils.createMBean(eRealm);
}
// Create the MBeans for each child Host
Container hosts[] = engine.findChildren();
for (int j = 0; j < hosts.length; j++) {
createMBeans((Host) hosts[j]);
}
}
示例8: destroyMBeans
import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
* Deregister the MBeans for the specified Engine and its nested
* components.
*
* @param engine Engine for which to destroy MBeans
*
* @exception Exception if an exception is thrown during MBean destruction
*/
protected void destroyMBeans(Engine engine) throws Exception {
// Deregister ourselves as a ContainerListener
engine.removeContainerListener(this);
// Deregister the MBeans for each child Host
Container hosts[] = engine.findChildren();
for (int k = 0; k < hosts.length; k++) {
destroyMBeans((Host) hosts[k]);
}
// Deregister the MBeans for the associated nested components
Realm eRealm = engine.getRealm();
if (eRealm != null) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Realm " + eRealm);
//MBeanUtils.destroyMBean(eRealm);
}
// Deregister the MBean for the Engine itself
if (log.isDebugEnabled()) {
log.debug("Destroying MBean for Engine " + engine);
}
//MBeanUtils.destroyMBean(engine);
}
示例9: findDefaultHost
import org.apache.catalina.Engine; //导入方法依赖的package包/类
private void findDefaultHost() {
Engine engine = (Engine) connector.getService().getContainer();
String defaultHost = engine.getDefaultHost();
boolean found = false;
if (defaultHost != null && defaultHost.length() >0) {
Container[] containers = engine.findChildren();
for (Container container : containers) {
Host host = (Host) container;
if (defaultHost.equalsIgnoreCase(host.getName())) {
found = true;
break;
}
String[] aliases = host.findAliases();
for (String alias : aliases) {
if (defaultHost.equalsIgnoreCase(alias)) {
found = true;
break;
}
}
}
}
if(found) {
// localhost
mapper.setDefaultHostName(defaultHost);
} else {
log.warn(sm.getString("mapperListener.unknownDefaultHost",
defaultHost, connector));
}
}
示例10: findDefaultHost
import org.apache.catalina.Engine; //导入方法依赖的package包/类
private void findDefaultHost() {
Engine engine = (Engine) connector.getService().getContainer();
String defaultHost = engine.getDefaultHost();
boolean found = false;
if (defaultHost != null && defaultHost.length() > 0) {
Container[] containers = engine.findChildren();
for (Container container : containers) {
Host host = (Host) container;
if (defaultHost.equalsIgnoreCase(host.getName())) {
found = true;
break;
}
String[] aliases = host.findAliases();
for (String alias : aliases) {
if (defaultHost.equalsIgnoreCase(alias)) {
found = true;
break;
}
}
}
}
if (found) {
mapper.setDefaultHostName(defaultHost);
} else {
log.warn(sm.getString("mapperListener.unknownDefaultHost", defaultHost, connector));
}
}
示例11: registerListenersForEngine
import org.apache.catalina.Engine; //导入方法依赖的package包/类
private void registerListenersForEngine(Engine engine) {
for (Container hostContainer : engine.findChildren()) {
Host host = (Host) hostContainer;
host.addContainerListener(this);
registerListenersForHost(host);
}
}
示例12: createMBeans
import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
* Create the MBeans for the specified Engine and its nested components.
*
* @param engine Engine for which to create MBeans
*
* @exception Exception if an exception is thrown during MBean creation
*/
protected void createMBeans(Engine engine) throws Exception {
// Create the MBean for the Engine itself
if (debug >= 2) {
log("Creating MBean for Engine " + engine);
}
MBeanUtils.createMBean(engine);
engine.addContainerListener(this);
if (engine instanceof StandardEngine) {
((StandardEngine) engine).addPropertyChangeListener(this);
}
// Create the MBeans for the associated nested components
Logger eLogger = engine.getLogger();
if (eLogger != null) {
if (debug >= 2)
log("Creating MBean for Logger " + eLogger);
MBeanUtils.createMBean(eLogger);
}
Realm eRealm = engine.getRealm();
if (eRealm != null) {
if (debug >= 2)
log("Creating MBean for Realm " + eRealm);
MBeanUtils.createMBean(eRealm);
}
// Create the MBeans for the associated Valves
if (engine instanceof StandardEngine) {
Valve eValves[] = ((StandardEngine)engine).getValves();
for (int j = 0; j < eValves.length; j++) {
if (debug >= 2)
log("Creating MBean for Valve " + eValves[j]);
MBeanUtils.createMBean(eValves[j]);
}
}
// Create the MBeans for each child Host
Container hosts[] = engine.findChildren();
for (int j = 0; j < hosts.length; j++) {
createMBeans((Host) hosts[j]);
}
// Create the MBeans for DefaultContext
DefaultContext dcontext = engine.getDefaultContext();
if (dcontext != null) {
dcontext.setParent(engine);
createMBeans(dcontext);
}
}
示例13: destroyMBeans
import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
* Deregister the MBeans for the specified Engine and its nested
* components.
*
* @param engine Engine for which to destroy MBeans
*
* @exception Exception if an exception is thrown during MBean destruction
*/
protected void destroyMBeans(Engine engine) throws Exception {
// Deregister ourselves as a ContainerListener
engine.removeContainerListener(this);
// Deregister the MBeans for each child Host
Container hosts[] = engine.findChildren();
for (int k = 0; k < hosts.length; k++) {
destroyMBeans((Host) hosts[k]);
}
// Deregister the MBeans for the associated Valves
if (engine instanceof StandardEngine) {
Valve eValves[] = ((StandardEngine)engine).getValves();
for (int k = 0; k < eValves.length; k++) {
if (debug >= 3)
log("Destroying MBean for Valve " + eValves[k]);
MBeanUtils.destroyMBean(eValves[k], engine);
}
}
// Deregister the MBeans for the associated nested components
Realm eRealm = engine.getRealm();
if (eRealm != null) {
if (debug >= 3)
log("Destroying MBean for Realm " + eRealm);
MBeanUtils.destroyMBean(eRealm);
}
Logger eLogger = engine.getLogger();
if (eLogger != null) {
if (debug >= 3)
log("Destroying MBean for Logger " + eLogger);
MBeanUtils.destroyMBean(eLogger);
}
// Deregister the MBean for the Engine itself
if (debug >= 2) {
log("Destroying MBean for Engine " + engine);
}
MBeanUtils.destroyMBean(engine);
}