public
Description: Springy lets you use a simple DSL based on JRuby to wire up your Spring context.
Homepage: http://code.trampolinesystems.com/springy
Clone URL: git://github.com/jberkel/springy.git
name age message
file .gitignore Loading commit data...
file CHANGES Tue Jul 31 11:15:53 -0700 2007 springy 0.3 git-svn-id: http://svn.trampolines... [jberkel]
file LICENSE Wed Jun 20 06:11:39 -0700 2007 updating springy to jruby 1.0 git-svn-id: http... [jberkel]
file README.rdoc Fri Feb 13 04:54:38 -0800 2009 renamed readme [jberkel]
file Rakefile Mon Nov 10 08:11:18 -0800 2008 adding deps [jberkel]
file TODO
file dependencies.yml Mon Nov 10 08:11:00 -0800 2008 adding deps [jberkel]
directory externals/ Wed Aug 01 13:52:55 -0700 2007 dont need config git-svn-id: http://svn.trampo... [jberkel]
directory lib/
file logging.properties
file maintainer.rb Tue Jul 31 12:06:24 -0700 2007 include documentation in tar balls git-svn-id:... [jberkel]
file pom.xml
file springy.iml
file springy.ipr Wed Jun 20 06:11:39 -0700 2007 updating springy to jruby 1.0 git-svn-id: http... [jberkel]
directory src/ Tue Mar 18 14:54:20 -0700 2008 upgrade to spring 2.5.2 and jruby 1.1rc2 git-... [Craig McMillan]
file testng.xml

Springy — Configure Spring contexts with JRuby

Springy lets you use a simple Domain Specific Language (DSL) based on JRuby to wire up your Spring context. See Wiring up Spring with JRuby for an introduction.

Dependencies

Springy requires JRuby (1.0), Spring 2.0 and the Bean Scripting Framework.

Usage

You need to add springy.jar, bsf.jar and jruby-1.0.jar to your classpath. Create your context definition and put it somewhere in your classpath. To actually create the context do:

  import org.springframework.core.io.Resource;
  import springy.context.BSFSpringyContext;

  // ...
  Resource r = new ClassPathResource("/path/to/context_definition.rb");
  ApplicationContext ctxt = new SpringyContext(r);

  Object myBean = ctxt.getBean("myBean");

Serializing context to XML

  String serialized = new SpringyContext(r).getContextAsXml();

Advanced usage with existing JRuby runtime

  import org.springframework.core.io.Resource;
  import springy.context.RuntimeSpringyContext;
  import org.jruby.Ruby;

  // ...
  Resource r = new ClassPathResource("/path/to/context_definition.rb");
  Ruby runtime = Ruby.getDefaultInstance();

  ApplicationContext ctxt = new RuntimeSpringyContext(runtime, r);

Examples

See the test cases, especially the Ruby context context.rb and its XML equivalent context.xml.

Building

To build Springy from the source, you need need Maven. Alternatively you can use Rake plus the Jerbil extensions. Once everything is installed, do

    % m2 package (maven)
    % rake dist  (jerbil)

in the toplevel directory.

Stuff

FAQ.

Contact: jan@trampolinesystems.com

Homepage: code.trampolinesystems.com/springy

License

Licensed 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.