本文整理汇总了Java中org.apache.catalina.Engine.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Engine.getName方法的具体用法?Java Engine.getName怎么用?Java Engine.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.Engine
的用法示例。
在下文中一共展示了Engine.getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: destroyMBean
import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
* Deregister the MBean for this
* <code>Engine</code> object.
*
* @param engine The Engine to be managed
*
* @exception Exception if an MBean cannot be deregistered
*
* @deprecated Unused. Will be removed in Tomcat 8.0.x
*/
@Deprecated
static void destroyMBean(Engine engine)
throws Exception {
String domain = engine.getName();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, engine);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
}
示例2: start
import org.apache.catalina.Engine; //导入方法依赖的package包/类
@Override
public void start() throws Exception {
if (started)
return;
Container hcontainer = getCluster().getContainer();
if(!(hcontainer instanceof Host)) {
log.error(sm.getString("farmWarDeployer.hostOnly"));
return ;
}
host = (Host) hcontainer;
// Check to correct engine and host setup
Container econtainer = host.getParent();
if(!(econtainer instanceof Engine)) {
log.error(sm.getString("farmWarDeployer.hostParentEngine",
host.getName()));
return ;
}
Engine engine = (Engine) econtainer;
String hostname = null;
hostname = host.getName();
try {
oname = new ObjectName(engine.getName() + ":type=Deployer,host="
+ hostname);
} catch (Exception e) {
log.error(sm.getString("farmWarDeployer.mbeanNameFail",
engine.getName(), hostname),e);
return;
}
if (watchEnabled) {
watcher = new WarWatcher(this, getWatchDirFile());
if (log.isInfoEnabled()) {
log.info(sm.getString(
"farmWarDeployer.watchDir", getWatchDir()));
}
}
if (host.getXmlBase()!=null) {
configBase = getAbsolutePath(host.getXmlBase());
} else {
StringBuilder xmlDir = new StringBuilder("conf");
xmlDir.append('/');
xmlDir.append(engine.getName());
xmlDir.append('/');
xmlDir.append(host.getName());
configBase = getAbsolutePath(xmlDir.toString());
}
// Retrieve the MBean server
mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
started = true;
count = 0;
getCluster().addClusterListener(this);
if (log.isInfoEnabled())
log.info(sm.getString("farmWarDeployer.started"));
}
示例3: start
import org.apache.catalina.Engine; //导入方法依赖的package包/类
@Override
public void start() throws Exception {
if (started)
return;
Container hcontainer = getCluster().getContainer();
if (!(hcontainer instanceof Host)) {
log.error(sm.getString("farmWarDeployer.hostOnly"));
return;
}
host = (Host) hcontainer;
// Check to correct engine and host setup
Container econtainer = host.getParent();
if (!(econtainer instanceof Engine)) {
log.error(sm.getString("farmWarDeployer.hostParentEngine", host.getName()));
return;
}
Engine engine = (Engine) econtainer;
String hostname = null;
hostname = host.getName();
try {
oname = new ObjectName(engine.getName() + ":type=Deployer,host=" + hostname);
} catch (Exception e) {
log.error(sm.getString("farmWarDeployer.mbeanNameFail", engine.getName(), hostname), e);
return;
}
if (watchEnabled) {
watcher = new WarWatcher(this, getWatchDirFile());
if (log.isInfoEnabled()) {
log.info(sm.getString("farmWarDeployer.watchDir", getWatchDir()));
}
}
if (host.getXmlBase() != null) {
configBase = getAbsolutePath(host.getXmlBase());
} else {
StringBuilder xmlDir = new StringBuilder("conf");
xmlDir.append('/');
xmlDir.append(engine.getName());
xmlDir.append('/');
xmlDir.append(host.getName());
configBase = getAbsolutePath(xmlDir.toString());
}
// Retrieve the MBean server
mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
started = true;
count = 0;
getCluster().addClusterListener(this);
if (log.isInfoEnabled())
log.info(sm.getString("farmWarDeployer.started"));
}
示例4: destroyMBean
import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
* Deregister the MBean for this <code>Engine</code> object.
*
* @param engine
* The Engine to be managed
*
* @exception Exception
* if an MBean cannot be deregistered
*
* @deprecated Unused. Will be removed in Tomcat 8.0.x
*/
@Deprecated
static void destroyMBean(Engine engine) throws Exception {
String domain = engine.getName();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, engine);
if (mserver.isRegistered(oname))
mserver.unregisterMBean(oname);
}