commit e5f9c9d6173877a689e4b1d781fc41f155190874 Author: Template builder Date: Wed Jul 10 06:01:18 2013 -0400 Creating template diff --git a/.openshift/action_hooks/README.md b/.openshift/action_hooks/README.md new file mode 100644 index 00000000..86ac3ec5 --- /dev/null +++ b/.openshift/action_hooks/README.md @@ -0,0 +1,3 @@ +For information about which action hooks are supported, consult the OpenShift documentation: + +https://github.com/openshift/origin-server/blob/master/node/README.writing_applications.md diff --git a/.openshift/config/modules/README b/.openshift/config/modules/README new file mode 100755 index 00000000..45526172 --- /dev/null +++ b/.openshift/config/modules/README @@ -0,0 +1,18 @@ +Place your JBoss EAP6.0 modules in this directory. This directory is added to the +module path of the EAP6.0 server associated with your application. It has the +same structure as the standard EAP6.0 modules directory. + +The modules placed in this directory will be added to or override the default modules +provided by the OpenShift JBoss EAP6.0 cartridge. + +Scenarios: +1) Replace a default module with a new module that contains a bug fix or new feature +2) Add a module that does not exist in the base OpenShift EAP6.0 cartridge in order to add +a new component. Typically these new modules will need to be enabled and configured in +standalone.xml + +Unless one of the above scenarios is required there is no need to modify the +modules directory. + +NOTE: Replacing default modules as in scenario 1 can cause conflicts between modules so +should be done with caution and adequate testing. \ No newline at end of file diff --git a/.openshift/config/standalone.xml b/.openshift/config/standalone.xml new file mode 100755 index 00000000..6e611940 --- /dev/null +++ b/.openshift/config/standalone.xml @@ -0,0 +1,537 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jdbc:h2:${jboss.server.data.dir}/test;DB_CLOSE_DELAY=-1 + + h2 + + sa + sa + + + + jdbc:mysql://${env.OPENSHIFT_MYSQL_DB_HOST}:${env.OPENSHIFT_MYSQL_DB_PORT}/${env.OPENSHIFT_APP_NAME} + + mysql + + ${env.OPENSHIFT_MYSQL_DB_USERNAME} + ${env.OPENSHIFT_MYSQL_DB_PASSWORD} + + + SELECT 1 + true + + + IdleConnections + + + + + jdbc:postgresql://${env.OPENSHIFT_POSTGRESQL_DB_HOST}:${env.OPENSHIFT_POSTGRESQL_DB_PORT}/${env.OPENSHIFT_APP_NAME} + + postgresql + + ${env.OPENSHIFT_POSTGRESQL_DB_USERNAME} + ${env.OPENSHIFT_POSTGRESQL_DB_PASSWORD} + + + SELECT 1 + true + + + IdleConnections + + + + + + org.h2.jdbcx.JdbcDataSource + + + + com.mysql.jdbc.jdbc2.optional.MysqlXADataSource + + + + org.postgresql.xa.PGXADataSource + + + + + + + + + + false + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${env.OPENSHIFT_GEAR_DNS} + ${env.OPENSHIFT_JBOSSEAP_CLUSTER_PROXY_PORT} + + 7600 + ${env.OPENSHIFT_JBOSSEAP_IP} + true + + + 3000 + ${env.OPENSHIFT_JBOSSEAP_CLUSTER} + 0 + 1 + + + + + + + + + + org.jgroups.auth.MD5Token + SHA + ${env.OPENSHIFT_APP_UUID} + + + + + + + + + + + + + + + + + + + + + + + true + true + false + 102400 + 2 + + ${messaging.thread.pool.max.size} + ${messaging.scheduled.thread.pool.max.size} + + + + + + + + + + + + + + jms.queue.DLQ + jms.queue.ExpiryQueue + 0 + 1000 + 10485760 + BLOCK + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + ${env.OPENSHIFT_GEAR_DNS} + 80 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.openshift/cron/README.cron b/.openshift/cron/README.cron new file mode 100644 index 00000000..aad91380 --- /dev/null +++ b/.openshift/cron/README.cron @@ -0,0 +1,22 @@ +Run scripts or jobs on a periodic basis +======================================= +Any scripts or jobs added to the minutely, hourly, daily, weekly or monthly +directories will be run on a scheduled basis (frequency is as indicated by the +name of the directory) using run-parts. + +run-parts ignores any files that are hidden or dotfiles (.*) or backup +files (*~ or *,) or named *.{rpmsave,rpmorig,rpmnew,swp,cfsaved} + +The presence of two specially named files jobs.deny and jobs.allow controls +how run-parts executes your scripts/jobs. + jobs.deny ===> Prevents specific scripts or jobs from being executed. + jobs.allow ===> Only execute the named scripts or jobs (all other/non-named + scripts that exist in this directory are ignored). + +The principles of jobs.deny and jobs.allow are the same as those of cron.deny +and cron.allow and are described in detail at: + http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Automating_System_Tasks.html#s2-autotasks-cron-access + +See: man crontab or above link for more details and see the the weekly/ + directory for an example. + diff --git a/.openshift/cron/daily/.gitignore b/.openshift/cron/daily/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/.openshift/cron/hourly/.gitignore b/.openshift/cron/hourly/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/.openshift/cron/minutely/.gitignore b/.openshift/cron/minutely/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/.openshift/cron/monthly/.gitignore b/.openshift/cron/monthly/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/.openshift/cron/weekly/README b/.openshift/cron/weekly/README new file mode 100644 index 00000000..7c3e659f --- /dev/null +++ b/.openshift/cron/weekly/README @@ -0,0 +1,16 @@ +Run scripts or jobs on a weekly basis +===================================== +Any scripts or jobs added to this directory will be run on a scheduled basis +(weekly) using run-parts. + +run-parts ignores any files that are hidden or dotfiles (.*) or backup +files (*~ or *,) or named *.{rpmsave,rpmorig,rpmnew,swp,cfsaved} and handles +the files named jobs.deny and jobs.allow specially. + +In this specific example, the chronograph script is the only script or job file +executed on a weekly basis (due to white-listing it in jobs.allow). And the +README and chrono.dat file are ignored either as a result of being black-listed +in jobs.deny or because they are NOT white-listed in the jobs.allow file. + +For more details, please see ../README.cron file. + diff --git a/.openshift/cron/weekly/chrono.dat b/.openshift/cron/weekly/chrono.dat new file mode 100644 index 00000000..fc4abb87 --- /dev/null +++ b/.openshift/cron/weekly/chrono.dat @@ -0,0 +1 @@ +Time And Relative D...n In Execution (Open)Shift! diff --git a/.openshift/cron/weekly/chronograph b/.openshift/cron/weekly/chronograph new file mode 100644 index 00000000..5b03fa89 --- /dev/null +++ b/.openshift/cron/weekly/chronograph @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "$(date): $(cat $(dirname \"$0\")/chrono.dat)" diff --git a/.openshift/cron/weekly/jobs.allow b/.openshift/cron/weekly/jobs.allow new file mode 100644 index 00000000..8d32abc7 --- /dev/null +++ b/.openshift/cron/weekly/jobs.allow @@ -0,0 +1,12 @@ +# +# Script or job files listed in here (one entry per line) will be +# executed on a weekly-basis. +# +# Example: The chronograph script will be executed weekly but the README +# and chrono.dat files in this directory will be ignored. +# +# The README file is actually ignored due to the entry in the +# jobs.deny which is checked before jobs.allow (this file). +# +chronograph + diff --git a/.openshift/cron/weekly/jobs.deny b/.openshift/cron/weekly/jobs.deny new file mode 100644 index 00000000..73c94500 --- /dev/null +++ b/.openshift/cron/weekly/jobs.deny @@ -0,0 +1,7 @@ +# +# Any script or job files listed in here (one entry per line) will NOT be +# executed (read as ignored by run-parts). +# + +README + diff --git a/.openshift/markers/java7 b/.openshift/markers/java7 new file mode 100755 index 00000000..e69de29b diff --git a/README.md b/README.md new file mode 100644 index 00000000..ba4c946a --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +The OpenShift `jbosseap` cartridge documentation can be found at: + +https://github.com/openshift/origin-server/tree/master/cartridges/openshift-origin-cartridge-jbosseap/README.md diff --git a/deployments/.gitkeep b/deployments/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/pom.xml b/pom.xml new file mode 100755 index 00000000..9b224be0 --- /dev/null +++ b/pom.xml @@ -0,0 +1,72 @@ + + 4.0.0 + cf + cf + war + 1.0 + cf + + + eap + http://maven.repository.redhat.com/techpreview/all + + true + + + true + + + + + + eap + http://maven.repository.redhat.com/techpreview/all + + true + + + true + + + + + UTF-8 + 1.6 + 1.6 + + + + org.jboss.spec + jboss-javaee-6.0 + 3.0.0.Final-redhat-1 + pom + provided + + + + + + + + + openshift + + cf + + + maven-war-plugin + 2.1.1 + + deployments + ROOT + + + + + + + diff --git a/src/main/java/.gitkeep b/src/main/java/.gitkeep new file mode 100755 index 00000000..e69de29b diff --git a/src/main/resources/.gitkeep b/src/main/resources/.gitkeep new file mode 100755 index 00000000..e69de29b diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100755 index 00000000..8f14d0b7 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,19 @@ + + + + + + health + /health.jsp + + + health + /health + + + + diff --git a/src/main/webapp/health.jsp b/src/main/webapp/health.jsp new file mode 100755 index 00000000..d00491fd --- /dev/null +++ b/src/main/webapp/health.jsp @@ -0,0 +1 @@ +1 diff --git a/src/main/webapp/images/jbosscorp_logo.png b/src/main/webapp/images/jbosscorp_logo.png new file mode 100755 index 00000000..bfa0447f Binary files /dev/null and b/src/main/webapp/images/jbosscorp_logo.png differ diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html new file mode 100755 index 00000000..0367f1fb --- /dev/null +++ b/src/main/webapp/index.html @@ -0,0 +1,182 @@ + + + + + + Welcome to OpenShift + + + + + OpenShift logo +
OpenShift
+
+

