Class: MintPress::Instances::Instance

Inherits:
Object
  • Object
show all
Includes:
MintLogger, Mixins::Properties
Defined in:
src/mintpress-utils/lib/mintpress-utils/instance.rb,
src/oracle-exalogic-tools/lib/oracle-exalogic-tools/mintpress_tools.rb

Overview

This is the superclass for all instances - an instance is a thing that you can start, stop, and check the status of

Properties (Read/Write)

  • #name ⇒ String

    Property Attributes
    
    
    15
    # File 'src/mintpress-utils/lib/mintpress-utils/instance.rb', line 15
    
    property :name, type: String
  • #instance_home
    Subclasses should add a `default: Proc.new { installation.path_property` } to their definition of this, if it makes sense to do so. For example, the FMWInstance subclass defines this as `Proc.new { installation.fmw_home }` The tomcat version, will instead define this as `default: Proc.new { installation.home }`, but also define java_home as `default: Proc.new { installation.java_home }`, allowing the user to specify both of these without having to link to an installation object

    Property Attributes
    
    
    22
    # File 'src/mintpress-utils/lib/mintpress-utils/instance.rb', line 22
    
    property :instance_home
  • #installation
    Subclasses should NEVER EVER use this as anything except as a default to `instance_home` and related ittems But it exists here as an advisory thing to add

    Property Attributes
    
    
    25
    # File 'src/mintpress-utils/lib/mintpress-utils/instance.rb', line 25
    
    property :installation
  • #start_timeout ⇒ Integer (Default Value: 300)
    Startup timeout in seconds

    Property Attributes
    • default300
    
    
    28
    # File 'src/mintpress-utils/lib/mintpress-utils/instance.rb', line 28
    
    property :start_timeout, type: Integer, default: 300
  • #process_start_timeout ⇒ Integer (Default Value: 30)

    Property Attributes
    • default30
    
    
    29
    # File 'src/mintpress-utils/lib/mintpress-utils/instance.rb', line 29
    
    property :process_start_timeout, type: Integer, default: 30
  • #stop_timeout ⇒ Integer (Default Value: 300)
    Shutdown timeout in seconds

    Property Attributes
    • default300
    
    
    31
    # File 'src/mintpress-utils/lib/mintpress-utils/instance.rb', line 31
    
    property :stop_timeout, type: Integer, default: 300
  • #host ⇒ MintPress::Infrastructure::Host (Default Value: Proc.new { installation.host })
    Host where the instance is runninig. This is entirely optional, but can help with a generic implementation It will default to `installation.host` if it exists

    Property Attributes
    • defaultProc.new { installation.host }
    
    
    35
    # File 'src/mintpress-utils/lib/mintpress-utils/instance.rb', line 35
    
    property :host, type: MintPress::Infrastructure::Host, default: Proc.new { installation.host }

Properties (Read Only)

Constant Summary

Constants included from MintLogger

MintLogger::DEBUG, MintLogger::ERROR, MintLogger::FATAL, MintLogger::INFO, MintLogger::UNKNOWN, MintLogger::VERBOSE, MintLogger::WARN

Instance Attribute Summary

Attributes included from Mixins::Properties

#autopush_set_cache, #dynamic_create, #harvest_on_access, #harvest_undefined_only, #harvested, #tree_root

Instance Method Summary collapse

Methods included from MintLogger::Utils::Common

#boolean_val, #has_value?, #no_value?, #nvl, #path_as_symbol, #ruby_level_to_send

Methods included from Mixins::Properties

#[], #[]=, #add_validate_report_result, #armour_set_property, #array_contains?, #array_is_a?, #check_autopush, #check_stack_overflow, #clone_property_object, #cloner_handle_single_property, #coerce_single, #contains_as_string?, #display_validate_report_result, #double_initialize?, #dump_to_hash, #find_parent, #find_parent_by_identity, #generate_accessor_functions, #get_canonical_renamed, #get_from_opts, #get_my_name, #get_property, #get_property_item, #has?, included, #initialize_validate_report, #inspect, #is_cloned_object?, #is_mintpress_object?, #is_probably_canonical?, #is_set?, #local_debug, #local_info, #local_verbose, #mintpress_property_definitions, #place_object_by_identity, #process_properties, #prop_set?, #property, #property_definitions, #property_details, #property_is_simple_object?, #push_root!, #require_property, #require_update, #retrieve_docstring, #sanitize, #set_map_dirty, #set_property, #set_property_item, #show_short_array, #strip_defaults!, #synchronize, #uncloned_property_definitions, #update_map, #validate, #validate_generic, #validate_properties, #validate_property, #validate_required, #version_allowed?, #weakref

Constructor Details

#initialize(opts = {}) ⇒ Instance

Returns a new instance of Instance.

Instance Method Details

#createObject

#destroyObject

#exists?Boolean

Returns:

  • (Boolean)

#has_process?Boolean

Is the instances process running - this informs if we have transitioned into STARTING or STOPPING If we're given an array from process_name, then ANY match, since this is really "has the supervisor started" - the running? check should demand _all_ processes are up, this this demands only _something_ has started - this is the "has the OS just crapped out" style of check!

Returns:

  • (Boolean)

#internal_call(sym) ⇒ Object

Are _btoh_ sym and sym_async called from _within this file_?

#process_idObject

#process_nameObject

What is the process name of this instance - it will be used to find the process via a pgrep

#real_stateObject

Get a textual state - the default implementation returns RUNNING or SHUTDOWN

#running?Boolean

Is the instance actually responding?

Returns:

  • (Boolean)

#shutdownObject

Provided for enhanced UX - do not override this in your implementations, implement `stop` instead

#shutdown_asyncObject

Provided for enhanced UX - do not override this in your implementations, implement `stop_async` instead

#startObject

Start an instance syncronously

#start_asyncObject

Background start an instance

#state(cached: false) ⇒ Object

Get a textual state - the default implementation returns RUNNING or SHUTDOWN

#stopObject

Stop an instance syncronously

#stop_asyncObject

Background stop an instance