FileDocCategorySizeDatePackage
SFSBServerRequestInterceptor.javaAPI DocGlassfish v2 API5877Fri May 18 13:24:12 BST 2007com.sun.enterprise.iiop

SFSBServerRequestInterceptor

public class SFSBServerRequestInterceptor extends SFSBAbstractInterceptor implements ServerRequestInterceptor
This is the implementation of the JTS PI-based client/server interceptor. This will be called during request/reply invocation path.

Fields Summary
private ThreadLocal
scInfo
Constructors Summary
public SFSBServerRequestInterceptor(org.omg.IOP.Codec codec)

    
       
        super("com.sun.enterprise.iiop.SFSBServerRequestInterceptor", codec);
    
Methods Summary
public voidreceive_request(ServerRequestInfo ri)

    
public voidreceive_request_service_contexts(ServerRequestInfo ri)

        try {
            ServiceContext serviceContext =
                ri.get_request_service_context(SFSBVersionConstants.SFSB_VERSION_SERVICE_CONTEXT_ID);
            if (serviceContext != null) {
                byte[] data = serviceContext.context_data;
                long version = Utility.bytesToLong(data, 0);
                SFSBVersionManager.setRequestClientVersion(version);
                if (_logger.isLoggable(Level.FINE)) {
                    _logger.log(Level.FINE, "SFSBServerReqInterceptor:: "
                            + "receive_request_service_context: " + version);
                }
                SFSBServiceContextInfo info = new SFSBServiceContextInfo();
                info.requestVersion= version;
                info.valid = true;
                scInfo.set(info);
            } else {
                scInfo.set(null);
            }
        } catch (Exception ex) {
            scInfo.set(null);
            _logger.log(Level.INFO, "SFSBServerReqInterceptor:: receive_request_service_coventext: ", ex);
        }
    
private voidsendSFSBVersionNumber(java.lang.String callName, ServerRequestInfo ri)

        try {
            SFSBServiceContextInfo info =
                SFSBVersionManager.getServiceContext();
            if (info != null) {
                long version = SFSBVersionManager.getResponseClientVersion();
                byte[] data = new byte[8];
                Utility.longToBytes(version, data, 0);
                ri.add_reply_service_context(new ServiceContext(
                        SFSBVersionConstants.SFSB_VERSION_SERVICE_CONTEXT_ID, data), false);
                if (_logger.isLoggable(Level.FINE)) {
                    _logger.log(Level.FINE, "SFSBServerReqInterceptor:: "
                            + callName + ": " + version);
                }
            }
        } catch (Exception ex) {
            _logger.log(Level.INFO, "SFSBServerReqInterceptor:: "
                    + callName + ": ", ex);
        } finally {
            SFSBVersionManager.clearServiceContextInfo();
        }
    
public voidsend_exception(ServerRequestInfo ri)

        sendSFSBVersionNumber("send_exception", ri);
    
public voidsend_other(ServerRequestInfo ri)

        try {
            SFSBServiceContextInfo info = SFSBVersionManager.getServiceContext();
            if (info != null) {
                _logger.log(Level.WARNING, "SFSBServerReqInterceptor:: send_other: ");
            }
        } catch (Exception ex) {
            _logger.log(Level.WARNING, "SFSBServerReqInterceptor:: send_other: ", ex);
        }
    
public voidsend_reply(ServerRequestInfo ri)

        sendSFSBVersionNumber("send_reply", ri);