1304 Commits

Author SHA1 Message Date
Janne Valkealahti
780397bd6b Fix for wildcard recursive classpath handling
Previous fix for handling wildcard entries in a classpath
imposed a new problem in a case where entry is a directory
with a jar files but also contains a lot of nested directories.

For example entry "./*" resulted for scanning whole disk starting
from "/". In case of default hadoop classpath, it scanned everything
under hadoop's installation. On some cases this deep scan was hidden
and was revealed by NPE's for file access exceptions.

When we want to support wildcard entries we only want to get
jar files from that directory, while boot itself have a need
to travel recursively to find classfiles from an expoded archive.

We handle this case by using recursive(true by default) flag in
ExplodedArchive and this flag is set to false in PropertiesLauncher
if we match wildcard.
2014-01-07 18:05:10 +00:00
Dave Syer
633dea9d80 Add declarative ApplicationListener 2014-01-07 17:53:34 +00:00
Dave Syer
73c2216732 Migrate file encoding initializer to listener 2014-01-07 17:52:46 +00:00
Dave Syer
4d28e1b601 Migrate VCAP initializer to a listener 2014-01-07 17:52:46 +00:00
Dave Syer
441572c61c Migrate config file initializer to a listener 2014-01-07 17:52:46 +00:00
Dave Syer
3dacf4be17 Migrate Logging and Liquibase initializers to be listeners 2014-01-07 17:52:45 +00:00
Dave Syer
27ae6a5fd6 Add ApplicationListener as first class component in Spring Application 2014-01-07 17:52:45 +00:00
Andy Wilkinson
3336b6da44 Remove redundant @GrabResolver transform
Previously, a transform was used to add @GrabResolver annotations
during compilation that added the Spring milestone and snapshot
repositories. This functionality is now handled by
RepositoryConfigurationFactory so the transform is no longer required.
2014-01-07 10:31:10 +00:00
Phillip Webb
751beda2cb Additional fixes for auto-configuration report
Fix the following issues that were introduced in commit 0610378:

- Formatting of code including imports
- Improve hashcode/equals implementations by using ObjectUtils
- Provide hashcode/equals for ConditionOutcome
- Use LinkedHashSet in ConditionAndOutcomes to maintain insert order

Fixed gh-127
2014-01-06 10:52:33 -08:00
Greg Turnquist
b5b86d07ba Add Spring MVC's org.springframework.ui package to the list of automatic imports 2014-01-06 17:30:05 +00:00
Dave Syer
8fe696944a Delete duplicate logback.xml if running from Maven plugin
Fixes gh-143
2014-01-06 17:28:22 +00:00
Dave Syer
ac34f9c993 First proper draft of DSL for Groovy Commands
Users can declare or Command, OptionHandler classes in an init script
or they can use a DSL, e.g.

command("foo") { args -> println "Do stuff with ${args} array" }

or

command("foo") {
  options { option "bar", "Help text for bar option" ithOptionArg() ofType Integer }
  run { options -> println "Do stuff with ${options.valueOf('bar')}" }
}
2014-01-06 16:00:10 +00:00
Dave Syer
1e75c0a55b Extend programming model for script commands 2014-01-06 11:40:21 +00:00
Dave Syer
b5db4d3ff4 Enhance FileOptions to support multiple classpath resources 2014-01-06 11:40:21 +00:00
Dave Syer
cd7b1b19c5 Add InitCommand to execute groovy script on startup
InitCommand runs on creation of SpringCli so it can search for additional
Commands in updated classpath. Also added as interactive command in Shell
session.
2014-01-06 11:40:21 +00:00
Dave Syer
033250195b Allow user to specify classLoader as loader property
PropertiesLauncher now supports creating its own class loader
from looader.classLoader property. It will succeed if the
implementation specified has a default constructor or one
that takes a parent class loader, or one that takes a URL[]
and a parent class loader (like URLClassLoader).
2014-01-06 11:40:20 +00:00
Dave Syer
f5f41fef5e Check that WAR apps work in a container 2014-01-06 11:38:00 +00:00
Greg Turnquist
0610378d2f Resolves #127: Prevent duplicate report outcomes
The collection of outcomes is a list. Sometimes a race condition causes to instances
of the same outcome to get added to the list shown in the report. By replacing this
with a set and propery equals/hashCode, duplicates are prevented from appearing
in the report.

I added test cases to prove that that POJO is properly managed inside a Set and also
to show that duplicates don't appear in the final report.
2014-01-06 10:42:16 +00:00
Dave Syer
c71322a0b2 Add a BatchConfigurer so the transaction manager can adapt to JPA
Autoconfiguration ordering has to be adjusted so that a DataSource is
available before an EntityManagerFactory is ever needed. Previously
the autoconfigs were accidentally loaded in the right order, but after
the change to BatchAutoConfiguration the order has to be explicit.

Fixes gh-189
2014-01-06 10:41:49 +00:00
Dave Syer
e48ddaeb99 Fix grab test 2014-01-06 10:41:49 +00:00
Dave Syer
df476bed1f Ensure local repository cache is always used 2014-01-03 09:56:22 +00:00
Dave Syer
47a0df1e3d Add groovy to dependency management 2014-01-03 08:34:14 +00:00
Phillip Webb
6b3e79e693 Polish 2014-01-02 14:56:51 -08:00
Phillip Webb
bd6c672bba Drop jumping into shell when running without args
Change SpringCli so that running without arguments no longer jumps into
the embedded REPL shell. This restores the ability to obtain quick usage
help by simply typing `spring` from the command prompt.

