Class: R2CORBA::PortableServer::Servant

Inherits:
Object
  • Object
show all
Defined in:
lib/corba/jbase/Servant.rb,
lib/corba/common/Servant.rb

Overview

DSI

Direct Known Subclasses

DynamicImplementation

Defined Under Namespace

Modules: Intf

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.include(*modules) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/corba/common/Servant.rb', line 26

def Servant.include(*modules)
  modules.reverse_each { |mod|
    if mod.respond_to?(:superclass) && mod.superclass == R2CORBA::PortableServer::Servant
      include_srv(mod)
    elsif mod < CORBA::ValueBase && mod.const_defined?(:Intf)
      include_valuetype(mod)
    else
      super(mod)
    end
  }
end

.include_valuetype(vt) ⇒ Object



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/corba/common/Servant.rb', line 77

def Servant.include_valuetype(vt)
  self.module_eval do
    if vt < CORBA::Portable::CustomValueBase
      include CORBA::Portable::CustomValueBase unless self.include?(CORBA::Portable::CustomValueBase)
    else
      include CORBA::ValueBase unless self.include?(CORBA::ValueBase)
    end
    self.const_set(:TRUNCATABLE_IDS, vt::TRUNCATABLE_IDS)
    self.const_set(:VT_TC, vt._tc)
    #@@tc_vt_ = vt._tc
    def self._tc
      #@@tc_vt_
      self.const_get(:VT_TC)
    end
    include vt::Intf
  end
end

Instance Method Details

#_default_POAObject



221
222
223
224
225
226
227
# File 'lib/corba/jbase/Servant.rb', line 221

def _default_POA()
  begin
    return PortableServer::POA._narrow(CORBA::Object._wrap_native(self.srvref_._default_POA()))
  rescue ::NativeException
    CORBA::Exception.native2r($!)
  end
end

#_thisObject



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/corba/jbase/Servant.rb', line 229

def _this()
  unless @srvref_.nil?
    begin
      return CORBA::Object._wrap_native(self.srvref_._this_object())
    rescue NativeException
      # not in call context or not associated with ORB yet
    end
  end
  raise CORBA::BAD_INV_ORDER.new('no ORB initialized',0,CORBA::COMPLETED_NO) if CORBA::ORB._orb.nil?
  begin
    return CORBA::Object._wrap_native(self.srvref_._this_object(CORBA::ORB._orb))
  rescue ::NativeException
    CORBA::Exception.native2r($!)
  end
end

#get_operation_signature(opsym) ⇒ Object



38
39
40
# File 'lib/corba/common/Servant.rb', line 38

def get_operation_signature(opsym)
  self.class::Operations[opsym]
end

#srvref_Object



217
218
219
# File 'lib/corba/jbase/Servant.rb', line 217

def srvref_
  @srvref_ ||= PortableServer::DSI::Servant.new_instance(self)
end