/** * Returns the security token required to bind to a naming context. * * @param context the catalina context * * @return the security token for use with <code>ContextBindings</code> */ @Override protected Object getNamingToken(Context context) { // null token worked before 8.0.6 Object token = null; if (!ContextAccessController.checkSecurityToken(context, token)) { // namingToken added to Context and Server interfaces in 8.0.6 // Used by NamingContextListener when setting up JNDI context token = context.getNamingToken(); if (!ContextAccessController.checkSecurityToken(context, token)) { logger.error("Couldn't get a valid security token. ClassLoader binding will fail."); } } return token; }
/** * Returns true if writing is allowed on this context. */ protected boolean isWritable() { return ContextAccessController.isWritable(name); }
/** * Process property change events. * * @param event The property change event that has occurred */ public void propertyChange(PropertyChangeEvent event) { if (!initialized) return; Object source = event.getSource(); if (source == namingResources) { // Setting the context in read/write mode ContextAccessController.setWritable(getName(), container); processGlobalResourcesChange(event.getPropertyName(), event.getOldValue(), event.getNewValue()); // Setting the context in read only mode ContextAccessController.setReadOnly(getName()); } }
ContextAccessController.setSecurityToken(getName(), container); ContextBindings.bindContext(container, namingContext, container); if (log.isLoggable(Level.FINE)) { ContextAccessController.setWritable(getName(), container); ContextAccessController.setReadOnly(getName()); try { ContextBindings.bindClassLoader ContextAccessController.setWritable(getName(), container); ContextBindings.unbindContext(container, container); ContextAccessController.unsetSecurityToken(getName(), container);
@Override public void lifecycleEvent(LifecycleEvent event) { final String type = event.getType(); final StandardContext source = (StandardContext) event.getSource(); if (source.getNamingContextListener() == null) { namingContextListener.setName(source.getName()); source.setNamingContextListener(namingContextListener); } namingContextListener.lifecycleEvent(event); if (Lifecycle.CONFIGURE_START_EVENT.equals(type)) { final Object token = event.getLifecycle(); ContextAccessController.setWritable(namingContextListener.getName(), token); } }
/** * Process property change events. * * @param event The property change event that has occurred */ @Override public void propertyChange(PropertyChangeEvent event) { if (!initialized) return; Object source = event.getSource(); if (source == namingResources) { // Setting the context in read/write mode ContextAccessController.setWritable(getName(), container); processGlobalResourcesChange(event.getPropertyName(), event.getOldValue(), event.getNewValue()); // Setting the context in read only mode ContextAccessController.setReadOnly(getName()); } }
ContextAccessController.setSecurityToken(getName(), container); ContextBindings.bindContext(container, namingContext, container); if( log.isDebugEnabled() ) { ContextAccessController.setWritable(getName(), container); ContextAccessController.setReadOnly(getName()); try { ContextBindings.bindClassLoader ContextAccessController.setWritable(getName(), container); ContextBindings.unbindContext(container, container); ContextAccessController.unsetSecurityToken(getName(), container);
/** * Process property change events. * * @param event The property change event that has occurred */ @Override public void propertyChange(PropertyChangeEvent event) { if (!initialized) return; Object source = event.getSource(); if (source == namingResources) { // Setting the context in read/write mode ContextAccessController.setWritable(getName(), container); processGlobalResourcesChange(event.getPropertyName(), event.getOldValue(), event.getNewValue()); // Setting the context in read only mode ContextAccessController.setReadOnly(getName()); } }
Hashtable<String, Object> contextEnv = new Hashtable<>(); namingContext = new NamingContext(contextEnv, getName()); ContextAccessController.setSecurityToken(getName(), token); ContextAccessController.setSecurityToken(container, token); ContextBindings.bindContext(container, namingContext, token); if( log.isDebugEnabled() ) { ContextAccessController.setWritable(getName(), token); ContextAccessController.setReadOnly(getName()); try { ContextBindings.bindClassLoader(container, token, ContextAccessController.setWritable(getName(), token); ContextBindings.unbindContext(container, token); ContextAccessController.unsetSecurityToken(getName(), token); ContextAccessController.unsetSecurityToken(container, token);
/** * Returns the security token required to bind to a naming context. * * @param context the catalina context * * @return the security token for use with <code>ContextBindings</code> */ @Override protected Object getNamingToken(Context context) { // Used by NamingContextListener when setting up JNDI context Object token = context.getNamingToken(); if (!ContextAccessController.checkSecurityToken(context, token)) { logger.error("Couldn't get a valid security token. ClassLoader binding will fail."); } return token; }
/** * Returns true if writing is allowed on this context. */ protected boolean isWritable() { return ContextAccessController.isWritable(name); }
/** * Process property change events. * * @param event The property change event that has occurred */ @Override public void propertyChange(PropertyChangeEvent event) { if (!initialized) return; Object source = event.getSource(); if (source == namingResources) { // Setting the context in read/write mode ContextAccessController.setWritable(getName(), token); processGlobalResourcesChange(event.getPropertyName(), event.getOldValue(), event.getNewValue()); // Setting the context in read only mode ContextAccessController.setReadOnly(getName()); } }
Hashtable<String, Object> contextEnv = new Hashtable<>(); namingContext = new NamingContext(contextEnv, getName()); ContextAccessController.setSecurityToken(getName(), token); ContextAccessController.setSecurityToken(container, token); ContextBindings.bindContext(container, namingContext, token); if( log.isDebugEnabled() ) { ContextAccessController.setWritable(getName(), token); ContextAccessController.setReadOnly(getName()); try { ContextBindings.bindClassLoader(container, token, ContextAccessController.setWritable(getName(), token); ContextBindings.unbindContext(container, token); ContextAccessController.unsetSecurityToken(getName(), token); ContextAccessController.unsetSecurityToken(container, token);
/** * Returns the security token required to bind to a naming context. * * @param context the catalina context * * @return the security token for use with <code>ContextBindings</code> */ @Override protected Object getNamingToken(Context context) { // Used by NamingContextListener when setting up JNDI context Object token = context.getNamingToken(); if (!ContextAccessController.checkSecurityToken(context, token)) { logger.error("Couldn't get a valid security token. ClassLoader binding will fail."); } return token; }
/** * @return <code>true</code> if writing is allowed on this context. */ protected boolean isWritable() { return ContextAccessController.isWritable(name); }
/** * Process property change events. * * @param event The property change event that has occurred */ @Override public void propertyChange(PropertyChangeEvent event) { if (!initialized) return; Object source = event.getSource(); if (source == namingResources) { // Setting the context in read/write mode ContextAccessController.setWritable(getName(), container); processGlobalResourcesChange(event.getPropertyName(), event.getOldValue(), event.getNewValue()); // Setting the context in read only mode ContextAccessController.setReadOnly(getName()); } }
ContextAccessController.setSecurityToken(getName(), container); ContextBindings.bindContext(container, namingContext, container); if( log.isDebugEnabled() ) { ContextAccessController.setWritable(getName(), container); ContextAccessController.setReadOnly(getName()); try { ContextBindings.bindClassLoader ContextAccessController.setWritable(getName(), container); ContextBindings.unbindContext(container, container); ContextAccessController.unsetSecurityToken(getName(), container);
/** * Remove a security token for a context. * * @param name Name of the Catalina context * @param token Security token */ public static void unsetSecurityToken(Object name, Object token) { if (checkSecurityToken(name, token)) { securityTokens.remove(name); } }
/** * Returns true if writing is allowed on this context. */ protected boolean isWritable() { return ContextAccessController.isWritable(name); }
/** * Process property change events. * * @param event The property change event that has occurred */ @Override public void propertyChange(PropertyChangeEvent event) { if (!initialized) return; Object source = event.getSource(); if (source == namingResources) { // Setting the context in read/write mode ContextAccessController.setWritable(getName(), container); processGlobalResourcesChange(event.getPropertyName(), event.getOldValue(), event.getNewValue()); // Setting the context in read only mode ContextAccessController.setReadOnly(getName()); } }