@Override public Principal readPrincipal( final ObjectInputStream ois ) throws ClassNotFoundException, IOException { return SerializablePrincipal.readPrincipal( ois, getContainer().getRealm() ); }
/** * Return the Realm with which this Container is associated. If there is * no associated Realm, return the Realm associated with our parent * Container (if any); otherwise return <code>null</code>. */ public Realm getRealm() { if (realm != null) return (realm); if (parent != null) return (parent.getRealm()); return (null); }
/** * Return the Realm with which this Container is associated. If there is * no associated Realm, return the Realm associated with our parent * Container (if any); otherwise return <code>null</code>. */ public Realm getRealm() { if (realm != null) return (realm); if (parent != null) return (parent.getRealm()); return (null); }
/** * Return the Realm with which this Container is associated. If there is * no associated Realm, return the Realm associated with our parent * Container (if any); otherwise return <code>null</code>. */ public Realm getRealm() { if (realm != null) return (realm); if (parent != null) return (parent.getRealm()); return (null); }
public Realm getRealm() { if (realm != null) return realm; if (parent != null){ Realm configured = parent.getRealm(); if (configured != null) return configured; } return null; } }
/** * Return the Realm with which this Container is associated. If there is * no associated Realm, return the Realm associated with our parent * Container (if any); otherwise return <code>null</code>. */ @Override public Realm getRealm() { if (realm != null) return (realm); if (parent != null) return (parent.getRealm()); return (null); }
/** * Return the Realm with which this Container is associated. If there is * no associated Realm, return the Realm associated with our parent * Container (if any); otherwise return <code>null</code>. */ @Override public Realm getRealm() { if (realm != null) return (realm); if (parent != null) return (parent.getRealm()); return (null); }
/** * Return the Realm with which this Container is associated. If there is * no associated Realm, return the Realm associated with our parent * Container (if any); otherwise return <code>null</code>. */ @Override public Realm getRealm() { if (realm != null) return (realm); if (parent != null) return (parent.getRealm()); return (null); }
/** * Return the Realm with which this Container is associated. If there is * no associated Realm, return the Realm associated with our parent * Container (if any); otherwise return <code>null</code>. */ public Realm getRealm() { try { readLock.lock(); if (realm != null) return (realm); } finally { readLock.unlock(); } if (parent != null) return (parent.getRealm()); return (null); }
/** * Return the Realm with which this Container is associated. If there is * no associated Realm, return the Realm associated with our parent * Container (if any); otherwise return <code>null</code>. */ @Override public Realm getRealm() { Lock l = realmLock.readLock(); l.lock(); try { if (realm != null) return realm; if (parent != null) return parent.getRealm(); return null; } finally { l.unlock(); } }
/** * Return the Realm with which this Container is associated. If there is * no associated Realm, return the Realm associated with our parent * Container (if any); otherwise return <code>null</code>. */ @Override public Realm getRealm() { Lock l = realmLock.readLock(); try { l.lock(); if (realm != null) return (realm); if (parent != null) return (parent.getRealm()); return null; } finally { l.unlock(); } }
/** * Return the Realm with which this Container is associated. If there is * no associated Realm, return the Realm associated with our parent * Container (if any); otherwise return <code>null</code>. */ @Override public Realm getRealm() { Lock l = realmLock.readLock(); try { l.lock(); if (realm != null) return (realm); if (parent != null) return (parent.getRealm()); return null; } finally { l.unlock(); } }
public boolean authorize(Principal principal, List roles) { Realm realm = container.getRealm(); Iterator iter = roles.iterator(); while (iter.hasNext()) { String role = (String)iter.next(); if (realm.hasRole(principal, role)) return true; } return false; }
public boolean authorize(Principal principal, List roles) { Realm realm = container.getRealm(); Iterator iter = roles.iterator(); while (iter.hasNext()) { String role = (String)iter.next(); if (realm.hasRole(principal, role)) return true; } return false; }
@Override public void lifecycleEvent(LifecycleEvent lifecycleEvent) { Lifecycle lifecycle = lifecycleEvent.getLifecycle(); if (Lifecycle.AFTER_START_EVENT.equals(lifecycleEvent.getType())) { if (lifecycle instanceof Container) { TomcatRealmLoginModule.setRealm(((Container) lifecycle).getRealm()); } } } }
@Override public void containerEvent(final ContainerEvent event) { if (Context.class.isInstance(event.getData()) && Container.ADD_CHILD_EVENT.equals(event.getType())) { final Context context = Context.class.cast(event.getData()); if (context.getRealm() != context.getParent().getRealm()) { addTracker(context.getRealm()); } } } }
@Init() public void init() { realm = connectorService.getConnector().getContainer().getRealm(); }
private void addTomEERealm(final Host host) { final Realm realm = host.getRealm(); if (realm != null && !(realm instanceof TomEERealm) && (host.getParent() == null || (!realm.equals(host.getParent().getRealm())))) { host.setRealm(tomeeRealm(realm)); } }
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 Realm getRealm() { if (realm != null) return realm; if (parent != null){ Realm configured = parent.getRealm(); if (configured != null) return configured; } //No realms found up the chain, so lets create a default JAAS Realm TomcatJAASRealm defaultRealm = new TomcatJAASRealm(); defaultRealm.setUserClassNames("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"); defaultRealm.setRoleClassNames("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"); this.setRealm(defaultRealm); return defaultRealm; } }