package demo.interceptors.proprietary;

public class ClientMessageInterceptor
    implements jacorb.orb.ClientMessageInterceptor
{

    public  byte [] post_invoke( org.omg.CORBA.Object t, 
				 byte [] buf )
    {
		System.out.println("post intercept Thread " + Thread.currentThread());
		return buf;
    }

    public  byte [] pre_invoke( org.omg.CORBA.Object t, 
				byte [] buf)
    {
		System.out.println("pre intercept Thread " + Thread.currentThread());
		byte buf2[] = new byte[buf.length];

	// copy GIOP message header 
	//	System.arraycopy( buf, 0, buf2, 0, 12 );

	//	Environment.output(1, "encoding...");

	// reverse rest of message
	//	for( int i = 12; i < buf.length; i++ )
	//  buf2[i] = buf[ (buf.length+11) - i ];

	//	return buf2;
		return buf;
    }
}


