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



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/corba/common/Servant.rb', line 22

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



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/corba/common/Servant.rb', line 73

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



217
218
219
220
221
222
223
# File 'lib/corba/jbase/Servant.rb', line 217

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

#_thisObject



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/corba/jbase/Servant.rb', line 225

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



34
35
36
# File 'lib/corba/common/Servant.rb', line 34

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

#srvref_Object



213
214
215
# File 'lib/corba/jbase/Servant.rb', line 213

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