File tree Expand file tree Collapse file tree 4 files changed +64
-4
lines changed Expand file tree Collapse file tree 4 files changed +64
-4
lines changed Original file line number Diff line number Diff line change 231231 <dependency >
232232 <groupId >org.slf4j</groupId >
233233 <artifactId >slf4j-log4j12</artifactId >
234- <version >1.7.2</version >
234+ <version >1.7.6</version >
235+ <scope >provided</scope >
236+ </dependency >
237+
238+ <dependency >
239+ <groupId >simple-jndi</groupId >
240+ <artifactId >simple-jndi</artifactId >
241+ <version >0.11.4.1</version >
242+ <scope >provided</scope >
243+ </dependency >
244+
245+ <dependency >
246+ <groupId >commons-dbcp</groupId >
247+ <artifactId >commons-dbcp</artifactId >
248+ <version >1.4</version >
235249 <scope >provided</scope >
236250 </dependency >
237251
Original file line number Diff line number Diff line change 6767 <directory >${project.basedir}/src/main/config/</directory >
6868 <outputDirectory >config/</outputDirectory >
6969 <includes >
70- <include >java-options.conf</include >
71- <include >log4j.xml</include >
70+ <include >**/*</include >
7271 </includes >
7372 <directoryMode >0755</directoryMode >
7473 <fileMode >0644</fileMode >
Original file line number Diff line number Diff line change 55# Undefined variables remain in the configuration.
66
77-Xmx512m
8- -Dlog4j.configuration="file:///$METAFACTURE_HOME/config/log4j.xml"
8+
99-Dflux.pluginsdir="$METAFACTURE_HOME/plugins"
1010-Dflux.provideddir="$METAFACTURE_HOME/provided-libs"
1111
12+ # Configure log4j to read its configuration from a file:
13+ -Dlog4j.configuration="file:///$METAFACTURE_HOME/config/log4j.xml"
14+
15+ # Configure simple jndi as default jndi provider:
16+ -Djava.naming.factory.initial=org.osjava.sj.SimpleContextFactory
17+ -Dorg.osjava.sj.root="file:///$METAFACTURE_HOME/config/jndi"
18+
1219# Append additional options defined in the
1320# environment (The start-up script ensures
1421# that this variable is always defined):
Original file line number Diff line number Diff line change 1+ Place your JNDI properties files in this directory. By default
2+ metafacture-runner uses [ simpleJNDI] ( http://code.google.com/p/osjava/wiki/SimpleJNDI )
3+ as JNDI provider.
4+
5+ # Examples
6+
7+ One of the most common use cases of JNDI is to provide data sources for
8+ JDBC. However, JNDI can be used to pass other variables into a program
9+ as well. The following to examples demonstrate how to define data sources
10+ and other values.
11+
12+ More elaborate examples can be found in the simpleJDNI documentation which
13+ is part of the [ binary download package] ( http://code.google.com/p/osjava/downloads/detail?name=simple-jndi-0.11.4.1.zip&can=2&q= )
14+ of simpleJNDI.
15+
16+ ## Data sources
17+
18+ To register a data source with the name ` MySqlDB ` , create a property
19+ file named ` MySqlDB.properties ` with the following contents:
20+
21+ ```
22+ type=javax.sql.DataSource
23+ driver=com.mysql.jdbc.Driver
24+ url=jdbc:mysql://localhost:3306/DBNAME
25+ user=USER
26+ password=PASSWORD
27+ ```
28+
29+ ## Other values
30+
31+ Other values can be made available via JNDI by creating property files
32+ such as the following:
33+
34+ ```
35+ enabled = true
36+ enabled.type = java.lang.Boolean
37+ ```
38+
39+ If this file is saved as ` debug.properties ` , the value of enabled can
40+ be accessed as follows: ` debug.enabled ` .
You can’t perform that action at this time.
0 commit comments