FileDocCategorySizeDatePackage
SFSBVersionIORInterceptor.javaAPI DocGlassfish v2 API4773Fri May 04 22:34:56 BST 2007com.sun.enterprise.iiop

SFSBVersionIORInterceptor

public class SFSBVersionIORInterceptor extends org.omg.CORBA.LocalObject implements org.omg.PortableInterceptor.IORInterceptor

Fields Summary
private static final Logger
_logger
private org.omg.IOP.Codec
codec
Constructors Summary
public SFSBVersionIORInterceptor(org.omg.IOP.Codec c)


       
        codec = c;
    
Methods Summary
private voidaddSFSBVersionComponents(org.omg.PortableInterceptor.IORInfo iorInfo)

        long versionNumber = 0;

        Any versionAny = ORB.init().create_any();

        versionAny.insert_longlong(versionNumber);

        byte[] versionValue = null;
        try {
            versionValue = codec.encode_value(versionAny);
        } catch (org.omg.IOP.CodecPackage.InvalidTypeForEncoding e) {
            INTERNAL ex = new INTERNAL("InvalidTypeForEncoding " + e.getMessage());
            ex.initCause(e);
            throw ex;
        }

        TaggedComponent sfsbVersionComponent = new TaggedComponent(
                POARemoteReferenceFactory.SFSB_VERSION_POLICY_TYPE,
                versionValue);
        iorInfo.add_ior_component(sfsbVersionComponent);
        _logger.log(Level.FINE,
                "SFSBVersionIORInterceptor.addSFSBVersionComponents added...");
    
public voiddestroy()

    
public voidestablish_components(org.omg.PortableInterceptor.IORInfo iorInfo)

        try {
            _logger.log(Level.FINE,
                    "SFSBVersionIORInterceptor.establish_components->:");

            // Add OTS tagged components. These are always the same for all EJBs
            SFSBVersionPolicy versionPolicy = null;
            try {
                versionPolicy = (SFSBVersionPolicy) iorInfo
                        .get_effective_policy(POARemoteReferenceFactory.SFSB_VERSION_POLICY_TYPE);
            } catch (INV_POLICY ex) {
                _logger.log(Level.FINE,
                        "SFSBVersionIORInterceptor.establish_components: SFSB_VERSION_POLICY_TYPE not present", ex);
            }
            if (versionPolicy != null) {
                addSFSBVersionComponents(iorInfo);
            }

        } catch (Exception e) {
            _logger.log(Level.WARNING, "Exception in establish_components", e);
        } finally {
            _logger.log(Level.FINE,
                    "SFSBVersionIORInterceptor.establish_components<-:");
        }
    
public java.lang.Stringname()

        return "SFSBVersionIORInterceptor";