/** * 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 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 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; }
/** * Binds an object and a naming context. * * @param obj Object to bind with naming context * @param context Associated naming context instance * @param token Security token */ public static void bindContext(Object obj, Context context, Object token) { if (ContextAccessController.checkSecurityToken(obj, token)) { objectBindings.put(obj, context); } }
/** * Unbind context name. * * @param name Name of the context * @param token Security token */ public static void unbindContext(Object name, Object token) { if (ContextAccessController.checkSecurityToken(name, token)) contextNameBindings.remove(name); }
/** * Allow writing to a context. * * @param name Name of the context * @param token Security token */ public static void setWritable(Object name, Object token) { if (checkSecurityToken(name, token)) readOnlyContexts.remove(name); }
/** * 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); } }
/** * Allow writing to a context. * * @param name Name of the Catalina context * @param token Security token */ public static void setWritable(Object name, Object token) { if (checkSecurityToken(name, token)) readOnlyContexts.remove(name); }
/** * Binds a context name. * * @param name Name of the context * @param context Associated naming context instance * @param token Security token */ public static void bindContext(Object name, Context context, Object token) { if (ContextAccessController.checkSecurityToken(name, token)) contextNameBindings.put(name, context); }
/** * Binds a context name. * * @param name Name of the context * @param context Associated naming context instance * @param token Security token */ public static void bindContext(Object name, Context context, Object token) { if (ContextAccessController.checkSecurityToken(name, token)) contextNameBindings.put(name, context); }
/** * Unbind context name. * * @param name Name of the context * @param token Security token */ public static void unbindContext(Object name, Object token) { if (ContextAccessController.checkSecurityToken(name, token)) contextNameBindings.remove(name); }
/** * Allow writing to a context. * * @param name Name of the context * @param token Security token */ public static void setWritable(Object name, Object token) { if (checkSecurityToken(name, token)) readOnlyContexts.remove(name); }
/** * Remove a security token for a context. * * @param name Name of the context * @param token Security token */ public static void unsetSecurityToken(Object name, Object token) { if (checkSecurityToken(name, token)) { securityTokens.remove(name); } }
/** * Remove a security token for a context. * * @param name Name of the context * @param token Security token */ public static void unsetSecurityToken(Object name, Object token) { if (checkSecurityToken(name, token)) { securityTokens.remove(name); } }
/** * Unbinds an object and a naming context. * * @param obj Object to unbind * @param token Security token */ public static void unbindContext(Object obj, Object token) { if (ContextAccessController.checkSecurityToken(obj, token)) { objectBindings.remove(obj); } }
/** * Remove a security token for a context. * * @param name Name of the context * @param token Security token */ public static void unsetSecurityToken(Object name, Object token) { if (checkSecurityToken(name, token)) { securityTokens.remove(name); } }
/** * Allow writing to a context. * * @param name Name of the context * @param token Security token */ public static void setWritable(Object name, Object token) { if (checkSecurityToken(name, token)) readOnlyContexts.remove(name); }
/** * Unbinds a thread and a naming context. * * @param obj Object bound to the required naming context * @param token Security token */ public static void unbindThread(Object obj, Object token) { if (ContextAccessController.checkSecurityToken(obj, token)) { threadBindings.remove(Thread.currentThread()); threadObjectBindings.remove(Thread.currentThread()); } }
/** * Unbinds a naming context to a thread. * * @param name Name of the context * @param token Security token */ public static void unbindThread(Object name, Object token) { if (ContextAccessController.checkSecurityToken(name, token)) { threadBindings.remove(Thread.currentThread()); threadNameBindings.remove(Thread.currentThread()); } }
/** * Unbinds a thread and a naming context. * * @param obj Object bound to the required naming context * @param token Security token */ public static void unbindThread(Object obj, Object token) { if (ContextAccessController.checkSecurityToken(obj, token)) { threadBindings.remove(Thread.currentThread()); threadObjectBindings.remove(Thread.currentThread()); } }