Windows users or developers that prefer the embedded shell can still
launch it using `spring shell`.
2014-01-02 14:26:04 -08:00
Phillip Webb
f56318e9b8 Polish embedded REPL shell 2014-01-02 14:13:22 -08:00
Phillip Webb
1bcd3de7b5 Polish 2014-01-02 12:10:37 -08:00
Phillip Webb
0f9c705980 Rework OptionHandler '-cp' argument support
Change OptionHandler to support '-cp' instead of '--cp'. This update
to the original fix (045088e8b) renders `help` output correctly and
should prevent potential issues if a `-p` command is added in the future.

Fixes gh-178
2014-01-02 11:42:59 -08:00
Phillip Webb
3a82eac2e6 Prevent early initialization of Servlets
Defer loading of Servlets (with a loadOnStartup priority) until
the `EmbeddedServletContainer.start()` method is called. This prevents
issues with the DispatcherServlet being initialized before the embedded
ApplicationContext is fully initialized.
2014-01-02 11:11:21 -08:00
Phillip Webb
3cd4026bcc Update eclipse template copyright date to 2014 2014-01-02 10:56:03 -08:00
Phillip Webb
0029e8200c Fix copyright dates 2014-01-02 10:55:04 -08:00
Phillip Webb
7623c291a2 Attempt to fix failing CI build 2014-01-02 10:23:58 -08:00
Dave Syer
045088e8b3 Add -cp to option help for compiler commands
Fixes gh-178
2013-12-31 12:24:49 +00:00
Janne Valkealahti
da889efde7 Fix PropertiesLauncher for wildcard entries in parent classpath
This small change now plays nice with wildcard classpath
entries coming from a parent classloader as its urls.
2013-12-31 12:01:53 +00:00
Dave Syer
f448e79f29 Remove long package names from samples
Long package names are really unnecessary in samples and they
just clutter things up. Also Spring Loaded doesn't work with
org.sfw packages, so to demo that technology you need a
different package name.
2013-12-31 08:40:26 +00:00
Dave Syer
3c7361fb3e Support for wildcard paths in PropertiesLauncher 2013-12-30 16:14:10 +00:00
Dave Syer
ea59976277 Extract package discovery to separate method 2013-12-30 14:24:54 +00:00
Dave Syer
4cfc7b6ad9 Make sure integration still works in CLI 2013-12-30 11:19:52 +00:00
Dave Syer
aa2b020660 Refactor metrics to expose richer feature set
Main user-facing interface is still Counter/GaugeService but the
back end behind that has more options. The Default*Services write
metrics to a MetricWriter and there are some variants of that, and
also variants of MetricReader (basic read-only actions).

MetricRepository is now a combination of MetricReader, MetricWriter
and some more methods that make it a bit more repository like.

There is also a MultiMetricReader and a MultiMetricRepository for
the common case where metrics are stored in related (often open
ended) groups. Examples would be complex metrics like histograms
and "rich" metrics with averages and statistics attached (which
are both closed) and "field counters" which count the occurrences
of values of a particular named field or slot in an incoming message
(e.g. counting Twitter hastags, open ended).

In memory and redis implementations are provided for the repositories.
Generally speaking the in memory repository should be used as a
local buffer and then scheduled "exports" can be executed to copy
metric values accross to a remote repository for aggregation.
There is an Exporter interface to support this and a few implementations
dealing with different strategies for storing the results (singly or
grouped).

Codahale metrics are also supported through the MetricWriter interface.
Currently implemented through a naming convention (since Codahale has
a fixed object model this makes sense): metrics beginning with "histogram"
are Histograms, "timer" for Timers, "meter" for Meters etc.

Support for message driven metric consumption and production are provided
through a MetricWriterMessageHandler and a MessageChannelMetricWriter.

No support yet for pagination in the repositories, or for HATEOAS style
HTTP endpoints.
2013-12-30 10:32:42 +00:00
Dave Syer
5d8e58d12c Remove support for Integration DSL (milestone only) 2013-12-30 07:39:36 +00:00
Oliver Gierke
d39a8360b7 Added support to allow manually declaring a EntityManagerFactoryBean.
Added the necessary @ConditionalOnMissingBean annotations to allow selectively declaring an EntityManagerFactoryBean, a JpaVendorAdapter or a PlatformTransactionManager. Especially the first one might be necessary to make sure the persistence provider evaluates an orm.xml. This unfortunately rules out using the packages to scan feature of Spring's LCEMFB.

I've filed https://jira.springsource.org/browse/SPR-11260 to potentially remove the need for this workaround in Spring itself.
2013-12-28 13:34:45 +01:00
Oliver Gierke
88d4d8d7f6 Added missing dependency management declaration for spring-aspects. 2013-12-28 10:34:37 +01:00
Dave Syer
c9c433608f Add ApplicationContext to the EmbeddedServletContainerInitializedEvent 2013-12-27 11:37:29 +00:00
Dave Syer
4d60b09c9b Revise docs for port discovery 2013-12-27 11:19:58 +00:00
Dave Syer
cdb45cff0c Add EmbeddedServletContainerInitializedEvent for access to local port 2013-12-27 11:15:40 +00:00
Dave Syer
c709423ab8 Typos in Javadocs 2013-12-27 09:19:23 +00:00
Dave Syer
b558537ee6 Docs for obtaining server port 2013-12-27 09:18:09 +00:00
Christian Dupuis
384dfc91e3 Fix some tests to prevent JMX registration issues 2013-12-26 15:46:21 +01:00
Christian Dupuis
4ed4ed905d Make EndpointMBeanExportAutoConfiguration public 2013-12-26 15:46:21 +01:00
Christian Dupuis
06ffcdd3cc Change configuration to use ConfigurationProperties instead of direct access to environment for MBean export 2013-12-26 15:46:21 +01:00
Dave Syer
1531329da0 Extend SimpleJsonParser to try Long and Double format 2013-12-26 14:42:37 +00:00