本文整理了Java中org.apache.catalina.Engine.getName()
方法的一些代码示例,展示了Engine.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Engine.getName()
方法的具体详情如下:
包路径:org.apache.catalina.Engine
类名称:Engine
方法名:getName
暂无
代码示例来源:origin: org.springframework.boot/spring-boot
private void addInstanceIdToEngineName() {
int instanceId = containerCounter.incrementAndGet();
if (instanceId > 0) {
Engine engine = this.tomcat.getEngine();
engine.setName(engine.getName() + "-" + instanceId);
}
}
代码示例来源:origin: line/armeria
void start() throws Exception {
assert hostName() != null;
started = false;
connector = connectorFactory.apply(hostName());
final Service service = connector.getService();
final Engine engine = TomcatUtil.engine(service, hostName());
final String engineName = engine.getName();
if (activeEngines.contains(engineName)) {
throw new TomcatServiceException("duplicate engine name: " + engineName);
}
server = service.getServer();
if (!TOMCAT_START_STATES.contains(server.getState())) {
logger.info("Starting an embedded Tomcat: {}", toString(server));
server.start();
started = true;
} else {
throw new TomcatServiceException("Cannot manage already running server: " + engineName);
}
activeEngines.add(engineName);
this.engineName = engineName;
}
代码示例来源:origin: line/armeria
if (!config.engineName().equals(expectedEngine.getName())) {
throw new TomcatServiceException(
"A configurator should never change the name of the default engine.");
代码示例来源:origin: org.jboss.mod_cluster/mod_cluster
/**
* {@inhericDoc}
* @see java.lang.Object#toString()
*/
public String toString()
{
return this.engine.getName();
}
}
代码示例来源:origin: org.jboss.mod_cluster/mod_cluster
/**
* {@inhericDoc}
* @see org.jboss.modcluster.Engine#getName()
*/
public String getName()
{
return this.engine.getName();
}
代码示例来源:origin: modcluster/mod_cluster
@Override
public String toString() {
return this.engine.getName();
}
}
代码示例来源:origin: modcluster/mod_cluster
@Override
public String getName() {
return this.engine.getName();
}
代码示例来源:origin: org.jboss.jbossas/jboss-as-tomcat
@Override
public String getEngineName()
{
return this.getEngine().getName();
}
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
/**
* Get config base.
*/
protected File getConfigBase(String hostName) {
File configBase =
new File(System.getProperty(Globals.CATALINA_BASE_PROP), "conf");
if (!configBase.exists()) {
return null;
}
if (engine != null) {
configBase = new File(configBase, engine.getName());
}
if (installedHost != null) {
configBase = new File(configBase, hostName);
}
if (!configBase.mkdirs() && !configBase.isDirectory()) {
return null;
}
return configBase;
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
/**
* Get config base.
*/
protected File getConfigBase(String hostName) {
File configBase =
new File(System.getProperty(Globals.CATALINA_BASE_PROP), "conf");
if (!configBase.exists()) {
return null;
}
if (engine != null) {
configBase = new File(configBase, engine.getName());
}
if (installedHost != null) {
configBase = new File(configBase, hostName);
}
if (!configBase.mkdirs() && !configBase.isDirectory()) {
return null;
}
return configBase;
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Get config base.
*/
protected File getConfigBase(String hostName) {
File configBase = new File(context.getCatalinaBase(), "conf");
if (!configBase.exists()) {
return null;
}
if (engine != null) {
configBase = new File(configBase, engine.getName());
}
if (installedHost != null) {
configBase = new File(configBase, hostName);
}
if (!configBase.mkdirs() && !configBase.isDirectory()) {
return null;
}
return configBase;
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* Get config base.
* @param hostName The host name
* @return the config base for the host
*/
protected File getConfigBase(String hostName) {
File configBase = new File(context.getCatalinaBase(), "conf");
if (!configBase.exists()) {
return null;
}
if (engine != null) {
configBase = new File(configBase, engine.getName());
}
if (installedHost != null) {
configBase = new File(configBase, hostName);
}
if (!configBase.mkdirs() && !configBase.isDirectory()) {
return null;
}
return configBase;
}
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
/**
* 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);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
/**
* Deregister the MBean for this
* <code>Engine</code> object.
*
* @param engine The Engine to be managed
*
* @exception Exception if an MBean cannot be deregistered
*/
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);
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
/**
* Deregister the MBean for this
* <code>Engine</code> object.
*
* @param engine The Engine to be managed
*
* @exception Exception if an MBean cannot be deregistered
*/
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);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
/**
* Deregister the MBean for this
* <code>Engine</code> object.
*
* @param engine The Engine to be managed
*
* @exception Exception if an MBean cannot be deregistered
*/
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);
}
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
/**
* 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);
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* Render a list of the currently active Contexts in our virtual host.
*
* @param writer Writer to render to
* @param smClient StringManager for the client's locale
*/
protected void list(PrintWriter writer, StringManager smClient) {
if (debug >= 1) {
log(sm.getString("hostManagerServlet.list", engine.getName()));
}
writer.println(smClient.getString("hostManagerServlet.listed",
engine.getName()));
Container[] hosts = engine.findChildren();
for (int i = 0; i < hosts.length; i++) {
Host host = (Host) hosts[i];
String name = host.getName();
String[] aliases = host.findAliases();
writer.println(smClient.getString("hostManagerServlet.listitem",
name, StringUtils.join(aliases)));
}
}
代码示例来源:origin: stackoverflow.com
public static void main(String[] args){
Engine eng1 = new Engine("abc");
Car car1 = new Car();
car1.setEngine(eng1);
Car car2 = new Car();
car2.setEngine(car1.getEngine());
//additional code to show the last statement
car2.getEngine().setName("foo");
System.out.println(car2.getEngine().getName()); //prints "foo"
System.out.println(car1.getEngine().getName()); //prints "foo" too
System.out.println(eng1.getName()); //prints "foo" since it is the same object reference used from the beginning
}
代码示例来源:origin: modcluster/mod_cluster
@Test
public void getName() {
String expected = "name";
when(this.engine.getName()).thenReturn(expected);
String result = this.catalinaEngine.getName();
assertSame(expected, result);
}
内容来源于网络,如有侵权,请联系作者删除!