FileDocCategorySizeDatePackage
JBISecurityHandler.javaAPI DocGlassfish v2 API3582Fri May 04 22:30:28 BST 2007com.sun.enterprise.jbi.serviceengine.handlers

JBISecurityHandler

public class JBISecurityHandler extends Object implements JBIHandler
This class handles the security context propagation during JBI message exchanges.
author
Vikas Awasthi

Fields Summary
private final String
SECURITY_PROPERTY
private String
sc_enable
Constructors Summary
Methods Summary
public voidhandleInbound(com.sun.enterprise.jbi.serviceengine.comm.MessageExchangeTransport meTransport)

        if(!isSecurityEnabled())
            return;

        Subject subject = SecurityContext.getCurrent().getSubject();
        NormalizedMessage msg = meTransport.getMessage();
        if(msg == null) return;

        msg.setProperty(SECURITY_PROPERTY, subject);
    
public voidhandleOutbound(com.sun.enterprise.jbi.serviceengine.comm.MessageExchangeTransport meTransport)

        if(!isSecurityEnabled())
            return;

        NormalizedMessage msg = meTransport.getMessage();
        if(msg == null) return;

        Subject subject = (Subject)msg.getProperty(SECURITY_PROPERTY);
        if(subject != null) {
            SecurityContext sc = new SecurityContext(subject);
            SecurityContext.setCurrent(sc);
        }
    
protected booleanisSecurityEnabled()
This method can be overridden to control the security propagation

        return (sc_enable==null || sc_enable.equalsIgnoreCase("true"));