/** Init method, part of the MBean lifecycle. * If the container was added via JMX, it'll register itself with the * parent, using the ObjectName conventions to locate the parent. * * If the container was added directly and it doesn't have an ObjectName, * it'll create a name and register itself with the JMX console. On destroy(), * the object will unregister. * * @throws Exception */ public void init() throws Exception { if (org.apache.tomcat.util.Constants.ENABLE_MODELER) { if( this.getParent() == null ) { // "Life" update ObjectName parentName=getParentName(); if( parentName != null && mserver.isRegistered(parentName)) { mserver.invoke(parentName, "addChild", new Object[] { this }, new String[] {"org.apache.catalina.Container"}); } } } initialized=true; }
@Override protected String getDomainInternal() { Container p = this.getParent(); if (p == null) { return null; } else { return p.getDomain(); } }
@Override protected String getDomainInternal() { Container p = this.getParent(); if (p == null) { return null; } else { return p.getDomain(); } }
@Override protected String getDomainInternal() { Container p = this.getParent(); if (p == null) { return null; } else { return p.getDomain(); } }
@Override public final String toString() { StringBuilder sb = new StringBuilder(); Container parent = getParent(); if (parent != null) { sb.append(parent.toString()); sb.append('.'); } sb.append(this.getClass().getSimpleName()); sb.append('['); sb.append(getName()); sb.append(']'); return sb.toString(); }
@Override public final String toString() { StringBuilder sb = new StringBuilder(); Container parent = getParent(); if (parent != null) { sb.append(parent.toString()); sb.append('.'); } sb.append(this.getClass().getSimpleName()); sb.append('['); sb.append(getName()); sb.append(']'); return sb.toString(); }
/** * Set the resources DirContext object with which this Container is * associated. * * @param resources The newly associated DirContext */ public synchronized void setResources(DirContext resources) { // Called from StandardContext.setResources() // <- StandardContext.start() // <- ContainerBase.addChildInternal() // Change components if necessary DirContext oldResources = this.resources; if (oldResources == resources) return; Hashtable env = new Hashtable(); if (getParent() != null) env.put(ProxyDirContext.HOST, getParent().getName()); env.put(ProxyDirContext.CONTEXT, getName()); this.resources = new ProxyDirContext(env, resources); // Report this property change to interested listeners support.firePropertyChange("resources", oldResources, this.resources); }
/** * Set the resources DirContext object with which this Container is * associated. * * @param resources The newly associated DirContext */ public synchronized void setResources(DirContext resources) { // Called from StandardContext.setResources() // <- StandardContext.start() // <- ContainerBase.addChildInternal() // Change components if necessary DirContext oldResources = this.resources; if (oldResources == resources) return; Hashtable env = new Hashtable(); if (getParent() != null) env.put(ProxyDirContext.HOST, getParent().getName()); env.put(ProxyDirContext.CONTEXT, getName()); this.resources = new ProxyDirContext(env, resources); // Report this property change to interested listeners support.firePropertyChange("resources", oldResources, this.resources); }
/** * Set the resources DirContext object with which this Container is * associated. * * @param resources The newly associated DirContext */ @Override public synchronized void setResources(DirContext resources) { // Called from StandardContext.setResources() // <- StandardContext.start() // <- ContainerBase.addChildInternal() // Change components if necessary DirContext oldResources = this.resources; if (oldResources == resources) return; Hashtable<String, String> env = new Hashtable<String, String>(); if (getParent() != null) env.put(ProxyDirContext.HOST, getParent().getName()); env.put(ProxyDirContext.CONTEXT, getName()); this.resources = new ProxyDirContext(env, resources); // Report this property change to interested listeners support.firePropertyChange("resources", oldResources, this.resources); }
/** * Set the resources DirContext object with which this Container is * associated. * * @param resources The newly associated DirContext */ @Override public synchronized void setResources(DirContext resources) { // Called from StandardContext.setResources() // <- StandardContext.start() // <- ContainerBase.addChildInternal() // Change components if necessary DirContext oldResources = this.resources; if (oldResources == resources) return; Hashtable<String, String> env = new Hashtable<String, String>(); if (getParent() != null) env.put(ProxyDirContext.HOST, getParent().getName()); env.put(ProxyDirContext.CONTEXT, getName()); this.resources = new ProxyDirContext(env, resources); // Report this property change to interested listeners support.firePropertyChange("resources", oldResources, this.resources); }
/** * Set the resources DirContext object with which this Container is * associated. * * @param resources The newly associated DirContext */ public synchronized void setResources(DirContext resources) { // Called from StandardContext.setResources() // <- StandardContext.start() // <- ContainerBase.addChildInternal() // Change components if necessary DirContext oldResources = this.resources; if (oldResources == resources) return; Hashtable env = new Hashtable(); if (getParent() != null) env.put(ProxyDirContext.HOST, getParent().getName()); env.put(ProxyDirContext.CONTEXT, getName()); this.resources = new ProxyDirContext(env, resources); // Report this property change to interested listeners support.firePropertyChange("resources", oldResources, this.resources); }
/** * Set the resources DirContext object with which this Container is * associated. * * @param resources The newly associated DirContext */ @Override public synchronized void setResources(DirContext resources) { // Called from StandardContext.setResources() // <- StandardContext.start() // <- ContainerBase.addChildInternal() // Change components if necessary DirContext oldResources = this.resources; if (oldResources == resources) return; Hashtable<String, String> env = new Hashtable<String, String>(); if (getParent() != null) env.put(ProxyDirContext.HOST, getParent().getName()); env.put(ProxyDirContext.CONTEXT, getName()); this.resources = new ProxyDirContext(env, resources); // Report this property change to interested listeners support.firePropertyChange("resources", oldResources, this.resources); }
/** * Check this container for an access log and if none is found, look to the * parent. If there is no parent and still none is found, use the NoOp * access log. */ @Override public void logAccess(Request request, Response response, long time, boolean useDefault) { boolean logged = false; if (getAccessLog() != null) { getAccessLog().log(request, response, time); logged = true; } if (getParent() != null) { // No need to use default logger once request/response has been logged // once getParent().logAccess(request, response, time, (useDefault && !logged)); } }
/** * Check this container for an access log and if none is found, look to the * parent. If there is no parent and still none is found, use the NoOp * access log. */ @Override public void logAccess(Request request, Response response, long time, boolean useDefault) { boolean logged = false; if (getAccessLog() != null) { getAccessLog().log(request, response, time); logged = true; } if (getParent() != null) { // No need to use default logger once request/response has been logged // once getParent().logAccess(request, response, time, (useDefault && !logged)); } }
/** * Check this container for an access log and if none is found, look to the * parent. If there is no parent and still none is found, use the NoOp * access log. */ @Override public void logAccess(Request request, Response response, long time, boolean useDefault) { boolean logged = false; if (getAccessLog() != null) { getAccessLog().log(request, response, time); logged = true; } if (getParent() != null) { // No need to use default logger once request/response has been logged // once getParent().logAccess(request, response, time, (useDefault && !logged)); } }
/** * Check this container for an access log and if none is found, look to the * parent. If there is no parent and still none is found, use the NoOp * access log. */ @Override public void logAccess(Request request, Response response, long time, boolean useDefault) { boolean logged = false; if (getAccessLog() != null) { getAccessLog().log(request, response, time); logged = true; } if (getParent() != null) { // No need to use default logger once request/response has been logged // once getParent().logAccess(request, response, time, (useDefault && !logged)); } }
/** * Check this container for an access log and if none is found, look to the * parent. If there is no parent and still none is found, use the NoOp * access log. */ @Override public void logAccess(Request request, Response response, long time, boolean useDefault) { boolean logged = false; if (getAccessLog() != null) { getAccessLog().log(request, response, time); logged = true; } if (getParent() != null) { // No need to use default logger once request/response has been logged // once getParent().logAccess(request, response, time, (useDefault && !logged)); } }
/** * Check this container for an access log and if none is found, look to the * parent. If there is no parent and still none is found, use the NoOp * access log. */ @Override public void logAccess(Request request, Response response, long time, boolean useDefault) { boolean logged = false; if (getAccessLog() != null) { getAccessLog().log(request, response, time); logged = true; } if (getParent() != null) { // No need to use default logger once request/response has been logged // once getParent().logAccess(request, response, time, (useDefault && !logged)); } }
/** * Check this container for an access log and if none is found, look to the * parent. If there is no parent and still none is found, use the NoOp * access log. */ @Override public void logAccess(Request request, Response response, long time, boolean useDefault) { boolean logged = false; if (getAccessLog() != null) { getAccessLog().log(request, response, time); logged = true; } if (getParent() != null) { // No need to use default logger once request/response has been logged // once getParent().logAccess(request, response, time, (useDefault && !logged)); } }
/** * Check this container for an access log and if none is found, look to the * parent. If there is no parent and still none is found, use the NoOp * access log. */ @Override public void logAccess(Request request, Response response, long time, boolean useDefault) { boolean logged = false; if (getAccessLog() != null) { getAccessLog().log(request, response, time); logged = true; } if (getParent() != null) { // No need to use default logger once request/response has been logged // once getParent().logAccess(request, response, time, (useDefault && !logged)); } }