Skip to content

Martini Package Lifecycle

Overview

Every Martini package undergoes a lifecycle, indicated by its state. These states are pivotal in understanding how packages behave within Martini, affecting their interactions and available actions. Understanding the lifecycle is essential for efficient package management.

States and Their Definitions

UNLOADED

  • Definition: The package is not loaded; it's effectively non-existent in Martini until loaded.
  • Characteristics: ClassLoaders, WorkflowLoaders, ServiceLoaders, and other components are unavailable.
  • Common Use: When a package is not in use or being updated.

LOADING

  • Definition: The package is in the process of loading.
  • Considerations: Transitory state, usually brief.

LOADED

  • Definition: The package is loaded and its application components are available for use.
  • Characteristics: Services are accessible; however, HTTP endpoints and Martini endpoints are not.

LOAD_FAILED

  • Definition: The package failed to load.
  • Troubleshooting: Check for dependency issues or configuration errors.

UNLOADING

  • Definition: The package is unloading.
  • Considerations: Used when updating or removing a package.

STARTING

  • Definition: The package is starting.
  • Implications: Transitory, leading to either STARTED or START_FAILED.

STARTED

  • Definition: The package is fully operational.
  • Characteristics: All classes, services, and endpoints are available.

START_FAILED

  • Definition: The package failed to start.
  • Troubleshooting: Similar to LOAD_FAILED; check logs for specific errors.

STOPPING

  • Definition: The package is stopping.
  • Implications: Returns to LOADED state upon completion.

Transitioning States

States transition through lifecycle operations (load, unload, start, stop). These transitions are not manual but controlled by Martini's Package Manager.

In order to transition a package to another state, follow the steps below:

  1. Select the package(s) in the Navigator using modifier keys (e.g., mod or shift).
  2. Right-click and choose the desired operation (Start, Stop, Load, Unload).

Dependency Handling: Martini intelligently manages dependencies during these transitions, starting or stopping dependent packages as needed.

Features available on states

Feature UNLOADED LOADED STARTED
Service Triggers
Java classloader
Service classloader
Workflow classloader
Groovy extension modules
Groovy compiler engine
Service invocation
Indexing for IDE search
Package cache manager
Solr client
Spring context
Web applications
REST and SOAP APIs

Configuring the package start-up state

Martini, when it starts up, automatically transitions all packages to their configured state on startup. To configure this property, select the state you want for your package using the State on Startup dropdown in the Package configuration editor.