org.jacorb.ir
Class RepositoryImpl

java.lang.Object
  extended by org.jacorb.ir.IRObject
      extended by org.jacorb.ir.RepositoryImpl
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.omg.CORBA.IRObjectOperations

public class RepositoryImpl
extends IRObject
implements org.apache.avalon.framework.configuration.Configurable

The Interface Repository.

This class represents the repository itself as well as the executable server.

Methods from the "write" interface to the IR are not supported.

Version:
$Id: RepositoryImpl.java,v 1.12 2006/06/15 16:43:14 alphonse.bendt Exp $
Author:
Gerald Brose

Field Summary
 
Fields inherited from class org.jacorb.ir.IRObject
def_kind, fileSeparator, myRef, name, orb
 
Constructor Summary
RepositoryImpl(java.lang.String classpath, java.lang.String outfile, java.net.URLClassLoader loader)
          constructor to launch a repository with the contents of classpath
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration myConfiguration)
           
 org.omg.CORBA.Contained[] contents(org.omg.CORBA.DefinitionKind limit_type, boolean exclude_inherited)
          list the contents of the repository
 org.omg.CORBA.AliasDef create_alias(java.lang.String id, java.lang.String name, java.lang.String version, org.omg.CORBA.IDLType original_type)
           
 org.omg.CORBA.ArrayDef create_array(int length, org.omg.CORBA.IDLType element_type)
          not supported
 org.omg.CORBA.ConstantDef create_constant(java.lang.String id, java.lang.String name, java.lang.String version, org.omg.CORBA.IDLType type, org.omg.CORBA.Any value)
           
 org.omg.CORBA.EnumDef create_enum(java.lang.String id, java.lang.String name, java.lang.String version, java.lang.String[] members)
           
 org.omg.CORBA.ExceptionDef create_exception(java.lang.String id, java.lang.String name, java.lang.String version, org.omg.CORBA.StructMember[] member)
           
 org.omg.CORBA.FixedDef create_fixed(short digits, short scale)
          not supported
 org.omg.CORBA.InterfaceDef create_interface(java.lang.String id, java.lang.String name, java.lang.String version, org.omg.CORBA.InterfaceDef[] base_interfaces, boolean is_abstract)
          not supported
 org.omg.CORBA.ModuleDef create_module(java.lang.String id, java.lang.String name, java.lang.String version)
           
 org.omg.CORBA.NativeDef create_native(java.lang.String id, java.lang.String name, java.lang.String version)
          not supported
 org.omg.CORBA.SequenceDef create_sequence(int bound, org.omg.CORBA.IDLType element_type)
          not supported
 org.omg.CORBA.StringDef create_string(int bound)
          not supported
 org.omg.CORBA.StructDef create_struct(java.lang.String id, java.lang.String name, java.lang.String version, org.omg.CORBA.StructMember[] members)
           
 org.omg.CORBA.UnionDef create_union(java.lang.String id, java.lang.String name, java.lang.String version, org.omg.CORBA.IDLType discriminator_type, org.omg.CORBA.UnionMember[] members)
           
 org.omg.CORBA.ValueBoxDef create_value_box(java.lang.String id, java.lang.String name, java.lang.String version, org.omg.CORBA.IDLType type)
          not supported
 org.omg.CORBA.ValueDef create_value(java.lang.String id, java.lang.String name, java.lang.String version, boolean is_custom, boolean is_abstract, org.omg.CORBA.ValueDef base_value, boolean is_truncatable, org.omg.CORBA.ValueDef[] abstract_base_values, org.omg.CORBA.InterfaceDef[] supported_interfaces, org.omg.CORBA.Initializer[] initializers)
          not supported
 org.omg.CORBA.WstringDef create_wstring(int bound)
          not supported
 org.omg.CORBA.ContainerPackage.Description[] describe_contents(org.omg.CORBA.DefinitionKind limit_type, boolean exclude_inherited, int max_returned_objs)
          describe the contents of the repository
 void destroy()
           
 org.omg.CORBA.TypeCode get_canonical_typecode(org.omg.CORBA.TypeCode tc)
           
 org.omg.CORBA.PrimitiveDef get_primitive(org.omg.CORBA.PrimitiveKind kind)
           
 void loadContents()
           
 org.omg.CORBA.Contained lookup_id(java.lang.String search_id)
          lookup a repository ID
 org.omg.CORBA.Contained[] lookup_name(java.lang.String search_name, int levels_to_search, org.omg.CORBA.DefinitionKind limit_type, boolean exclude_inherited)
          lookup a simple name in the repository (neither scoped nor ID formatted)
 org.omg.CORBA.Contained lookup(java.lang.String name)
          lookup a scoped name in the repository
 
Methods inherited from class org.jacorb.ir.IRObject
def_kind, getName, getReference, setReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryImpl

public RepositoryImpl(java.lang.String classpath,
                      java.lang.String outfile,
                      java.net.URLClassLoader loader)
               throws java.lang.Exception
constructor to launch a repository with the contents of classpath

Parameters:
classpath - a classpath string made up of directories separated by ":"
Throws:
java.lang.Exception
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration myConfiguration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

lookup_id

public org.omg.CORBA.Contained lookup_id(java.lang.String search_id)
lookup a repository ID

