本文整理汇总了Java中org.apache.catalina.Engine.getRealm方法的典型用法代码示例。如果您正苦于以下问题:Java Engine.getRealm方法的具体用法?Java Engine.getRealm怎么用?Java Engine.getRealm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.Engine
的用法示例。
在下文中一共展示了Engine.getRealm方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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]);
}
}
示例2: 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);
}
示例3: getTomcatContextRealm
import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
*
* @return Tomcat Realms
* @throws AttributeNotFoundException
* @throws InstanceNotFoundException
* @throws MBeanException
* @throws ReflectionException
*/
public Realm getTomcatContextRealm() throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException {
try {
ObjectName name = new ObjectName("Catalina", "type", "Engine");
Engine engine = (Engine) JwalaAuthenticationProvider.getmBeanServer().getAttribute(name, "managedResource");
return engine.getRealm();
} catch (MalformedObjectNameException ex) {
LOGGER.error("Invalid Realm", ex);
}
return null;
}
示例4: 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);
}
}
示例5: 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);
}