containing_repository = ir;
defined_in = _defined_in;
this.path = path;
if (defined_in == null)
{
throw new INTF_REPOS ("defined_in = null");
}
if (containing_repository == null)
{
throw new INTF_REPOS ("containing_repository = null");
}
try
{
String classId = c.getName();
myClass = c;
version( "1.0" );
full_name = classId;
if( classId.indexOf('.') > 0 )
{
name( classId.substring( classId.lastIndexOf('.')+1 ) );
absolute_name =
org.omg.CORBA.ContainedHelper.narrow( defined_in ).absolute_name() +
"::" + name;
}
else
{
name( classId );
absolute_name = "::" + name;
}
helperClass = this.loader.loadClass( classId + "Helper") ;
id( (String)helperClass.getDeclaredMethod( "id", (Class[]) null ).invoke( null, (Object[]) null ));
type = (org.omg.CORBA.TypeCode)helperClass.getDeclaredMethod(
"type",
(Class[]) null ).invoke( null, (Object[]) null );
members = new org.omg.CORBA.StructMember[ type.member_count() ];
for( int i = 0; i < members.length; i++ )
{
org.omg.CORBA.TypeCode type_code = type.member_type(i);
String member_name = type.member_name(i);
if (this.logger.isDebugEnabled())
{
this.logger.debug("StructDef " + absolute_name +
" member " + member_name);
}
members[i] = new org.omg.CORBA.StructMember( member_name,
type_code,
null );
}
/* get directory for nested definitions' classes */
File f = new File( path + fileSeparator +
classId.replace('.', fileSeparator) + "Package" );
if( f.exists() && f.isDirectory() )
my_dir = f;
if (this.logger.isDebugEnabled())
{
this.logger.debug("StructDef: " + absolute_name);
}
}
catch ( Exception e )
{
logger.error("Caught Exception", e);
throw new INTF_REPOS( ErrorMsg.IR_Not_Implemented,
org.omg.CORBA.CompletionStatus.COMPLETED_NO);
}
}