private void configureEngine(Engine engine) { if (userName != null && password != null) { InMemoryRealm realm = new InMemoryRealm(); realm.addUser(userName, password); engine.setRealm(realm); } }
/** * Returns the {@link Engine} of the specified Tomcat {@link Service}. If the {@link Service} has no * {@link Engine} set, a new {@link Engine} will be created and set. * * <p>The return type of {@link Service#getContainer()} has been changed from {@link Container} to * {@link Engine} since 8.5. Calling it directly will cause {@link NoSuchMethodError}. */ static Engine engine(Service service, String hostname) { final Engine engine; try { final Method m = Service.class.getDeclaredMethod("getContainer"); engine = (Engine) m.invoke(service); } catch (Exception e) { throw new Error("failed to invoke Service.getContainer()", e); } if (engine != null) { return engine; } // Create a new engine. final Engine newEngine = new StandardEngine(); newEngine.setName("Tomcat"); newEngine.setDefaultHost(hostname); newEngine.setRealm(new NullRealm()); service.setContainer(newEngine); return newEngine; }
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); } } } }
private void configureEngine(Engine engine) { String userName = config.getUserName(); String password = config.getPassword(); if (userName != null && password != null) { InMemoryRealm realm = new InMemoryRealm(); realm.addUser(userName, password); engine.setRealm(realm); } }
/** * Access to the engine, for further customization. */ public Engine getEngine() { if(engine == null ) { getServer(); engine = new StandardEngine(); engine.setName( "Tomcat" ); engine.setDefaultHost(hostname); engine.setRealm(createDefaultRealm()); service.setContainer(engine); } return engine; }
engine.setRealm(realm);
/** * Access to the engine, for further customization. */ public Engine getEngine() { if(engine == null ) { getServer(); engine = new StandardEngine(); engine.setName( "Tomcat" ); engine.setDefaultHost(hostname); if (defaultRealm == null) { initSimpleAuth(); } engine.setRealm(defaultRealm); service.setContainer(engine); } return engine; }
/** * Access to the engine, for further customization. */ public Engine getEngine() { if(engine == null ) { getServer(); engine = new StandardEngine(); engine.setName( "Tomcat" ); engine.setDefaultHost(hostname); if (defaultRealm == null) { initSimpleAuth(); } engine.setRealm(defaultRealm); service.setContainer(engine); } return engine; }
engine.setRealm((Realm)realmGBean.getInternalObject());
tomcat.getEngine().setRealm(configuration.realm);
/** * Access to the engine, for further customization. * @return The engine */ public Engine getEngine() { Service service = getServer().findServices()[0]; if (service.getContainer() != null) { return service.getContainer(); } Engine engine = new StandardEngine(); engine.setName( "Tomcat" ); engine.setDefaultHost(hostname); engine.setRealm(createDefaultRealm()); service.setContainer(engine); return engine; }
/** * Access to the engine, for further customization. * @return The engine */ public Engine getEngine() { Service service = getServer().findServices()[0]; if (service.getContainer() != null) { return service.getContainer(); } Engine engine = new StandardEngine(); engine.setName( "Tomcat" ); engine.setDefaultHost(hostname); engine.setRealm(createDefaultRealm()); service.setContainer(engine); return engine; }
engine.setRealm((org.apache.catalina.Realm) getInstance(engineMetaData.getRealm(), null));
ctxRes.setProperty("pathname", tomcatUsersLocation); tomcat.getServer().getGlobalNamingResources().addResource(ctxRes); tomcat.getEngine().setRealm(new org.apache.catalina.realm.UserDatabaseRealm());
ctxRes.setProperty("pathname", tomcatUsersLocation); tomcat.getServer().getGlobalNamingResources().addResource(ctxRes); tomcat.getEngine().setRealm(new org.apache.catalina.realm.UserDatabaseRealm());
rtmptEngine.setName("red5RTMPTEngine"); rtmptEngine.setDefaultHost(host.getName()); rtmptEngine.setRealm(embedded.getEngine().getRealm());
embeddedTomcat.getEngine().setRealm( memoryRealm );
engine.setRealm(JACCRealm.INSTANCE);
rtmpsEngine.setName("red5RTMPSEngine"); rtmpsEngine.setDefaultHost(host.getName()); rtmpsEngine.setRealm(embedded.getEngine().getRealm());