Package org.omg.CORBA

Examples of org.omg.CORBA.INTF_REPOS


    public org.omg.CORBA.TypeCode result()
    {
        if ( ! defined)
        {
            throw new INTF_REPOS ("OperationDeg undefined");
        }

        return result;
    }
View Full Code Here


        {
      org.omg.CORBA.ContainedPackage.Description cd = exceptions[i].describe();

            if( cd.kind != org.omg.CORBA.DefinitionKind.dk_Exception )
            {
                throw new INTF_REPOS( ErrorMsg.IR_Unexpected_Definition_Kind,
                                                    org.omg.CORBA.CompletionStatus.COMPLETED_NO);
            }
            ex_des[i] = org.omg.CORBA.ExceptionDescriptionHelper.extract( cd.value );
        }
        return new org.omg.CORBA.OperationDescription(name,
View Full Code Here

    // from IRObject

    public void destroy()
    {
        throw new INTF_REPOS(
                                           ErrorMsg.IR_Not_Implemented,
                                           org.omg.CORBA.CompletionStatus.COMPLETED_NO);
    }
View Full Code Here

    public org.omg.CORBA.ContainedPackage.Description describe()
    {
        if ( ! defined)
        {
            throw new INTF_REPOS ("OperationDeg undefined");
        }


        org.omg.CORBA.Any a = orb.create_any();
        org.omg.CORBA.OperationDescriptionHelper.insert( a, describe_operation() );
View Full Code Here

    public StringDef(org.omg.CORBA.TypeCode tc)
    {
        if (tc.kind () != org.omg.CORBA.TCKind.tk_string)
        {
            throw new INTF_REPOS ("Precondition volation: TypeCode must be of kind string");
        }

        def_kind = org.omg.CORBA.DefinitionKind.dk_String;
        type = tc;
        try
View Full Code Here

    public org.omg.CORBA.Object getReference()
    {
        if( myRef == null )
        {
            throw new INTF_REPOS ("Reference undefined!");
        }
        return myRef;
    }
View Full Code Here

        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();

        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;
            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);
        }
    }
View Full Code Here

        }

        // read from the interface class (operations and atributes)
        if (getReference() == null)
        {
            throw new INTF_REPOS ("getReference returns null");
        }

        myReference =
            org.omg.CORBA.InterfaceDefHelper.narrow( getReference());

        if (myReference == null)
        {
            throw new INTF_REPOS ("narrow failed for " + getReference ());
        }

        /* load nested definitions from interfacePackage directory */

        String[] classes = null;
View Full Code Here

    void define()
    {
        if ( ! loaded)
        {
            throw new INTF_REPOS ("Interface " + name +  " not loaded!");
        }

        if (this.logger.isDebugEnabled())
        {
            this.logger.debug("Interface " + name +  " defining... ]");
View Full Code Here

    public FullInterfaceDescription describe_interface()
    {
        if ( ! defined)
        {
            throw new INTF_REPOS ("InterfaceDef " + name + " not defined.");
        }

        if( fullDescription == null )
        {
            String def_in = "IDL:Global:1.0";
            if( defined_in instanceof org.omg.CORBA.Contained )
                def_in = ((org.omg.CORBA.Contained)defined_in).id();

            /* before  assembling descriptions, get hold  of all super
               types' FullInterfaceDescriptions */

            FullInterfaceDescription [] baseDescriptions =
                new FullInterfaceDescription[ base_interfaces().length ];

            for( int b = 0; b < base_interfaces.length; b++ )
            {
                baseDescriptions[b] = base_interfaces[b].describe_interface();
            }

            /* build operation descriptions */

            Hashtable ops = new Hashtable();

            for( int c = 0; c < op_defs.length; c++ )
            {
                OperationDescription operation = op_defs[c].describe_operation();
                ops.put( operation.name, operation );
            }

            /* get operation descriptions from super types, potentially duplicate
               descriptions due to diamond inheritance are removed by hashing
             */

            for( int baseOps = 0; baseOps < baseDescriptions.length; baseOps++ )
            {
                for( int bbaseOps = 0;
                     bbaseOps < baseDescriptions[baseOps].operations.length;
                     bbaseOps++ )
                {
                    OperationDescription base_op =
                        baseDescriptions[baseOps].operations[bbaseOps];

                    if( !ops.containsKey( base_op.name ))
                        ops.put( base_op.name, base_op );
                }
            }

            operations = new OperationDescription[ ops.size() ];

            int opsCount = 0;
            for( Enumeration e = ops.elements(); e.hasMoreElements(); opsCount++ )
            {
                operations[ opsCount ] = (OperationDescription)e.nextElement();
            }
            ops.clear();

            /* build attribute descriptions */
            Hashtable atts = new Hashtable();

            for( int a = 0; a < att_defs.length; a++ )
            {
                AttributeDescription att = att_defs[a].describe_attribute();
                atts.put( att.name, att );
            }

            /* get attribute descriptions from super types */

            for( int baseAtts = 0; baseAtts < baseDescriptions.length; baseAtts++ )
            {
                for( int bbaseAtts = 0;
                     bbaseAtts < baseDescriptions[ baseAtts ].attributes.length;
                     bbaseAtts++ )
                {
                    AttributeDescription base_att =
                        baseDescriptions[ baseAtts ].attributes[ bbaseAtts ];

                    if( !atts.containsKey( base_att.name ))
                        atts.put( base_att.name, base_att );
                }
            }

            attributes = new AttributeDescription[ atts.size() ];

            int attsCount = 0;
            for( Enumeration e = atts.elements(); e.hasMoreElements(); attsCount++ )
            {
                attributes[ attsCount ] = (AttributeDescription)e.nextElement();
            }
            atts.clear();

            /* build constant descriptions */

            constants = new org.omg.CORBA.ConstantDescription[ constant_defs.length ];
            for( int b = 0; b < constant_defs.length; b++ )
            {
                constants[b] = constant_defs[b].describe_constant();
            }

            if (operations == null)
            {
                throw new INTF_REPOS ("operations null!");
            }
            if (attributes == null)
            {
                throw new INTF_REPOS ("attributes null!");
            }

            fullDescription =
                new FullInterfaceDescription( name,
                                              id,
View Full Code Here

TOP

Related Classes of org.omg.CORBA.INTF_REPOS

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.