gnu.CORBA

Class OrbRestricted

Known Direct Subclasses:
OrbFunctional

public class OrbRestricted
extends ORB

This class implements so-called Singleton ORB, a highly restricted version that cannot communicate over network. This ORB is provided for the potentially malicious applets with heavy security restrictions. It, however, supports some basic features that might be needed even when the network access is not granted. This ORB can only create typecodes, Any, ContextList, NVList and OutputStream that writes to an internal buffer. All other methods throw the NO_IMPLEMENT exception.

Field Summary

static ORB
Singleton
The singleton instance of this ORB.
protected Hashtable<K,V>
factories
The value factories.
ClientRequestInterceptorOperations
iClient
The cumulated listener for all client request interceptros.
IORInterceptor_3_0Operations
iIor
The cumulated listener for all IOR interceptors.
ServerRequestInterceptorOperations
iServer
The cumulated listener for all server request interceptors.
int
icSlotSize
The required size of the interceptor slot array.
protected Hashtable<K,V>
policyFactories
The policy factories.

Constructor Summary

OrbRestricted()
Create a new instance of the RestrictedORB.

Method Summary

TypeCode
create_alias_tc(String id, String name, TypeCode typecode)
Any
create_any()
TypeCode
create_array_tc(int length, TypeCode element_type)
ContextList
create_context_list()
TypeCode
create_enum_tc(String id, String name, String[] values)
Environment
create_environment()
ExceptionList
create_exception_list()
TypeCode
create_exception_tc(String id, String name, StructMember[] members)
TypeCode
create_interface_tc(String id, String name)
This method is not allowed for a RestrictedORB.
NVList
create_list(int count)
NamedValue
create_named_value(String s, Any any, int flags)
OutputStream
create_output_stream()
TypeCode
create_recursive_sequence_tc(int bound, int offset)
Deprecated. It is easier and clearler to use a combination of create_recursive_tc and create_sequence_tc instead.
TypeCode
create_sequence_tc(int bound, TypeCode element_type)
TypeCode
create_string_tc(int bound)
TypeCode
create_struct_tc(String id, String name, StructMember[] members)
TypeCode
create_union_tc(String id, String name, TypeCode discriminator_type, UnionMember[] members)
TypeCode
create_wstring_tc(int bound)
void
destroy()
Destroy the interceptors, if they are present.
Context
get_default_context()
Get the default context of this ORB.
Request
get_next_response()
This method is not allowed for a RestrictedORB.
TypeCode
get_primitive_tc(TCKind tcKind)
String[]
list_initial_services()
This method is not allowed for a RestrictedORB.
ValueFactory
lookup_value_factory(String repository_id)
Look for the value factory for the value, having the given repository id.
String
object_to_string(Object forObject)
This method is not allowed for a RestrictedORB.
boolean
poll_next_response()
This method is not allowed for a RestrictedORB.
ValueFactory
register_value_factory(String repository_id, ValueFactory factory)
Register the value factory under the given repository id.
Object
resolve_initial_references(String name)
This method is not allowed for a RestrictedORB.
void
run()
Shutdown the ORB server.
void
send_multiple_requests_deferred(Request[] requests)
This method is not allowed for a RestrictedORB.
void
send_multiple_requests_oneway(Request[] requests)
This method is not allowed for a RestrictedORB.
protected void
set_parameters(Applet app, Properties props)
This method is not allowed for a RestrictedORB.
protected void
set_parameters(String[] args, Properties props)
This method is not allowed for a RestrictedORB.
void
shutdown(boolean wait_for_completion)
Shutdown the ORB server.
Object
string_to_object(String IOR)
This method is not allowed for a RestrictedORB.
void
unregister_value_factory(String id)
Unregister the value factroy.

Methods inherited from class org.omg.CORBA_2_3.ORB

get_value_def, lookup_value_factory, register_value_factory, set_delegate, unregister_value_factory

Methods inherited from class org.omg.CORBA.ORB

