module Orocos::CORBA

Attributes

call_timeout[R]

Returns the current timeout for method calls, in milliseconds Orocos.rb sets it to 20000 ms by default

See call_timeout= for a complete description

connect_timeout[R]

Returns the timeout, in milliseconds, before a connection creation fails. Orocos.rb sets it to 2000 ms by default

See connect_timeout=

max_message_size[R]

The maximum message size, in bytes, allowed by the omniORB. It can only be set before Orocos.initialize is called

orocos.rb sets the default to 4GB (the maximum)

Public Class Methods

call_timeout=(value) click to toggle source

Sets the timeout, in milliseconds, for a CORBA method call to be completed. It means that no method call can exceed the specified value.

# File lib/orocos/corba.rb, line 47
def call_timeout=(value)
    do_call_timeout(value)
    @call_timeout = value
end
cleanup() click to toggle source

Calls cleanup on the global Orocos::CORBA::NameService instance {Orocos::CORBA.name_service}

@see Orocos::CORBA::NameService#cleanup

# File lib/orocos/name_service.rb, line 516
def cleanup
    name_service.cleanup
end
clear() click to toggle source
# File lib/orocos/corba.rb, line 109
def self.clear
    @name_service = nil
end
connect_timeout=(value) click to toggle source

Sets the timeout, in milliseconds, before a connection creation fails.

# File lib/orocos/corba.rb, line 61
def connect_timeout=(value)
    do_connect_timeout(value)
    @connect_timeout = value
end
deinit() click to toggle source

Deinitializes the CORBA layer

It shuts down the CORBA access and deregisters the Ruby process from the server

# File lib/orocos/corba.rb, line 105
def self.deinit
    do_deinit
end
get(method, name) click to toggle source
# File lib/orocos/corba.rb, line 90
def self.get(method, name)
    if !Orocos::CORBA.initialized?
        raise NotInitialized, "the CORBA layer is not initialized, call Orocos.initialize first"
    end

    result = ::Orocos::CORBA.refine_exceptions("naming service") do
        ::Orocos::TaskContext.send(method, name)
    end
    result
end
initialize() click to toggle source

Initialize the CORBA layer

It does not need to be called explicitely, as it is called by Orocos.initialize

# File lib/orocos/corba.rb, line 76
def self.initialize
    #setup environment which is used by the orocos.rb
    if !CORBA.name_service.ip.empty?
        ENV['ORBInitRef'] = "NameService=corbaname::#{CORBA.name_service.ip}"
    end

    self.call_timeout    ||= 20000
    self.connect_timeout ||= 2000
    do_init

    #check if name service is reachable
    CORBA.name_service.validate
end
load_typekit(name) click to toggle source

@deprecated use {Orocos.load_typekit} instead

# File lib/orocos/corba.rb, line 68
def self.load_typekit(name)
    Orocos.load_typekit(name)
end
max_message_size=(value) click to toggle source
# File lib/orocos/corba.rb, line 18
def max_message_size=(value)
    if initialized?
        raise "the maximum message size can only be changed before the CORBA layer is initialized"
    end

    ENV['ORBgiopMaxMsgSize'] = value.to_int.to_s
end
name_service() click to toggle source

Returns the global CORBA name service which is used to register all Orocos Tasks started by the ruby instance and is by default added to the global Orocos::NameService instance {Orocos.name_service}

@return [Orocos::CORBA::NameService] The global CORBA name service

# File lib/orocos/name_service.rb, line 486
def name_service
    @name_service ||= NameService.new
end
name_service=(service) click to toggle source

Sets the default CORBA name service and replaces the old instance stored in {Orocos#name_service} if there is one.

@param [Orocos::CORBA::NameService] service the name service

# File lib/orocos/name_service.rb, line 494
def name_service=(service)
    if service.respond_to? :to_str
        # To support deprecated way of setting the host name
        CORBA.warn "Orocos::CORBA.name_service = 'host_name' is deprecated."
        CORBA.warn "Use Orocos::CORBA.name_service.ip = 'host_name' instead."
        name_service.ip = service
    else
        #check if the old name service is added to the global Orocos.name_service
        #and replace it with the new one
        Orocos.name_service.name_services.each_with_index do |i,val|
            if val == @name_service
                Orocos.name_service.name_services[i] = service
                break
            end
        end
        @name_service = service
    end
end