org.springside.modules.security.springsecurity.cxf.SpringSecurityOutInterceptor.java Source code

Java tutorial

Introduction

Here is the source code for org.springside.modules.security.springsecurity.cxf.SpringSecurityOutInterceptor.java

Source

/**
 * Copyright (c) 2005-2010 springside.org.cn
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * 
 * $Id: Log4jMBean.java 1192 2010-09-03 15:42:13Z calvinxiu $
 */
package org.springside.modules.security.springsecurity.cxf;

import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * SecurityContextInterceptor.
 * 
 * @author calvin
 */
public class SpringSecurityOutInterceptor extends AbstractPhaseInterceptor<Message> {

    public SpringSecurityOutInterceptor() {
        super(Phase.PRE_PROTOCOL);
    }

    public void handleMessage(Message message) throws Fault {
        SecurityContextHolder.clearContext();
    }
}