if (expectedEngine.getRealm() != config.realm()) { throw new TomcatServiceException("A configurator should never change the default realm.");
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; } } } }
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; } } } }
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; } } } }
/** * 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); }
/** * 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]); } }
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); }
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); } } } }
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); } } } } }
/** * 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); }
rtmptEngine.setName("red5RTMPTEngine"); rtmptEngine.setDefaultHost(host.getName()); rtmptEngine.setRealm(embedded.getEngine().getRealm());
/** * 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]); } }
/** * 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); }
/** * 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]); } }
/** * 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); }
/** * 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]); } }
rtmpsEngine.setName("red5RTMPSEngine"); rtmpsEngine.setDefaultHost(host.getName()); rtmpsEngine.setRealm(embedded.getEngine().getRealm());