Examples of HandlerConfiguration


Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

     * @return The configuration or null.
     */
    private HandlerConfiguration getHandlerConfiguration(String name)
    throws ProcessingException {  
        final Map configs = this.getHandlerConfigurations();
        HandlerConfiguration c = null;
        if ( configs != null) {
            c = (HandlerConfiguration)configs.get( name );
        }
        return c;
    }
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

   */
  public UserHandler login(String handlerName,
                             String applicationName,
                             SourceParameters parameters)
    throws ProcessingException {
        HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
        if ( config == null ) {
            throw new ProcessingException("Unknown handler to authenticate: " + handlerName);
        }
        // are we already logged in?
        UserHandler handler = this.getUserHandler( handlerName );
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

   */
  public boolean checkAuthentication(Redirector redirector,
                                        String handlerName,
                                        String applicationName)
  throws IOException, ProcessingException {
        HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
        if ( config == null ) {
            throw new ProcessingException("Unknown handler to check: " + handlerName);
        }
        // are we already logged in?
        UserHandler handler = this.getUserHandler( handlerName );
        final boolean authenticated = ( handler != null );
        if ( !authenticated ) {
            // create parameters
            SourceParameters parameters = config.getRedirectParameters();
            if (parameters == null) parameters = new SourceParameters();
            final Request request = this.getRequest();
            String resource = request.getRequestURI();
            if (request.getQueryString() != null) {
                resource += '?' + request.getQueryString();
            }

            parameters.setSingleParameterValue("resource", resource);
            final String redirectURI = config.getRedirectURI();
            redirector.globalRedirect(false, SourceUtil.appendParameters(redirectURI, parameters));
        } else {
            // update state
            RequestState state = new RequestState( handler, applicationName );
            this.setState( state );
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration

  /* (non-Javadoc)
   * @see org.apache.cocoon.webapps.authentication.components.Manager#logout(java.lang.String, java.lang.String)
   */
  public void logout(String handlerName, int mode)
    throws ProcessingException {
        HandlerConfiguration config = this.getHandlerConfiguration( handlerName );
        if ( config == null ) {
            throw new ProcessingException("Unknown handler to logout: " + handlerName);
        }
        // are we logged in?
        UserHandler handler = this.getUserHandler( handlerName );
View Full Code Here

Examples of org.apache.felix.ipojo.api.HandlerConfiguration

            element.addElement(inst.getElement());
        }

        // External handlers
        for (int i = 0; i < m_handlers.size(); i++) {
            HandlerConfiguration hc = (HandlerConfiguration) m_handlers.get(i);
            element.addElement(hc.getElement());
        }

        return element;
    }
View Full Code Here

Examples of org.apache.felix.ipojo.api.HandlerConfiguration

            element.addElement(inst.getElement());
        }

        // External handlers
        for (int i = 0; i < m_handlers.size(); i++) {
            HandlerConfiguration hc = (HandlerConfiguration) m_handlers.get(i);
            element.addElement(hc.getElement());
        }

        return element;
    }
View Full Code Here

Examples of org.jboss.logmanager.config.HandlerConfiguration

     *
     * @param configuration the log context configuration.
     * @param handlerName   the name of the handler to enable.
     */
    static void enableHandler(final LogContextConfiguration configuration, final String handlerName) {
        final HandlerConfiguration handlerConfiguration = configuration.getHandlerConfiguration(handlerName);
        try {
            handlerConfiguration.setPropertyValueString("enabled", "true");
            return;
        } catch (IllegalArgumentException e) {
            // do nothing
        }
        final Map<String, String> disableHandlers = configuration.getLogContext().getAttachment(CommonAttributes.ROOT_LOGGER_NAME, DISABLED_HANDLERS_KEY);
        if (disableHandlers != null && disableHandlers.containsKey(handlerName)) {
            synchronized (HANDLER_LOCK) {
                final String filter = disableHandlers.get(handlerName);
                handlerConfiguration.setFilter(filter);
                disableHandlers.remove(handlerName);
            }
        }
    }
View Full Code Here

Examples of org.jboss.logmanager.config.HandlerConfiguration

     *
     * @param configuration the log context configuration.
     * @param handlerName   the handler name to disable.
     */
    static void disableHandler(final LogContextConfiguration configuration, final String handlerName) {
        final HandlerConfiguration handlerConfiguration = configuration.getHandlerConfiguration(handlerName);
        try {
            handlerConfiguration.setPropertyValueString("enabled", "false");
            return;
        } catch (IllegalArgumentException e) {
            // do nothing
        }
        final Logger root = configuration.getLogContext().getLogger(CommonAttributes.ROOT_LOGGER_NAME);
        Map<String, String> disableHandlers = root.getAttachment(DISABLED_HANDLERS_KEY);
        synchronized (HANDLER_LOCK) {
            if (disableHandlers == null) {
                disableHandlers = new HashMap<String, String>();
                final Map<String, String> current = root.attachIfAbsent(DISABLED_HANDLERS_KEY, disableHandlers);
                if (current != null) {
                    disableHandlers = current;
                }
            }
            if (!disableHandlers.containsKey(handlerName)) {
                disableHandlers.put(handlerName, handlerConfiguration.getFilter());
                handlerConfiguration.setFilter(CommonAttributes.DENY.getName());
            }
        }
    }
View Full Code Here

Examples of org.jboss.logmanager.config.HandlerConfiguration

            }
        }

        @Override
        public final void performRuntime(final OperationContext context, final ModelNode operation, final LogContextConfiguration logContextConfiguration, final String name, final ModelNode model) throws OperationFailedException {
            final HandlerConfiguration configuration = logContextConfiguration.getHandlerConfiguration(name);
            if (configuration == null) {
                throw createOperationFailure(LoggingMessages.MESSAGES.handlerConfigurationNotFound(name));
            }
            if (attributes != null) {
                boolean restartRequired = false;
View Full Code Here

Examples of org.jboss.logmanager.config.HandlerConfiguration

            }
        }

        @Override
        public void performRuntime(final OperationContext context, final ModelNode operation, final LogContextConfiguration logContextConfiguration, final String name, final ModelNode model) throws OperationFailedException {
            HandlerConfiguration configuration = logContextConfiguration.getHandlerConfiguration(name);
            final boolean exists = configuration != null;
            if (!exists) {
                LoggingLogger.ROOT_LOGGER.tracef("Adding handler '%s' at '%s'", name, LoggingOperations.getAddress(operation));
                configuration = createHandlerConfiguration(context, model, name, logContextConfiguration);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.