FileDocCategorySizeDatePackage
ClientConnectionInterceptor.javaAPI DocGlassfish v2 API4531Fri May 04 22:34:54 BST 2007com.sun.enterprise.iiop

ClientConnectionInterceptor

public class ClientConnectionInterceptor extends org.omg.CORBA.LocalObject implements Comparable, org.omg.PortableInterceptor.ClientRequestInterceptor

Fields Summary
private static Logger
_logger
public String
name
public int
order
Constructors Summary
public ClientConnectionInterceptor(String name, int order)
Create the interceptor.

param
the name of the interceptor.
param
the order in which the interceptor should be invoked.

	this.name = name;
	this.order = order;
    
Methods Summary
public intcompareTo(java.lang.Object o)

	int otherOrder = -1;
	if(o instanceof ClientConnectionInterceptor) {
	    otherOrder = ((ClientConnectionInterceptor)o).order;
	}
	if (order < otherOrder) {
	    return -1;
	} else if (order == otherOrder) {
	    return 0;
	}
	return 1;
    
public voiddestroy()

    
public java.lang.Stringname()
Return the name of the interceptor.

return
the name of the interceptor.

 
	return name; 
    
public voidreceive_exception(org.omg.PortableInterceptor.ClientRequestInfo cri)

    
public voidreceive_other(org.omg.PortableInterceptor.ClientRequestInfo cri)

    
public voidreceive_reply(org.omg.PortableInterceptor.ClientRequestInfo cri)

    
public voidsend_poll(org.omg.PortableInterceptor.ClientRequestInfo cri)

    
public voidsend_request(org.omg.PortableInterceptor.ClientRequestInfo cri)

	// Check if there is an exportable transaction on current thread
	Object target = cri.effective_target();
	J2EETransactionManager tm = Switch.getSwitch().getTransactionManager();
	if ( tm != null )
	    tm.checkTransactionExport(StubAdapter.isLocal(target));

	// Get connection information and store it in ConnectionContext
	Connection c = ((RequestInfoExt)cri).connection();
	if(c != null) {
	    SecurityMechanismSelector sms = new SecurityMechanismSelector();
	    ConnectionContext cc = sms.getClientConnectionContext();
	    if(_logger.isLoggable(Level.FINE)){
		 _logger.log(Level.FINE,"SENDING request on connection: " + c);
	    }
	    if(cc != null) {
	        cc.setSocket(c.getSocket());
	    }
	}