Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
798 commits
Select commit Hold shift + click to select a range
38e3ef2
XBEAN-139: XSD generation invalid: List fields declared as sequence o…
chirino Sep 11, 2009
f386517
undo release candidate
djencks Sep 11, 2009
346f31a
[maven-release-plugin] prepare release xbean-3.6
djencks Sep 11, 2009
f055cb5
[maven-release-plugin] prepare for next development iteration
djencks Sep 11, 2009
22ff17e
XBEAN-141 NumberFormatException upon installing the shaded subproject…
jaceklaskowski Oct 12, 2009
7bd884c
Slightly better error message
jaceklaskowski Oct 21, 2009
f25168c
excludeDependencies should be beneath configuration - it does not wor…
jaceklaskowski Oct 26, 2009
7294315
XBEAN-142 port xbean-spring to xbean-blueprint. First probably incom…
djencks Jan 5, 2010
3c4b850
XBEAN-142 more of the ported files from xbean-spring
djencks Jan 5, 2010
d347622
XBEAN-142 a few more test fixes
djencks Jan 6, 2010
7069327
XBEAN-142 a few more test fixes
djencks Jan 6, 2010
7d1c8f0
XBEAN-142 rename Spring test classes to Blueprint
djencks Jan 6, 2010
e855784
XBEAN-142 a few more test fixes
djencks Jan 6, 2010
dfce890
XBEAN-142 one more test fixes
djencks Jan 6, 2010
f2ec518
Fix for XBEAN-143 ClassFinder processes annotated generic interfaces
jaceklaskowski Jan 6, 2010
034d609
XBEAN-142 a few more test fixes
djencks Jan 7, 2010
52d9fdc
XBEAN-142 all tests pass, but some are incomplete
djencks Jan 9, 2010
2f98bd3
XBEAN-142 all tests pass
djencks Jan 10, 2010
adb21e9
XBEAN-142 another ARIES-111 related improvement
djencks Jan 10, 2010
90cd945
XBEAN-144 glue together some contexts without binding
djencks Jan 21, 2010
770129e
XBEAN-142 try to only use accessible classes, more cleanup
djencks Jan 21, 2010
2cabc61
XBEAN-142 add some property editor support
djencks Feb 3, 2010
4fa26de
Upgrade maven-shade-plugin to 1.3.1 and fix an issue with shading in …
jaceklaskowski Feb 3, 2010
a2d192d
XBEAN-142 Allow for non-loadable managed classes in properties files.…
djencks Feb 6, 2010
e2adbaa
XBEAN-142 Scan for @PostConstruct and @PreDestroy annotations
djencks Feb 9, 2010
fa78110
XBEAN-142 Do our own key equality comparisons for maps
djencks Feb 10, 2010
2ce7dcd
use blueprint bundle and switch to 0.1-incubating-SNAPSHOT version
jgawor Mar 13, 2010
09c964f
Use getResource instead of getEntry to be able to load properties fro…
gnodet Mar 16, 2010
a0bad1d
XBEAN-145 put the classfile scanning code in an abstract superclass s…
djencks Mar 17, 2010
7855afb
Upgrade to ant 1.6.5 because 1.6.2 pom has wrong dependencies informa…
gnodet Mar 19, 2010
49c7bb8
Fix some creation of invaled URLS, cf. OPENEJB-1252
djencks Apr 21, 2010
9cb5dd4
XBEAN-148 create an xbean-bundleutils module from geronimo osgi utili…
djencks Apr 26, 2010
39d5ab5
Port equals and hashcode method from g. trunk r 938204
djencks Apr 27, 2010
ee828ff
fix name, provide importable version info in root pom
djencks Apr 27, 2010
00b1090
a. Add ClassDiscoveryFilter support
May 1, 2010
507a86e
Add a ASM based class finder
May 6, 2010
3b233f7
Remove the redundant @override annotation on a method implementation …
May 10, 2010
2cf471b
Remove the redundant @override annotations on method implementations …
May 10, 2010
57b0178
fix a couple of rat issues and remove pax-logging snapshot dependency
May 13, 2010
511e364
[maven-release-plugin] prepare release xbean-3.7
May 14, 2010
8cd372f
[maven-release-plugin] prepare for next development iteration
May 14, 2010
ffb12b7
[maven-release-plugin] rollback the release of xbean-3.7
May 14, 2010
9efcc97
Fix NOTICE copyright, add ASL headers to test properties files
May 14, 2010
df08b37
[maven-release-plugin] prepare release xbean-3.7
May 14, 2010
70da485
[maven-release-plugin] prepare for next development iteration
May 14, 2010
ce08b24
Upgrade asm version. Seems there is a strange windows related issue …
dblevins Jun 15, 2010
227c83d
XBEAN-150 fiddle with import-packages
djencks Jul 21, 2010
3749e2f
XBEAN-153: Avoid NPE by explicitely checking if passed class is java.…
jgawor Aug 4, 2010
3d17984
XBEAN-154: Do not trim input String when converting to String or Char…
jgawor Aug 10, 2010
c85b0a2
XBEAN-155 make finding more consistent
djencks Aug 18, 2010
0c3baff
export org.apache.xbean.finder packages only
jgawor Sep 4, 2010
35dfdb8
update blueprint dependency to new aries release
Sep 7, 2010
f991624
XBEAN-157: Ability to limit number of resources discovered using Bund…
jgawor Sep 13, 2010
51a50d5
A BundleClassLoader implementation that returns resources embedded in…
jgawor Sep 13, 2010
32b1621
XBEAN-156 only compute wiredBundles the first time.
Sep 15, 2010
424a97e
improve a couple error messages
djencks Sep 25, 2010
baa29cc
Ensure RuntimeExceptions from Bindings get propagated as NamingExcept…
Oct 21, 2010
4119489
Remove 'ClassFinder.' in front of all inner classes in AbstractFinder.
dblevins Oct 28, 2010
20c8acf
XBEAN-160: Find subclasses
dblevins Nov 23, 2010
0b5b139
Fix a couple of errors in the SingleLinkedList class
Dec 15, 2010
bb335b8
XBEAN-161 don't start resource lookups with '/'
djencks Dec 27, 2010
b19f1f9
Add resolve related util methods
Jan 10, 2011
ce3629c
GERONIMO-5751 LinkageError running CDI TCK
Jan 13, 2011
f668620
clean up maven 3 pom warnings
djencks Jan 27, 2011
ad7e789
XBEAN-162 genericize usage of Class
djencks Jan 28, 2011
b39017a
fix the inconsistent line ending
Jan 28, 2011
e04cf00
XBEAN-163: Equinox BundleClassLoader implementation that translates b…
jgawor Feb 5, 2011
853a2b9
XBEAN-163: Equinox BundleClassLoader implementation that translates b…
jgawor Feb 5, 2011
7eecc96
XBEAN-164: Override defaults for convertResourceUrls or searchWiredBu…
jgawor Feb 6, 2011
203e90d
override findResources() instead of getResources() as JVMs call diffe…
jgawor Feb 11, 2011
46dd4fb
Make the import packages from spring-bean as optional
Feb 24, 2011
98a09bd
XBEAN-165: Meta Annotation Support
dblevins Mar 22, 2011
4228557
Experimenting with svn history
dblevins Mar 22, 2011
d793da5
XBEAN-165: Meta Annotation Support
dblevins Mar 22, 2011
c099ce8
XBEAN-171: RegexFilteredArchive supporting regular expressions to inc…
dblevins Mar 24, 2011
7bcb5dc
XBEAN-165: Meta Annotation Support
dblevins Mar 24, 2011
7526f91
XBEAN-165: Meta Annotation Support
dblevins Mar 27, 2011
3133a2c
Organizing into subpackages
dblevins Mar 27, 2011
9d497b1
Cleaned up the UrlSet so that it now can use a Filter
dblevins Mar 27, 2011
3e117ff
upgrade junit to 4.x
dblevins Mar 27, 2011
84d3958
XBEAN-167: Archive Interface for cleaner integration of Classpath a…
dblevins Mar 27, 2011
6c05f88
Tweaking error handling
dblevins Mar 27, 2011
d52a8e5
Merging this with AnnotatedTarget
dblevins Mar 28, 2011
d32f971
XBEAN-165: Meta Annotation Support
dblevins Mar 28, 2011
dde264b
XBEAN-165: Meta Annotation Support
dblevins Mar 30, 2011
6b5663d
convenience method for single url scanning
dblevins Apr 7, 2011
ba8fe94
include/exclude methods that take just plain url
dblevins Apr 7, 2011
258d508
XBEAN-166: Generic Filtering API usable for Archive scanning and more
dblevins Apr 7, 2011
039efb5
Proper toString() methods. UrlSet now implements Iterable
dblevins Apr 8, 2011
602471e
use the original bundle passed for resource lookup
jgawor Apr 19, 2011
cae57e2
The elements in the bundle-classpath do not end with '/', need to add…
Apr 21, 2011
6ec4d02
Pass the native bundle instance for wired bundles calculation
Apr 21, 2011
283b23e
ensure BundleUtils.getContextBundle() works correctly with any type o…
jgawor Apr 21, 2011
937a55a
Fix test error on windows platform
Apr 22, 2011
47a1fa9
add utility function to unwrap a bundle
jgawor May 2, 2011
05516b2
GERONIMO-5946: Check for the available asm classes directly (asm or x…
jgawor May 4, 2011
de6079b
only changes are to tests. was using it to drive out a jar xbean-fin…
dblevins May 5, 2011
f19aa8c
Add a getBundle method in the BundleUtils, which is used to get the r…
May 23, 2011
fefb93c
yank invalid test
dblevins May 25, 2011
ff0e6a6
Skip null classes and null classloaders
dblevins May 25, 2011
2280a6a
Open up that internal getResource method
dblevins May 25, 2011
8742d0f
Worked around issues with XBEAN-143 by temporarily disabling some of …
dblevins May 31, 2011
43f8be4
XBEAN-177: No need to delegate classloading if a wire is established
jgawor Jun 8, 2011
7a3b10c
Keep track of the original classes passed to the annotation finder so…
dblevins Jun 9, 2011
f40c9d3
Patch from Romain Manni-Bucau XBEAN-176: use JarFile when possible in…
dblevins Jun 9, 2011
ca48322
XBEAN-178 Every classloader should have findResources implementation …
Jul 4, 2011
af264cb
XBEAN-177: DelegatingBundle optimization take 2. Minimize the use of …
jgawor Jul 7, 2011
1fcb844
don't print stack traces to err. If we can't load a class, put it in…
djencks Jul 8, 2011
52a4c29
GERONIMO-6043 start providing a way to filter which bits of bundle cl…
djencks Jul 9, 2011
1763ec5
Update Copyright year to 2011 in the NOTICE file of xbean.
Jul 13, 2011
242702d
add .txt to NOTICE AND LICENSE file
Jul 13, 2011
1bf24bd
my mistake. fix suffix of notice/license files
Jul 15, 2011
aee0000
tweak ClasspathArchive so it can discover and return the right archiv…
dblevins Jul 18, 2011
d11f637
XBEAN-179: File path / URL decoding issue for paths with +
dblevins Jul 24, 2011
21a5bdb
XBEAN-180 Allow update the delegating bundles on the runtime
Aug 22, 2011
9f4be4d
XBEAN-181 Unwrap the bundle while using searching classes
Aug 22, 2011
c9bcb52
XBEAN-182 Provide a builder class to convert the header elements to h…
Aug 24, 2011
e5e8604
XBEAN-183 Disable wired bundles search by default
Aug 30, 2011
b523697
Revert XBEAN-183 Disable wired bundles search by default
Aug 31, 2011
4e9e27b
[maven-release-plugin] prepare release xbean-3.8
Aug 31, 2011
e9263b0
[maven-release-plugin] prepare for next development iteration
Aug 31, 2011
1165fb8
Patch from Robert Handschmann and Peter Kofler to make xbean compile …
dblevins Sep 6, 2011
93d9bb2
XBEAN-188 multiple import packages separate with semicolon could not …
Sep 9, 2011
2eed106
use a shade plugin that generates more valid jars (manifest is first …
djencks Oct 13, 2011
6cf6f55
Fixes XBEAN-191 : Support unordered elements in the XSD generated by …
chirino Oct 27, 2011
0aac942
Fixes XBEAN-191 : Support unordered elements in the XSD generated by …
chirino Oct 27, 2011
4639a65
Fixes XBEAN-192 : xbean-spring bundle declared import on spring to be…
chirino Nov 7, 2011
9aca23e
XBEAN-195 make xbean-blueprint work with up to date aries blueprint
djencks Dec 2, 2011
fa7b40b
XBEAN-197: Alternate annotations can serve as @Metatype
dblevins Dec 8, 2011
4da5ba7
Patch from Mart Köhler to revert bug added in r1095858, XBEAN-193: Wr…
dblevins Dec 8, 2011
4f4e41f
XBEAN-197: Alternate annotations can serve as @Metatype
dblevins Dec 8, 2011
d763fa6
[maven-release-plugin] prepare release xbean-3.9
chirino Dec 16, 2011
dffd435
[maven-release-plugin] prepare for next development iteration
chirino Dec 16, 2011
9a8756d
reformatted
dblevins Dec 17, 2011
13ae69c
produce a source jar
dblevins Dec 17, 2011
9358fba
XBEAN-198: Support for proposed @javax.annotation.Metatype and @javax…
dblevins Dec 17, 2011
cb371ba
Rename MetaAnnotatedObject to MetaAnnotatedElement and allow it to be…
dblevins Jan 5, 2012
e98585e
Added missing constructor
dblevins Jan 5, 2012
fe9a197
URI version of UrlSet
dblevins Jan 7, 2012
945c95d
add include(String)
dblevins Jan 7, 2012
95170c1
Patch from Romain Manni-Bucau, XBEAN-199: use a bufferedinputstream i…
dblevins Feb 13, 2012
173737f
XBEAN-202: AnnotationFinder.select(String... classnames) allows narro…
dblevins Feb 26, 2012
57068e9
remove jvm specific class
jgawor Apr 2, 2012
8c77c4b
XBEAN-204: Initial OSGi 4.3 updates
jgawor Apr 2, 2012
5bd4fe4
Ensure streams are closed when reading classes
dblevins Apr 4, 2012
0fc48c1
[maven-release-plugin] prepare release xbean-3.10
dblevins Apr 11, 2012
e1108be
[maven-release-plugin] prepare for next development iteration
dblevins Apr 11, 2012
983b144
XBEAN-205: JarArchive and Archive API reworked for greater performance
dblevins Apr 15, 2012
b9987e2
XBEAN-206: use jarfile instead of jarinputstream when possible
dblevins Apr 15, 2012
0807d8f
Ensure getAnnotatedClasses() is always functional. Simply move the p…
dblevins Apr 15, 2012
e6645a1
split out link() into more fine grained methods for keener selection …
dblevins Apr 15, 2012
59593a3
attach sources all the time
dblevins Apr 17, 2012
dc59f42
Move reference based bundle utils methods from geornimo kerneal to xb…
Apr 27, 2012
d4dd30e
Null checking for bundle location
Apr 30, 2012
1a7c4eb
Update copyright year to 2012
May 5, 2012
70d146f
[maven-release-plugin] prepare release xbean-3.11
May 5, 2012
5f1db94
[maven-release-plugin] prepare for next development iteration
May 5, 2012
89ffe67
[maven-release-plugin] prepare release xbean-3.11
May 5, 2012
4c1c3b1
[maven-release-plugin] prepare for next development iteration
May 5, 2012
cbcf9b9
GERONIMO-6358 Fixed space char issue when Geronimo is installed in a …
Jun 7, 2012
1257b73
[XBEAN-203] Performance improvement by adding local cache for MultiPa…
gnodet Jun 7, 2012
b86e2cc
[XBEAN-203] Performance improvement by adding local cache for MultiPa…
gnodet Jun 7, 2012
f71c972
[maven-release-plugin] prepare release xbean-3.12
Jun 7, 2012
d26b7cc
[maven-release-plugin] prepare for next development iteration
Jun 7, 2012
8d9fae9
[maven-release-plugin] rollback the release of xbean-3.12
Jun 8, 2012
7b119b4
[maven-release-plugin] prepare release xbean-3.11.1
Jun 8, 2012
5c2d162
[maven-release-plugin] prepare for next development iteration
Jun 8, 2012
d277a57
GERONIMO-6358 A better fix for similar file system path string issue,…
Jun 8, 2012
062a526
[maven-release-plugin] prepare release xbean-3.11.1
Jun 8, 2012
3221270
[maven-release-plugin] prepare for next development iteration
Jun 8, 2012
f79d490
GERONIMO-6358 Revise the fix to endure more special chars cases
Jun 8, 2012
9c44577
[maven-release-plugin] prepare release xbean-3.11.1
Jun 8, 2012
533edbb
[maven-release-plugin] prepare for next development iteration
Jun 8, 2012
1340509
XBEAN-208: Optimize class and resource lookups
jgawor Aug 9, 2012
202fe58
Add support to the xbean maven mojo to 'include' multiple additional …
chirino Sep 25, 2012
c7c6908
Add support to the xbean maven mojo to 'include' multiple additional …
chirino Sep 25, 2012
e1b66fd
[XBEAN-227] Add support for Spring 3.1 bean profiles
gnodet Oct 2, 2012
cd29b62
[XBEAN-228] Support aries blueprint 1.0
gnodet Oct 2, 2012
028eae4
[XBEAN-229] Make jexl an optional import on xbean-blueprint
gnodet Oct 2, 2012
67c8902
[XBEAN-190] XBeanNamespaceHandler does not close resource input streams
gnodet Oct 2, 2012
55d55bf
[XBEAN-207] FileArchive doesn't have a way to specify the base package
gnodet Oct 2, 2012
a591fac
[XBEAN-146] xsd for list elements should be unbounded, not max=1
gnodet Oct 3, 2012
fedc64a
[XBEAN-119] ContextUtil#isRelative() always returns false
gnodet Oct 3, 2012
c6920a4
[XBEAN-187] Missing svn:ignore property on xbean-bundleutils
gnodet Oct 3, 2012
9b9a86a
[XBEAN-113] Set svn:eol-style=native on source files
gnodet Oct 3, 2012
24e5234
[XBEAN-121] Added a test for constructor injection with array argument
gnodet Oct 3, 2012
5ee6dcd
[XBEAN-200] Ability to use annotationfinder for non runtime retention…
gnodet Oct 3, 2012
eed841a
[maven-release-plugin] prepare release xbean-3.12
gnodet Oct 3, 2012
807312f
[maven-release-plugin] prepare for next development iteration
gnodet Oct 3, 2012
b304c2d
XBEAN-233 - Support for RetentionPolicy.CLASS broken for ElementType …
dblevins Dec 19, 2012
f9c5c99
Excellent patch from Matt Benson.
dblevins Jan 25, 2013
6aaadad
Patch file accidentaly applied twice
dblevins Jan 31, 2013
504343f
clean up of one more double-patch mistake
dblevins Jan 31, 2013
0bb47d2
XBEAN-239 fix toURL for java7
struberg Feb 7, 2013
e9612af
XBEAN-239 fixed OSGi jdk14 issue
struberg Feb 7, 2013
27e2b2c
XBEAN-242: Make sure to close ZipInputStream
jgawor Mar 4, 2013
6d5ef04
trigger build
jgawor Mar 4, 2013
724d055
adding repositories so that genesis stuff can be download and xbean b…
jgawor Mar 4, 2013
1da8a36
XBEAN-238 also handle NoClassDefFound
struberg Mar 4, 2013
e7f5a28
XBEAN-241: finder doesn't handle #. Patch from Romain Manni-Bucau.
jgawor Mar 7, 2013
da03f5d
upgrade to genesis-2.1 final
struberg Mar 7, 2013
6908c8f
[maven-release-plugin] prepare release xbean-3.13
struberg Mar 7, 2013
424f0bb
[maven-release-plugin] prepare for next development iteration
struberg Mar 7, 2013
2f5fdd2
VOTE CANCELLED move back to old pom version
struberg Mar 8, 2013
b285265
[maven-release-plugin] prepare release xbean-3.13
struberg Mar 8, 2013
d1b2e9c
[maven-release-plugin] prepare for next development iteration
struberg Mar 8, 2013
6c7d4b5
fix copyright date
Mar 8, 2013
e411166
no longer needed
jgawor Mar 18, 2013
17e2b23
XBEAN-243 reworking getURLs to find really all jars with a workarounf…
rmannibucau Apr 25, 2013
cfab68d
XBEAN-246 resource finder expects some kind of url for type file whic…
rmannibucau May 15, 2013
c249df8
Tweak to XBEAN-243 to skip the ExtClassLoader and not bring in native…
dblevins May 16, 2013
73e0feb
Tweak to XBEAN-243 to skip the ExtClassLoader and not bring in native…
dblevins May 16, 2013
dce916a
XBEAN-247 - Better JVM Filtering for OSX
dblevins May 16, 2013
44db1ed
XBEAN-247 fix tests under Windows*
struberg May 17, 2013
7ddb473
XBEAN-248 skipping so
rmannibucau May 17, 2013
9d17db7
fixing test under win when not using C disk + ignoring native test wh…
rmannibucau May 17, 2013
4a6369d
XBEAN-243 url shouldn't be built manually + under win host is the dis…
rmannibucau May 17, 2013
ad684b2
reverting win hack in ResourceFinder since it was induced by an issue…
rmannibucau May 17, 2013
5d4a136
XBEAN-230 add asm4 as shaded version
struberg May 26, 2013
8b2c653
XBEAN-249 updating xbean to asm4 with a complete EmptyVisitor impleme…
rmannibucau May 27, 2013
7a6d452
XBEAN-249 updating xbean to asm4 xbean-finder too
rmannibucau May 27, 2013
1d2df9c
[maven-release-plugin] prepare release xbean-3.14
struberg May 28, 2013
773be59
[maven-release-plugin] prepare for next development iteration
struberg May 28, 2013
075cb26
add license headers
struberg May 29, 2013
2aac338
VOTE got cancelled. move back version
struberg May 29, 2013
673d8ec
activate RAT checks automatically in the build
struberg May 29, 2013
43f286f
rewrite trivial test class as David is travelling and cannot fix the …
struberg May 30, 2013
0cb8fbc
add dependency-reduced-pom to license exclude as this is a generated …
struberg May 30, 2013
9f89526
[maven-release-plugin] prepare release xbean-3.14
struberg May 30, 2013
9dd17ec
[maven-release-plugin] prepare for next development iteration
struberg May 30, 2013
d073e08
add the DEPENDENCIES file to the rat exclude list
struberg Jun 2, 2013
fa82fd6
XBEAN-253 adding MultiThreadedAnnotationFinder
rmannibucau Oct 28, 2013
8f9847b
XBEAN-253 using asynchronism rather than multithreaded implementation…
rmannibucau Oct 28, 2013
99efad2
XBEAN-253 using a copy of classInfos.values() in linkMetaAnnotations …
rmannibucau Oct 29, 2013
1213487
remove some unnecessary doPrivileged calls
jgawor Nov 5, 2013
3996596
XBEAN-254 trying to avoid index issues in xbean asm parameter loader
rmannibucau Nov 5, 2013
45bf742
XBEAN-255: Remove doPrivileged() calls
jgawor Nov 5, 2013
4498c94
XBEAN-255: Remove doPrivleged blocks
jgawor Nov 5, 2013
4716f12
[maven-release-plugin] prepare release xbean-3.15
dblevins Nov 7, 2013
fe7d934
[maven-release-plugin] prepare for next development iteration
dblevins Nov 7, 2013
536f968
[XBEAN-258] xbean-asm4-shaded should export org.apache.xbean.asm4.sha…
gnodet Nov 13, 2013
65787cb
[maven-release-plugin] prepare release xbean-3.16
gnodet Nov 13, 2013
1a135bc
[maven-release-plugin] prepare for next development iteration
gnodet Nov 13, 2013
34e6ec0
XBEAN-260 add asm5 shade
rmannibucau Mar 26, 2014
187e735
XBEAN-261 XBEAN-260 making asm5 shade working and remove asm 3 and as…
rmannibucau Mar 31, 2014
088c857
[maven-release-plugin] prepare release xbean-3.17
rmannibucau Mar 31, 2014
d0ecaf7
[maven-release-plugin] prepare for next development iteration
rmannibucau Mar 31, 2014
e90ef75
[XBEAN-264] ignore git files so that checkout from git mirror can act…
mbenson Apr 30, 2014
97f883d
failing test case for [XBEAN-265]
mbenson May 19, 2014
dd246cb
[XBEAN-265] restore removed line of code that caused regression
mbenson May 19, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
XBEAN-142 Allow for non-loadable managed classes in properties files.…
… Implement a proeprty-placeholder using jexl to evaluate expressions

git-svn-id: https://svn.apache.org/repos/asf/geronimo/xbean/trunk@907189 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
djencks committed Feb 6, 2010
commit a2d192d1c758e4818a8f826bb3ff8f6d842842b0
25 changes: 25 additions & 0 deletions xbean-blueprint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,25 @@
<version>1.0.0-incubating-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>org.apache.aries.blueprint.cm</artifactId>
<version>1.0.0-incubating-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-jexl</artifactId>
<version>2.0</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
Expand All @@ -67,6 +85,13 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>4.2.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-service</artifactId>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/


package org.apache.xbean.blueprint.cm;

import java.util.Map;

import org.apache.commons.jexl2.JexlContext;
import org.apache.commons.jexl2.JexlEngine;
import org.apache.commons.jexl2.MapContext;
import org.apache.commons.jexl2.UnifiedJEXL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @version $Rev$ $Date$
*/
public class JexlExpressionParser {
private static final Logger log = LoggerFactory.getLogger(JexlExpressionParser.class);

private final JexlEngine engine;
private final UnifiedJEXL jexl;
protected final JexlContext context;

public JexlExpressionParser(final Map<String, Object> vars) {
if (vars == null) {
throw new IllegalArgumentException("vars");
}
engine = new JexlEngine();
jexl = new UnifiedJEXL(engine);
context = new MapContext(vars);

log.trace("Using variables: {}", vars);
}

// private FlatResolver resolver = new FlatResolver(true);
//
// protected Expression createExpression(final String expression) throws Exception {
// // assert expression != null;
//
// Expression expr = engine.createExpression(expression);
// expr.addPreResolver(resolver);
//
// return expr;
// }

public Object evaluate(final String expression) throws Exception {
if (expression == null) {
throw new IllegalArgumentException("expression");
}

log.trace("Evaluating expression: {}", expression);
return jexl.parse(expression).evaluate(context);
// Expression expr = createExpression(expression);
// Object obj = expr.evaluate(context);
// log.trace("Result: {}", obj);
//
// return obj;
}

// public String parse(final String input) {
// if (input == null) {
// throw new IllegalArgumentException("input");
// }
//
// log.trace("Parsing input: {}", input);
//
// StringBuilder buff = new StringBuilder();
//
// int cur = 0;
// int prefixLoc;
// int suffixLoc;
//
// while (cur < input.length()) {
// prefixLoc = input.indexOf("${", cur);
//
// if (prefixLoc < 0) {
// break;
// }
//
// suffixLoc = findBlockEnd(prefixLoc + 2, input);
// if (suffixLoc < 0) {
// throw new RuntimeException("Missing '}': " + input);
// }
//
// String expr = input.substring(prefixLoc + 2, suffixLoc);
// buff.append(input.substring(cur, prefixLoc));
//
// try {
// buff.append(evaluate(expr));
// }
// catch (Exception e) {
// throw new RuntimeException("Failed to evaluate: " + expr, e);
// }
//
// cur = suffixLoc + 1;
// }
//
// buff.append(input.substring(cur));
//
// log.trace("Parsed result: {}", buff);
//
// return buff.toString();
// }

// private int findBlockEnd(int pos, String input) {
// int nested = 0;
// while (pos < input.length()) {
// char ch = input.charAt(pos);
// if (ch == '{') {
// nested++;
// } else if (ch == '}') {
// if (nested == 0) {
// return pos;
// } else {
// nested--;
// }
// }
// pos++;
// }
// return -1;
// }

// public String parse(final String input, final boolean trim) {
// String output = parse(input);
// if (trim && output != null) {
// output = output.trim();
// }
//
// return output;
// }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/


package org.apache.xbean.blueprint.cm;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

import org.apache.aries.blueprint.compendium.cm.CmPropertyPlaceholder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @version $Rev$ $Date$
*/
public class JexlPropertyPlaceholder extends CmPropertyPlaceholder {

private static final Logger LOGGER = LoggerFactory.getLogger(JexlPropertyPlaceholder.class);

private transient JexlExpressionParser parser;

@Override
protected String processString(String str) {
LOGGER.debug("Processing {} from configuration with pid {}", str, getPersistentId());
JexlExpressionParser parser = getParser();
try {
return parser.evaluate(str).toString();
} catch (Exception e) {
LOGGER.info("Could not evaluate expressions {} for {}", str, getPersistentId());
LOGGER.info("Exception:", e);
}
return str;
}

protected synchronized JexlExpressionParser getParser() {
if (parser == null) {
// try {
parser = new JexlExpressionParser(toMap());
// } catch (IOException e) {
// ignore
// }
}
return parser;
}

private Map<String, Object> toMap() {
return new ConfigMap();
// Map<String, Object> map = new HashMap<String, Object>();
// if (config != null) {
// Dictionary<String, Object> properties = config.getProperties();
// for (Enumeration<String> e = properties.keys(); e.hasMoreElements(); ) {
// String key = e.nextElement();
// Object value = properties.get(key);
// map.put(key, value);
// }
// }
// return map;
}

private class ConfigMap implements Map<String, Object> {

@Override
public int size() {
return 0;
}

@Override
public boolean isEmpty() {
return false;
}

@Override
public boolean containsKey(Object o) {
return getProperty((String) o) != null;
}

@Override
public boolean containsValue(Object o) {
return false;
}

@Override
public Object get(Object o) {
return getProperty((String) o);
}

@Override
public Object put(String s, Object o) {
return null;
}

@Override
public Object remove(Object o) {
return null;
}

@Override
public void putAll(Map<? extends String, ? extends Object> map) {
}

@Override
public void clear() {
}

@Override
public Set<String> keySet() {
return null;
}

@Override
public Collection<Object> values() {
return null;
}

@Override
public Set<Entry<String, Object>> entrySet() {
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
import org.osgi.service.blueprint.reflect.Metadata;
import org.osgi.service.blueprint.reflect.NonNullMetadata;
import org.osgi.service.blueprint.reflect.NullMetadata;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
Expand All @@ -64,6 +66,8 @@
*/
public class XBeanNamespaceHandler implements NamespaceHandler {

private static final Logger LOGGER = LoggerFactory.getLogger(XBeanNamespaceHandler.class);

public static final String BLUEPRINT_NAMESPACE = "http://www.osgi.org/xmlns/blueprint/v1.0.0";
private static final String BEAN_REFERENCE_PREFIX = "#";
private static final String NULL_REFERENCE = "#null";
Expand Down Expand Up @@ -123,27 +127,37 @@ public XBeanNamespaceHandler(String namespace, String schemaLocation, String pro
this.mappingMetaData = new MappingMetaData(properties);
}

private static Set<Class> managedClassesFromProperties(ClassLoader cl, Properties properties) throws ClassNotFoundException {
private static Set<Class> managedClassesFromProperties(ClassLoader cl, Properties properties) {
Set<Class> managedClasses = new HashSet<Class>();
for (Map.Entry entry : properties.entrySet()) {
String key = (String) entry.getKey();
if (key.indexOf(".") < 0) {
String className = (String) entry.getValue();
Class clazz = cl.loadClass(className);
managedClasses.add(clazz);
try {
managedClasses.add(cl.loadClass(className));
} catch (NoClassDefFoundError e) {
LOGGER.warn("Could not load class: {} due to {}",className, e.getMessage());
} catch (ClassNotFoundException e) {
LOGGER.warn("Could not load class: {}", className);
}
}
}
return managedClasses;
}

private static Set<Class> managedClassesFromProperties(Bundle bundle, Properties properties) throws ClassNotFoundException {
private static Set<Class> managedClassesFromProperties(Bundle bundle, Properties properties) {
Set<Class> managedClasses = new HashSet<Class>();
for (Map.Entry entry : properties.entrySet()) {
String key = (String) entry.getKey();
if (key.indexOf(".") < 0) {
String className = (String) entry.getValue();
Class clazz = bundle.loadClass(className);
managedClasses.add(clazz);
try {
managedClasses.add(bundle.loadClass(className));
} catch (NoClassDefFoundError e) {
LOGGER.warn("Could not load class: {} due to {}",className, e.getMessage());
} catch (ClassNotFoundException e) {
LOGGER.warn("Could not load class: {}", className);
}
}
}
return managedClasses;
Expand Down Expand Up @@ -205,6 +219,8 @@ public Metadata parse(Element element, ParserContext parserContext) {
private Metadata parseInternal(Element element, ParserContext parserContext, String beanTypeName, String className) {
MutableBeanMetadata beanMetaData = parserContext.createMetadata(MutableBeanMetadata.class);
beanMetaData.setClassName(className);
beanMetaData.setScope(BeanMetadata.SCOPE_SINGLETON);
beanMetaData.setActivation(BeanMetadata.ACTIVATION_EAGER);
beanMetaData.setRuntimeClass(managedClassesByName.get(className));
if (beanMetaData.getRuntimeClass() == null) {
throw new ComponentDefinitionException("Unknown bean class: " + className);
Expand Down
Loading