package org.jboss.tm.iiop;
import org.omg.CORBA.LocalObject;
import org.omg.IOP.Codec;
import org.omg.IOP.ENCODING_CDR_ENCAPS;
import org.omg.IOP.Encoding;
import org.omg.PortableInterceptor.ORBInitInfo;
import org.omg.PortableInterceptor.ORBInitializer;
public class TxServerInterceptorInitializer
extends LocalObject
implements ORBInitializer
{
static final long serialVersionUID = -547674655727747575L;
public TxServerInterceptorInitializer()
{
}
public void pre_init(ORBInitInfo info)
{
}
public void post_init(ORBInitInfo info)
{
try
{
Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
(byte)1,
(byte)0 );
Codec codec = info.codec_factory().create_codec(encoding);
org.omg.CORBA.Object obj =
info.resolve_initial_references("PICurrent");
org.omg.PortableInterceptor.Current piCurrent =
org.omg.PortableInterceptor.CurrentHelper.narrow(obj);
TxServerInterceptor.init(info.allocate_slot_id(), codec, piCurrent);
TxServerInterceptor interceptor = new TxServerInterceptor();
info.add_server_request_interceptor(interceptor);
}
catch (Exception e)
{
throw new RuntimeException("Unexpected " + e);
}
}
}