Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 75 lines (62 sloc) 2.811 kb
a889e92 @nebhale Add contribution guidelines
nebhale authored
1 # Encoding: utf-8
3a4931f @glyn Introduce Tomcat container infrastructure
glyn authored
2 # Cloud Foundry Java Buildpack
634b666 @cgfrost Updates the copyright statements dates
cgfrost authored
3 # Copyright 2013-2015 the original author or authors.
3a4931f @glyn Introduce Tomcat container infrastructure
glyn authored
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
f00b00c @nebhale Redis-based Session Replication
nebhale authored
17 require 'java_buildpack/component/modular_component'
3a4931f @glyn Introduce Tomcat container infrastructure
glyn authored
18 require 'java_buildpack/container'
f00b00c @nebhale Redis-based Session Replication
nebhale authored
19 require 'java_buildpack/container/tomcat/tomcat_insight_support'
20 require 'java_buildpack/container/tomcat/tomcat_instance'
21 require 'java_buildpack/container/tomcat/tomcat_lifecycle_support'
22 require 'java_buildpack/container/tomcat/tomcat_logging_support'
54dfe8d Support configurable Tomcat Access Logging
Christopher Frost authored
23 require 'java_buildpack/container/tomcat/tomcat_access_logging_support'
f00b00c @nebhale Redis-based Session Replication
nebhale authored
24 require 'java_buildpack/container/tomcat/tomcat_redis_store'
f50f328 @cgfrost Add support for Gem Fire session replication
cgfrost authored
25 require 'java_buildpack/container/tomcat/tomcat_gemfire_store'
3a4931f @glyn Introduce Tomcat container infrastructure
glyn authored
26
67a57bc @nebhale Version upgrades
nebhale authored
27 module JavaBuildpack
28 module Container
3a4931f @glyn Introduce Tomcat container infrastructure
glyn authored
29
67a57bc @nebhale Version upgrades
nebhale authored
30 # Encapsulates the detect, compile, and release functionality for Tomcat applications.
31 class Tomcat < JavaBuildpack::Component::ModularComponent
3a4931f @glyn Introduce Tomcat container infrastructure
glyn authored
32
67a57bc @nebhale Version upgrades
nebhale authored
33 protected
3a4931f @glyn Introduce Tomcat container infrastructure
glyn authored
34
34705ac @nebhale Use Yard (see ...) syntax
nebhale authored
35 # (see JavaBuildpack::Component::ModularComponent#command)
67a57bc @nebhale Version upgrades
nebhale authored
36 def command
37 @droplet.java_opts.add_system_property 'http.port', '$PORT'
a635078 @nebhale Add Spring Auto-reconfiguration JAR to Spring apps
nebhale authored
38
67a57bc @nebhale Version upgrades
nebhale authored
39 [
4c81feb @nebhale Application and Droplet abstractions
nebhale authored
40 @droplet.java_home.as_env_var,
41 @droplet.java_opts.as_env_var,
42 "$PWD/#{(@droplet.sandbox + 'bin/catalina.sh').relative_path_from(@droplet.root)}",
b61601c @nebhale Introduce Application abstraction
nebhale authored
43 'run'
67a57bc @nebhale Version upgrades
nebhale authored
44 ].flatten.compact.join(' ')
45 end
3a4931f @glyn Introduce Tomcat container infrastructure
glyn authored
46
34705ac @nebhale Use Yard (see ...) syntax
nebhale authored
47 # (see JavaBuildpack::Component::ModularComponent#sub_components)
67a57bc @nebhale Version upgrades
nebhale authored
48 def sub_components(context)
49 [
f00b00c @nebhale Redis-based Session Replication
nebhale authored
50 TomcatInstance.new(sub_configuration_context(context, 'tomcat')),
51 TomcatLifecycleSupport.new(sub_configuration_context(context, 'lifecycle_support')),
52 TomcatLoggingSupport.new(sub_configuration_context(context, 'logging_support')),
54dfe8d Support configurable Tomcat Access Logging
Christopher Frost authored
53 TomcatAccessLoggingSupport.new(sub_configuration_context(context, 'access_logging_support')),
f00b00c @nebhale Redis-based Session Replication
nebhale authored
54 TomcatRedisStore.new(sub_configuration_context(context, 'redis_store')),
f50f328 @cgfrost Add support for Gem Fire session replication
cgfrost authored
55 TomcatGemfireStore.new(sub_configuration_context(context, 'gemfire_store')),
f00b00c @nebhale Redis-based Session Replication
nebhale authored
56 TomcatInsightSupport.new(context)
67a57bc @nebhale Version upgrades
nebhale authored
57 ]
58 end
956f236 @nebhale Make extension more palatable
nebhale authored
59
34705ac @nebhale Use Yard (see ...) syntax
nebhale authored
60 # (see JavaBuildpack::Component::ModularComponent#supports?)
67a57bc @nebhale Version upgrades
nebhale authored
61 def supports?
62 web_inf? && !JavaBuildpack::Util::JavaMainUtils.main_class(@application)
63 end
956f236 @nebhale Make extension more palatable
nebhale authored
64
67a57bc @nebhale Version upgrades
nebhale authored
65 private
66
67 def web_inf?
68 (@application.root + 'WEB-INF').exist?
69 end
3a4931f @glyn Introduce Tomcat container infrastructure
glyn authored
70
1eda6db @glyn Reformat all Ruby code
glyn authored
71 end
3a4931f @glyn Introduce Tomcat container infrastructure
glyn authored
72
73 end
74 end
Something went wrong with that request. Please try again.