Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calavera/trinidad_lifecycle_extension
Extension to allow to add lifecycle listeners to the Trinidad's server and the applications running on top of it.
https://github.com/calavera/trinidad_lifecycle_extension
Last synced: about 2 months ago
JSON representation
Extension to allow to add lifecycle listeners to the Trinidad's server and the applications running on top of it.
- Host: GitHub
- URL: https://github.com/calavera/trinidad_lifecycle_extension
- Owner: calavera
- License: other
- Created: 2010-09-09T19:06:01.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-03-30T16:55:01.000Z (almost 14 years ago)
- Last Synced: 2024-04-14T09:16:04.578Z (9 months ago)
- Language: Ruby
- Homepage: http://github.com/calavera/trinidad_lifecycle_extension
- Size: 109 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: History.txt
- License: LICENSE
Awesome Lists containing this project
README
Trinidad lifecycle extension
============================This extension allows you to add lifecycle listeners written in ruby to the
Trinidad's server context as well as each application context that runs on top
of Trinidad.This extension also allows to enable the jmx monitoring capabilities of Tomcat.
The configuration that Tomcat needs can be set as JAVA_OPTS properties or
through the Trinidad's configuration file.Configuration
=============Add this extension into the Trinidad's configuration file and include the path
to the directory where the listeners are. For instance:extensions:
lifecycle:
path: 'lib/lifecycle' # Path by default, not requiredTrinidad will try to load each class into that directory and add it to the
approrpiated context regarding where the extension will be configured, into the
server section or into the web_app section.How to write a lifecycle listener
=================================If the listener is for the server the class must be into the module
Trinidad::Lifecycle::Server but if it's for the web application it must be into
the module Trinidad::Lifecycle::WebApp. The class must include the java class
LifecycleListener and must contain the method `lifecycleEvent(event)`. For
example:module Trinidad
module Lifecycle
module WebApp
class WebAppListener
include Trinidad::Tomcat::LifecycleListenerdef lifecycleEvent(event)
if Trinidad::Tomcat::Lifecycle::BEFORE_START_EVENT == event.type
# do something before start the web application context
end
end
end
end
end
endAs a reference, Trinidad is configured with a lifecycle listener, here is the
code:http://github.com/calavera/trinidad/blob/master/lib/trinidad/web_app_lifecycle_listener.rb
You should also be familiar with the Tomcat's life cycle:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Lifecycle.java?view=markup
== Copyright
Copyright (c) 2011 David Calavera. See LICENSE for details.