+ Welcome to OpenShift, JBossEAP6.0 Cartridge +

+

+ Place your application here +

+

+ In order to commit to your new project, go to your projects git repo (created with the rhc app create command) directory. +

+

+ For example, if you named your application myfirstapp (by passing in -a myfirstapp to the rhc app create command), + you would find the contents of this app located under myfirstapp/src/main/webapp. You can edit that and push your + changes from the myfirstapp directory by running: +

+
+    git commit -a -m 'Some commit message'
+    git push
+  
+

+ Then reload this page. +

+

See the myfirstapp/README file for more information on the options for deploying applications.

+ + +

Sample Applications

+

To get started you can either modify the default war or try one of these samples: +

+ +

Example usage:

+
+  cd kitchensink
+  git remote add upstream -m master git://github.com/openshift/kitchensink-example.git
+  git pull -s recursive -X theirs upstream master
+  
+

+ +

Debugging

+

View debugging information about the server environment including memory pools by loading this JSP page: Debug

+ +

+ What's next? +

+ + + diff --git a/src/main/webapp/snoop.jsp b/src/main/webapp/snoop.jsp new file mode 100755 index 00000000..a112f626 --- /dev/null +++ b/src/main/webapp/snoop.jsp @@ -0,0 +1,283 @@ + + + JBossEAP6.0 JSP snoop page + <%@ page import="javax.servlet.http.HttpUtils,java.util.Enumeration" %> + <%@ page import="java.lang.management.*" %> + <%@ page import="java.util.*" %> + + + +