Parameters:
search_id - a string in Repository ID format, e.g. "IDL:myModule/MyInterface:1.0"
Returns:
a reference to the object or null, if not found

get_primitive

public org.omg.CORBA.PrimitiveDef get_primitive(org.omg.CORBA.PrimitiveKind kind)

create_string

public org.omg.CORBA.StringDef create_string(int bound)
not supported


create_wstring

public org.omg.CORBA.WstringDef create_wstring(int bound)
not supported


create_fixed

public org.omg.CORBA.FixedDef create_fixed(short digits,
                                           short scale)
not supported


create_sequence

public org.omg.CORBA.SequenceDef create_sequence(int bound,
                                                 org.omg.CORBA.IDLType element_type)
not supported


create_array

public org.omg.CORBA.ArrayDef create_array(int length,
                                           org.omg.CORBA.IDLType element_type)
not supported


get_canonical_typecode

public org.omg.CORBA.TypeCode get_canonical_typecode(org.omg.CORBA.TypeCode tc)

lookup

public org.omg.CORBA.Contained lookup(java.lang.String name)
lookup a scoped name in the repository

Parameters:
name - the name to look for
Returns:
a reference to the item with the specified name or null, if not found

lookup_name

public org.omg.CORBA.Contained[] lookup_name(java.lang.String search_name,
                                             int levels_to_search,
                                             org.omg.CORBA.DefinitionKind limit_type,
                                             boolean exclude_inherited)
lookup a simple name in the repository (neither scoped nor ID formatted)

Parameters:
search_name - the name to look for
levels_to_search - if 1, search only this object, if -1, search all containers contained in this repository, else search until the specified depth is reached
limit_type - limit the description to objects of this type
exclude_inherited - exclude inherited items from the description
Returns:
an array of items with the specified name

contents

public org.omg.CORBA.Contained[] contents(org.omg.CORBA.DefinitionKind limit_type,
                                          boolean exclude_inherited)
list the contents of the repository

Parameters:
limit_type - limit the description to objects of this type
exclude_inherited - exclude inherited items from the description
Returns:
an array of items contained in this repository

describe_contents

public org.omg.CORBA.ContainerPackage.Description[] describe_contents(org.omg.CORBA.DefinitionKind limit_type,
                                                                      boolean exclude_inherited,
                                                                      int max_returned_objs)
describe the contents of the repository

Parameters:
limit_type - limit the description to objects of this type
exclude_inherited - exclude inherited items from the description
max_returned_objs - return only so many items
Returns:
an array of descriptions

loadContents

public void loadContents()

create_module

public org.omg.CORBA.ModuleDef create_module(java.lang.String id,
                                             java.lang.String name,
                                             java.lang.String version)

create_constant

public org.omg.CORBA.ConstantDef create_constant(java.lang.String id,
                                                 java.lang.String name,
                                                 java.lang.String version,
                                                 org.omg.CORBA.IDLType type,
                                                 org.omg.CORBA.Any value)

create_struct

public org.omg.CORBA.StructDef create_struct(java.lang.String id,
                                             java.lang.String name,
                                             java.lang.String version,
                                             org.omg.CORBA.StructMember[] members)

create_union

public org.omg.CORBA.UnionDef create_union(java.lang.String id,
                                           java.lang.String name,
                                           java.lang.String version,
                                           org.omg.CORBA.IDLType discriminator_type,
                                           org.omg.CORBA.UnionMember[] members)

create_enum

public org.omg.CORBA.EnumDef create_enum(java.lang.String id,
                                         java.lang.String name,
                                         java.lang.String version,
                                         java.lang.String[] members)

create_alias

public org.omg.CORBA.AliasDef create_alias(java.lang.String id,
                                           java.lang.String name,
                                           java.lang.String version,
                                           org.omg.CORBA.IDLType original_type)

create_exception

public org.omg.CORBA.ExceptionDef create_exception(java.lang.String id,
                                                   java.lang.String name,
                                                   java.lang.String version,
                                                   org.omg.CORBA.StructMember[] member)

create_interface

public org.omg.CORBA.InterfaceDef create_interface(java.lang.String id,
                                                   java.lang.String name,
                                                   java.lang.String version,
                                                   org.omg.CORBA.InterfaceDef[] base_interfaces,
                                                   boolean is_abstract)
not supported


create_value_box

public org.omg.CORBA.ValueBoxDef create_value_box(java.lang.String id,
                                                  java.lang.String name,
                                                  java.lang.String version,
                                                  org.omg.CORBA.IDLType type)
not supported


create_value

public org.omg.CORBA.ValueDef create_value(java.lang.String id,
                                           java.lang.String name,
                                           java.lang.String version,
                                           boolean is_custom,
                                           boolean is_abstract,
                                           org.omg.CORBA.ValueDef base_value,
                                           boolean is_truncatable,
                                           org.omg.CORBA.ValueDef[] abstract_base_values,
                                           org.omg.CORBA.InterfaceDef[] supported_interfaces,
                                           org.omg.CORBA.Initializer[] initializers)
not supported


create_native

public org.omg.CORBA.NativeDef create_native(java.lang.String id,
                                             java.lang.String name,
                                             java.lang.String version)
not supported


destroy

public void destroy()
Specified by:
destroy in interface org.omg.CORBA.IRObjectOperations
Specified by:
destroy in class IRObject