connect, create_abstract_interface_tc, create_alias_tc, create_any, create_array_tc, create_basic_dyn_any, create_context_list, create_dyn_any, create_dyn_array, create_dyn_enum, create_dyn_sequence, create_dyn_struct, create_dyn_union, create_enum_tc, create_environment, create_exception_list, create_exception_tc, create_fixed_tc, create_interface_tc, create_list, create_named_value, create_native_tc, create_operation_list, create_output_stream, create_policy, create_recursive_sequence_tc, create_recursive_tc, create_sequence_tc, create_string_tc, create_struct_tc, create_union_tc, create_value_box_tc, create_value_tc, create_wstring_tc, destroy, disconnect, get_current, get_default_context, get_next_response, get_primitive_tc, get_service_information, init, init, init, list_initial_services, object_to_string, perform_work, poll_next_response, resolve_initial_references, run, send_multiple_requests_deferred, send_multiple_requests_oneway, set_parameters, set_parameters, shutdown, string_to_object, work_pending

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

Singleton

public static final ORB Singleton
The singleton instance of this ORB.

factories

protected Hashtable<K,V> factories
The value factories.

iClient

public ClientRequestInterceptorOperations iClient
The cumulated listener for all client request interceptros. Interceptors are used by ORB_1_4.

iIor

public IORInterceptor_3_0Operations iIor
The cumulated listener for all IOR interceptors. Interceptors are used by ORB_1_4.

iServer

public ServerRequestInterceptorOperations iServer
The cumulated listener for all server request interceptors. Interceptors are used by ORB_1_4.

icSlotSize

public int icSlotSize
The required size of the interceptor slot array.

policyFactories

protected Hashtable<K,V> policyFactories
The policy factories.

Constructor Details

OrbRestricted

protected OrbRestricted()
Create a new instance of the RestrictedORB. This is used in derived classes only.

Method Details

create_alias_tc

public TypeCode create_alias_tc(String id,
                                String name,
                                TypeCode typecode)
Overrides:
create_alias_tc in interface ORB

create_any

public Any create_any()
Overrides:
create_any in interface ORB

create_array_tc

public TypeCode create_array_tc(int length,
                                TypeCode element_type)
Overrides:
create_array_tc in interface ORB

create_context_list

public ContextList create_context_list()
Overrides:
create_context_list in interface ORB

create_enum_tc

public TypeCode create_enum_tc(String id,
                               String name,
                               String[] values)
Overrides:
create_enum_tc in interface ORB

create_environment

public Environment create_environment()
Overrides:
create_environment in interface ORB

create_exception_list

public ExceptionList create_exception_list()
Overrides:
create_exception_list in interface ORB

create_exception_tc

public TypeCode create_exception_tc(String id,
                                    String name,
                                    StructMember[] members)
Overrides:
create_exception_tc in interface ORB

create_interface_tc

public TypeCode create_interface_tc(String id,
                                    String name)
This method is not allowed for a RestrictedORB.
Overrides:
create_interface_tc in interface ORB

create_list

public NVList create_list(int count)
Overrides:
create_list in interface ORB

create_named_value

public NamedValue create_named_value(String s,
                                     Any any,
                                     int flags)
Overrides:
create_named_value in interface ORB

create_output_stream

public OutputStream create_output_stream()
Overrides:
create_output_stream in interface ORB

create_recursive_sequence_tc

public TypeCode create_recursive_sequence_tc(int bound,
                                             int offset)

Deprecated. It is easier and clearler to use a combination of create_recursive_tc and create_sequence_tc instead.

Create a typecode, representing a tree-like structure. This structure contains a member that is a sequence of the same type, as the structure itself. You can imagine as if the folder definition contains a variable-length array of the enclosed (nested) folder definitions. In this way, it is possible to have a tree like structure that can be transferred via CORBA CDR stream.
Overrides:
create_recursive_sequence_tc in interface ORB
Parameters:
bound - the maximal expected number of the nested components on each node; 0 if not limited.
offset - the position of the field in the returned structure that contains the sequence of the structures of the same field. The members before this field are intialised using parameterless StructMember constructor.
Returns:
a typecode, defining a stucture, where a member at the offset position defines an array of the identical structures.