WebApp JSP Snoop page

+ + +

JVM Memory Monitor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Memory MXBean

+
Heap Memory Usage +<%=ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()%> +
Non-Heap Memory Usage +<%=ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage()%> +
+

Memory Pool MXBeans

+
+<% +Iterator iter = ManagementFactory.getMemoryPoolMXBeans().iterator(); +while (iter.hasNext()) { +MemoryPoolMXBean item = (MemoryPoolMXBean) iter.next(); +%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<%= item.getName() %>
Type<%= item.getType() %>
Usage<%= item.getUsage() %>
Peak Usage<%= item.getPeakUsage() %>
Collection Usage<%= item.getCollectionUsage() %>
+ + +<% +} +%> + +

Request information

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Requested URL:<%= HttpUtils.getRequestURL(request) %>
Request method:<%= request.getMethod() %>
Request URI:<%= request.getRequestURI() %>
Request protocol:<%= request.getProtocol() %>
Servlet path:<%= request.getServletPath() %>
Path info:<%= request.getPathInfo() %>
Path translated:<%= request.getPathTranslated() %>
Query string:<% if(request.getQueryString()!=null) out.write(request.getQueryString().replaceAll("<", "<").replaceAll(">",">")); %>
Content length:<%= request.getContentLength() %>
Content type:<%= request.getContentType() %>
Server name:<%= request.getServerName() %>
Server port:<%= request.getServerPort() %>
Remote user:<%= request.getRemoteUser() %>
Remote address:<%= request.getRemoteAddr() %>
Remote host:<%= request.getRemoteHost() %>
Authorization scheme:<%= request.getAuthType() %>
+ +<% + Enumeration e = request.getHeaderNames(); + if(e != null && e.hasMoreElements()) { +%> +

Request headers

+ + + + + + +<% + while(e.hasMoreElements()) { + String k = (String) e.nextElement(); +%> + + + + +<% + } +%> +
Header:Value:
<%= k %><%= request.getHeader(k) %>
+<% + } +%> + + +<% + e = request.getParameterNames(); + if(e != null && e.hasMoreElements()) { +%> +

Request parameters

+ + + + + + +<% + while(e.hasMoreElements()) { + String k = (String) e.nextElement(); + String val = request.getParameter(k); + String vals[] = request.getParameterValues(k); +%> + + + + + +<% + } +%> +
Parameter:Value:Multiple values:
<%= k.replaceAll("<", "<").replaceAll(">",">") %><%= val.replaceAll("<", "<").replaceAll(">",">") %><% + for(int i = 0; i < vals.length; i++) { + if(i > 0) + out.print("
"); + out.print(vals[i].replaceAll("<", "<").replaceAll(">",">")); + } + %>
+<% + } +%> + + +<% + e = request.getAttributeNames(); + if(e != null && e.hasMoreElements()) { +%> +

Request Attributes

+ + + + + +<% + while(e.hasMoreElements()) { + String k = (String) e.nextElement(); + Object val = request.getAttribute(k); +%> + + + + +<% + } +%> +
Attribute:Value:
<%= k.replaceAll("<", "<").replaceAll(">",">") %><%= val.toString().replaceAll("<", "<").replaceAll(">",">") %>
+<% + } +%> + + +<% + e = getServletConfig().getInitParameterNames(); + if(e != null && e.hasMoreElements()) { +%> +

Init parameters

+ + + + + +<% + while(e.hasMoreElements()) { + String k = (String) e.nextElement(); + String val = getServletConfig().getInitParameter(k); +%> + + + + +<% + } +%> +
Parameter:Value:
<%= k %><%= val %>
+<% + } +%> + + + +