org.jacorb.ir

Class RepositoryImpl

Implemented Interfaces:
Configurable, ContainerOperations, IRObjectOperations, RepositoryOperations

public class RepositoryImpl
extends IRObject
implements RepositoryOperations, 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:
1.0

Author:
(c) Gerald Brose, FU Berlin 1997

Field Summary

static char
fileSeparator
static String
pathSeparator

Fields inherited from class org.jacorb.ir.IRObject

def_kind, myRef, name, orb

Constructor Summary

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

Method Summary

void
configure(Configuration myConfiguration)
Contained[]
contents(DefinitionKind limit_type, boolean exclude_inherited)
list the contents of the repository
AliasDef
create_alias(String id, String name, String version, IDLType original_type)
ArrayDef
create_array(int length, IDLType element_type)
not supported
ConstantDef
create_constant(String id, String name, String version, IDLType type, Any value)
EnumDef
create_enum(String id, String name, String version, String[] members)
ExceptionDef
create_exception(String id, String name, String version, StructMember member)
FixedDef
create_fixed(short digits, short scale)
not supported
InterfaceDef
create_interface(String id, String name, String version, InterfaceDef base_interfaces, boolean is_abstract)
not supported
ModuleDef
create_module(String id, String name, String version)
NativeDef
create_native(String id, String name, String version)
not supported
SequenceDef
create_sequence(int bound, IDLType element_type)
not supported
StringDef
create_string(int bound)
not supported
StructDef
create_struct(String id, String name, String version, StructMember members)
UnionDef
create_union(String id, String name, String version, IDLType discriminator_type, UnionMember members)
ValueDef
create_value(String id, String name, String version, boolean is_custom, boolean is_abstract, ValueDef base_value, boolean is_truncatable, ValueDef abstract_base_values, InterfaceDef supported_interfaces, Initializer initializers)
not supported
ValueBoxDef
create_value_box(String id, String name, String version, IDLType type)
not supported
WstringDef
create_wstring(int bound)
not supported
Description[]
describe_contents(DefinitionKind limit_type, boolean exclude_inherited, int max_returned_objs)
describe the contents of the repository
void
destroy()
TypeCode
get_canonical_typecode(TypeCode tc)
PrimitiveDef
get_primitive(PrimitiveKind kind)
void
loadContents()
Contained
lookup(String name)
lookup a scoped name in the repository
Contained
lookup_id(String search_id)
lookup a repository ID
Contained[]
lookup_name(String search_name, int levels_to_search, DefinitionKind limit_type, boolean exclude_inherited)
lookup a simple name in the repository (neither scoped nor ID formatted)

Methods inherited from class org.jacorb.ir.IRObject

def_kind, destroy, getName, getReference, setReference

Field Details

fileSeparator

public static char fileSeparator


pathSeparator

public static String pathSeparator

Constructor Details

RepositoryImpl

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

Parameters:
classpath - a classpath string made up of directories separated by ":"

Method Details

configure

public void configure(Configuration myConfiguration)
            throws ConfigurationException


contents

public Contained[] contents(DefinitionKind limit_type,
                            boolean exclude_inherited)
list the contents of the repository
Specified by:
contents in interface ContainerOperations

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


create_alias

public AliasDef create_alias(String id,
                             String name,
                             String version,
                             IDLType original_type)


create_array

public ArrayDef create_array(int length,
                             IDLType element_type)
not supported
Specified by:
create_array in interface RepositoryOperations


create_constant

public ConstantDef create_constant(String id,
                                   String name,
                                   String version,
                                   IDLType type,
                                   Any value)


create_enum

public EnumDef create_enum(String id,
                           String name,
                           String version,
                           String[] members)


create_exception

public ExceptionDef create_exception(String id,
                                     String name,
                                     String version,
                                     StructMember member)


create_fixed

public FixedDef create_fixed(short digits,
                             short scale)
not supported
Specified by:
create_fixed in interface RepositoryOperations


create_interface

public InterfaceDef create_interface(String id,
                                     String name,
                                     String version,
                                     InterfaceDef base_interfaces,
                                     boolean is_abstract)
not supported


create_module

public ModuleDef create_module(String id,
                               String name,
                               String version)


create_native

public NativeDef create_native(String id,
                               String name,
                               String version)
not supported


create_sequence

public SequenceDef create_sequence(int bound,
                                   IDLType element_type)
not supported
Specified by:
create_sequence in interface RepositoryOperations


create_string

public StringDef create_string(int bound)
not supported
Specified by:
create_string in interface RepositoryOperations


create_struct

public StructDef create_struct(String id,
                               String name,
                               String version,
                               StructMember members)


create_union

public UnionDef create_union(String id,
                             String name,
                             String version,
                             IDLType discriminator_type,
                             UnionMember members)


create_value

public ValueDef create_value(String id,
                             String name,
                             String version,
                             boolean is_custom,
                             boolean is_abstract,
                             ValueDef base_value,
                             boolean is_truncatable,
                             ValueDef abstract_base_values,
                             InterfaceDef supported_interfaces,
                             Initializer initializers)
not supported


create_value_box

public ValueBoxDef create_value_box(String id,
                                    String name,
                                    String version,
                                    IDLType type)
not supported


create_wstring

public WstringDef create_wstring(int bound)
not supported
Specified by:
create_wstring in interface RepositoryOperations


describe_contents

public Description[] describe_contents(DefinitionKind limit_type,
                                       boolean exclude_inherited,
                                       int max_returned_objs)
describe the contents of the repository
Specified by:
describe_contents in interface ContainerOperations

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


destroy

public void destroy()
Specified by:
destroy in interface IRObjectOperations
Overrides:
destroy in interface IRObject


get_canonical_typecode

public TypeCode get_canonical_typecode(TypeCode tc)
Specified by:
get_canonical_typecode in interface RepositoryOperations


get_primitive

public PrimitiveDef get_primitive(PrimitiveKind kind)
Specified by:
get_primitive in interface RepositoryOperations


loadContents

public void loadContents()


lookup

public Contained lookup(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_id

public Contained lookup_id(String search_id)
lookup a repository ID

Parameters:

Returns:
a reference to the object or null, if not found


lookup_name

public Contained[] lookup_name(String search_name,
                               int levels_to_search,
                               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