Class: Quark::MdkRuntime::Files::FileActorImpl

Inherits:
Object
  • Object
show all
Extended by:
DatawireQuarkCore::Static
Defined in:
lib/mdk_runtime/files.rb

Constant Summary

Constants included from DatawireQuarkCore::Static

DatawireQuarkCore::Static::Unassigned

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DatawireQuarkCore::Static

_lazy_statics, static, unlazy_statics

Constructor Details

#initialize(runtime) ⇒ FileActorImpl

Returns a new instance of FileActorImpl.



315
316
317
318
319
320
321
# File 'lib/mdk_runtime/files.rb', line 315

def initialize(runtime)
    
    super()
    (self).scheduling = runtime.getScheduleService()

    nil
end

Instance Attribute Details

#dispatcherObject

Returns the value of attribute dispatcher.



307
308
309
# File 'lib/mdk_runtime/files.rb', line 307

def dispatcher
  @dispatcher
end

#schedulingObject

Returns the value of attribute scheduling.



307
308
309
# File 'lib/mdk_runtime/files.rb', line 307

def scheduling
  @scheduling
end

#stoppedObject

Returns the value of attribute stopped.



307
308
309
# File 'lib/mdk_runtime/files.rb', line 307

def stopped
  @stopped
end

#subscriptionsObject

Returns the value of attribute subscriptions.



307
308
309
# File 'lib/mdk_runtime/files.rb', line 307

def subscriptions
  @subscriptions
end

Instance Method Details

#__init_fields__Object



444
445
446
447
448
449
450
451
452
453
# File 'lib/mdk_runtime/files.rb', line 444

def __init_fields__()
    
    super
    self.scheduling = nil
    self.dispatcher = nil
    self.subscriptions = ::DatawireQuarkCore::List.new([])
    self.stopped = false

    nil
end

#_checkSubscriptionsObject



347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/mdk_runtime/files.rb', line 347

def _checkSubscriptions()
    
    if ((self).stopped)
        return
    end
    (self).dispatcher.tell(self, ::Quark.mdk_runtime.Schedule.new("poll", 1.0), (self).scheduling)
    idx = 0
    while ((idx) < (((self).subscriptions).size)) do
        ((self).subscriptions)[idx].poll()
        idx = (idx) + (1)
    end

    nil
end

#_getClassObject



400
401
402
403
404
405
# File 'lib/mdk_runtime/files.rb', line 400

def _getClass()
    
    return "mdk_runtime.files.FileActorImpl"

    nil
end

#_getField(name) ⇒ Object



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/mdk_runtime/files.rb', line 407

def _getField(name)
    
    if ((name) == ("scheduling"))
        return (self).scheduling
    end
    if ((name) == ("dispatcher"))
        return (self).dispatcher
    end
    if ((name) == ("subscriptions"))
        return (self).subscriptions
    end
    if ((name) == ("stopped"))
        return (self).stopped
    end
    return nil

    nil
end

#_send(message, destination) ⇒ Object



393
394
395
396
397
398
# File 'lib/mdk_runtime/files.rb', line 393

def _send(message, destination)
    
    (self).dispatcher.tell(self, message, destination)

    nil
end

#_setField(name, value) ⇒ Object



426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/mdk_runtime/files.rb', line 426

def _setField(name, value)
    
    if ((name) == ("scheduling"))
        (self).scheduling = ::DatawireQuarkCore.cast(value) { ::Quark.mdk_runtime.actors.Actor }
    end
    if ((name) == ("dispatcher"))
        (self).dispatcher = ::DatawireQuarkCore.cast(value) { ::Quark.mdk_runtime.actors.MessageDispatcher }
    end
    if ((name) == ("subscriptions"))
        (self).subscriptions = ::DatawireQuarkCore.cast(value) { ::DatawireQuarkCore::List }
    end
    if ((name) == ("stopped"))
        (self).stopped = ::DatawireQuarkCore.cast(value) { ::Object }
    end

    nil
end

#delete(path) ⇒ Object



340
341
342
343
344
345
# File 'lib/mdk_runtime/files.rb', line 340

def delete(path)
    
    false

    nil
end

#mktempdirObject



326
327
328
329
330
331
# File 'lib/mdk_runtime/files.rb', line 326

def mktempdir()
    
    return ""

    nil
end

#onMessage(origin, message) ⇒ Object



377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/mdk_runtime/files.rb', line 377

def onMessage(origin, message)
    
    typeId = (::Quark.quark.reflect.QuarkClass.get(::DatawireQuarkCore._getClass(message))).id
    if ((typeId) == ("mdk_runtime.Happening"))
        self._checkSubscriptions()
        return
    end
    if ((typeId) == ("mdk_runtime.files.SubscribeChanges"))
        subscribe = ::DatawireQuarkCore.cast(message) { ::Quark.mdk_runtime.files.SubscribeChanges }
        ((self).subscriptions) << (::Quark.mdk_runtime.files._Subscription.new(self, origin, (subscribe).path))
        return
    end

    nil
end

#onStart(dispatcher) ⇒ Object



362
363
364
365
366
367
368
# File 'lib/mdk_runtime/files.rb', line 362

def onStart(dispatcher)
    
    (self).dispatcher = dispatcher
    self._checkSubscriptions()

    nil
end

#onStopObject



370
371
372
373
374
375
# File 'lib/mdk_runtime/files.rb', line 370

def onStop()
    
    (self).stopped = true

    nil
end

#write(path, contents) ⇒ Object



333
334
335
336
337
338
# File 'lib/mdk_runtime/files.rb', line 333

def write(path, contents)
    
    false

    nil
end