create_sequence_tc

public TypeCode create_sequence_tc(int bound,
                                   TypeCode element_type)
Overrides:
create_sequence_tc in interface ORB

create_string_tc

public TypeCode create_string_tc(int bound)
Overrides:
create_string_tc in interface ORB

create_struct_tc

public TypeCode create_struct_tc(String id,
                                 String name,
                                 StructMember[] members)
Overrides:
create_struct_tc in interface ORB

create_union_tc

public TypeCode create_union_tc(String id,
                                String name,
                                TypeCode discriminator_type,
                                UnionMember[] members)
Overrides:
create_union_tc in interface ORB

create_wstring_tc

public TypeCode create_wstring_tc(int bound)
Overrides:
create_wstring_tc in interface ORB

destroy

public void destroy()
Destroy the interceptors, if they are present.
Overrides:
destroy in interface ORB

get_default_context

public Context get_default_context()
Get the default context of this ORB. This is an initial root of all contexts. The default method returns a new context with the empty name and no parent context.
Overrides:
get_default_context in interface ORB
Returns:
the default context of this ORB.

get_next_response

public Request get_next_response()
            throws WrongTransaction
This method is not allowed for a RestrictedORB.
Overrides:
get_next_response in interface ORB

get_primitive_tc

public TypeCode get_primitive_tc(TCKind tcKind)
Overrides:
get_primitive_tc in interface ORB

list_initial_services

public String[] list_initial_services()
This method is not allowed for a RestrictedORB.
Overrides:
list_initial_services in interface ORB

lookup_value_factory

public ValueFactory lookup_value_factory(String repository_id)
Look for the value factory for the value, having the given repository id. The implementation checks for the registered value factories first. If none found, it tries to load and instantiate the class, mathing the given naming convention. If this faild, null is returned.
Overrides:
lookup_value_factory in interface ORB
Parameters:
repository_id - a repository id.
Returns:
a found value factory, null if none.

object_to_string

public String object_to_string(Object forObject)
This method is not allowed for a RestrictedORB.
Overrides:
object_to_string in interface ORB

poll_next_response

public boolean poll_next_response()
This method is not allowed for a RestrictedORB.
Overrides:
poll_next_response in interface ORB

register_value_factory

public ValueFactory register_value_factory(String repository_id,
                                           ValueFactory factory)
Register the value factory under the given repository id.
Overrides:
register_value_factory in interface ORB

resolve_initial_references

public Object resolve_initial_references(String name)
            throws InvalidName
This method is not allowed for a RestrictedORB.
Overrides:
resolve_initial_references in interface ORB
Throws:
InvalidName - never in this class, but it is thrown in the derived classes.

run

public void run()
Shutdown the ORB server. For RestrictedORB, returns witout action.
Overrides:
run in interface ORB

send_multiple_requests_deferred

public void send_multiple_requests_deferred(Request[] requests)
This method is not allowed for a RestrictedORB.
Overrides:
send_multiple_requests_deferred in interface ORB

send_multiple_requests_oneway

public void send_multiple_requests_oneway(Request[] requests)
This method is not allowed for a RestrictedORB.
Overrides:
send_multiple_requests_oneway in interface ORB

set_parameters

protected void set_parameters(Applet app,
                              Properties props)
This method is not allowed for a RestrictedORB.
Overrides:
set_parameters in interface ORB

set_parameters

protected void set_parameters(String[] args,
                              Properties props)
This method is not allowed for a RestrictedORB.
Overrides:
set_parameters in interface ORB

shutdown

public void shutdown(boolean wait_for_completion)
Shutdown the ORB server. For RestrictedORB, returns witout action.
Overrides:
shutdown in interface ORB

string_to_object

public Object string_to_object(String IOR)
This method is not allowed for a RestrictedORB.
Overrides:
string_to_object in interface ORB

unregister_value_factory

public void unregister_value_factory(String id)
Unregister the value factroy.
Overrides:
unregister_value_factory in interface ORB

RestrictedORB.java -- Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.