org.apache.catalina.Engine.getRealm()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(10.4k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.apache.catalina.Engine.getRealm()方法的一些代码示例,展示了Engine.getRealm()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Engine.getRealm()方法的具体详情如下:
包路径:org.apache.catalina.Engine
类名称:Engine
方法名:getRealm

Engine.getRealm介绍

暂无

代码示例

代码示例来源:origin: line/armeria

if (expectedEngine.getRealm() != config.realm()) {
  throw new TomcatServiceException("A configurator should never change the default realm.");

代码示例来源:origin: org.apache.tomee/tomee-catalina

public TomcatSecurityService() {
  final Server server = TomcatHelper.getServer();
  for (final Service service : server.findServices()) {
    if (service.getContainer() instanceof Engine) {
      final Engine engine = (Engine) service.getContainer();
      if (engine.getRealm() != null) {
        defaultRealm = engine.getRealm();
        break;
      }
    }
  }
}

代码示例来源:origin: org.apache.openejb/openejb-tomcat-catalina

public TomcatSecurityService() {
  Server server = ServerFactory.getServer();
  for (Service service : server.findServices()) {
    if (service.getContainer() instanceof Engine) {
      Engine engine = (Engine) service.getContainer();
      if (engine.getRealm() != null) {
        defaultRealm = engine.getRealm();
        break;
      }
    }
  }
}

代码示例来源:origin: org.apache.openejb/tomee-catalina

public TomcatSecurityService() {
  Server server = TomcatHelper.getServer();
  for (Service service : server.findServices()) {
    if (service.getContainer() instanceof Engine) {
      Engine engine = (Engine) service.getContainer();
      if (engine.getRealm() != null) {
        defaultRealm = engine.getRealm();
        break;
      }
    }
  }
}

代码示例来源:origin: tomcat/catalina

/**
 * 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);
}

代码示例来源:origin: tomcat/catalina

/**
 * 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]);
  }
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat

private void addHost(ObjectRetriever objRetriever) {
  Host host = (Host)objRetriever.getInternalObject();
  //If we didn't set a realm, then use the default
  if (host.getRealm() == null) {
    host.setRealm(engine.getRealm());
  }
  engine.addChild(host);
}

代码示例来源:origin: org.apache.tomee/tomee-catalina

private void addTomEERealm(final Engine engine) {
  final Realm realm = engine.getRealm();
  if (realm != null && !(realm instanceof TomEERealm) && (engine.getParent() == null || (!realm.equals(engine.getParent().getRealm())))) {
    final Realm tomeeRealm = tomeeRealm(realm);
    engine.setRealm(tomeeRealm);
    if (LifecycleState.STARTING_PREP.equals(engine.getState())) {
      try {
        Lifecycle.class.cast(tomeeRealm).start();
      } catch (final LifecycleException e) {
        throw new IllegalStateException(e);
      }
    }
  }
}

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

public void setUp(@Observes final ContainerStarted ignored) {
  final StandardServer server = TomcatHelper.getServer();
  if (server == null) {
    return;
  }
  for (final Service service : server.findServices()) {
    if (Engine.class.isInstance(service.getContainer())) {
      final Engine engine = Engine.class.cast(service.getContainer());
      final Realm engineRealm = engine.getRealm();
      addTracker(engineRealm);
      engine.getPipeline().addValve(new TrackerValve());
      for (final Container engineChild : engine.findChildren()) { // we suppose we dont add host dynamically with such an algo ()case in tomee)
        if (Host.class.isInstance(engineChild)) {
          final Host host = Host.class.cast(engineChild);
          host.addContainerListener(new HostListener());
          final Realm hostRealm = host.getRealm();
          if (hostRealm == engineRealm || TrackerRealm.class.isInstance(host)) {
            continue;
          }
          addTracker(hostRealm);
        }
      }
    }
  }
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * 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);
}

代码示例来源:origin: Red5/red5-plugins

rtmptEngine.setName("red5RTMPTEngine");
rtmptEngine.setDefaultHost(host.getName());
rtmptEngine.setRealm(embedded.getEngine().getRealm());

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * 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]);
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * 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);
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * 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]);
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * 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);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * 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]);
  }
}

代码示例来源:origin: Red5/red5-plugins

rtmpsEngine.setName("red5RTMPSEngine");
rtmpsEngine.setDefaultHost(host.getName());
rtmpsEngine.setRealm(embedded.getEngine().getRealm());

相关文章