this.poa = poa;
this.logger = logger;
if (ir == null)
{
throw new INTF_REPOS ("IR null!");
}
if (def_in == null)
{
throw new INTF_REPOS ("Defined_in null!");
}
def_kind = org.omg.CORBA.DefinitionKind.dk_Interface;
containing_repository = ir;
defined_in = def_in;
if( def_in.equals(ir) )
myContainer = null;
else
myContainer = org.omg.CORBA.ContainedHelper.narrow( defined_in );
this.path = path;
theClass = c;
String classId = c.getName();
this.helperClass = helperClass;
Hashtable irInfo= null;
Class irHelperClass = null;
try
{
irHelperClass =
this.loader.loadClass( theClass.getName() + "IRHelper");
irInfo = (Hashtable)irHelperClass.getDeclaredField("irInfo").get(null);
}
catch( ClassNotFoundException e )
{
logger.error("No IR helper class for interface " +
theClass.getName(), e);
}
catch( Exception e )
{
logger.error("Caught Exception", e);
}
if (irInfo == null)
{
throw new INTF_REPOS ("IR Info null!");
}
try
{
containedClass = this.loader.loadClass("org.omg.CORBA.Contained");
signatureClass = this.loader.loadClass(classId + "Operations");
id( (String)helperClass.getDeclaredMethod("id", (Class[]) null).invoke( null, (Object[]) null ) );
version( id().substring( id().lastIndexOf(':')));
typeCode = TypeCodeUtil.getTypeCode( c, null, this.logger );
full_name = classId.replace('.', '/');
if( classId.indexOf('.') > 0 )
{
name = classId.substring( classId.lastIndexOf('.')+1);
if (defined_in == null)
{
throw new INTF_REPOS ("InterfaceDef " + name + " path " + path +
" has no defined_in repository");
}
if( containedClass.isAssignableFrom( defined_in.getClass() ))
absolute_name =
( myContainer != null ? myContainer.absolute_name() : "Global" )
+ "::" + name;
else
absolute_name = "::" + name;
}
else
{
name = classId;
defined_in = containing_repository;
absolute_name = "::" + name;
}
if (this.logger.isDebugEnabled())
{
this.logger.debug("InterfaceDef: " + absolute_name +
" path: " + path);
}
/* get directory for nested definitions' classes */
File f =
new File( path + fileSeparator +
classId.replace('.', fileSeparator) + "Package" );
if( f.exists() && f.isDirectory() )
my_dir = f;
}
catch ( Exception e )
{
this.logger.error("Caught exception",e);
throw new INTF_REPOS( ErrorMsg.IR_Not_Implemented,
org.omg.CORBA.CompletionStatus.COMPLETED_NO);
}
}