The purpose of doing it this way is twofold. First,
I??™ll show you how to wrap a JRuby engine within an EJB, and expose some operations from
Ruby to EJB consumers. Second, in the next chapter, we??™ll be able to look at how to make
JRuby on Rails use an EJB. In most situations, you??™d probably have either a Java consumer that
uses a Ruby EJB, or a Rails application that uses a regular EJB.
The application you create will be small, because it will be used first and foremost to show
the infrastructure necessary. The service you??™ll expose allows a user to get named sequence
values. You??™ll add authorization to the service, and also timestamps and the possibility to reset
sequences or create them.
To make the application as easy as possible to write, you??™ll make use of ActiveRecord in
the service engine implemented in Ruby. Further, you??™ll also use the JRuby classes directly,
because you need to have some functionality that can??™t be done through BSF or JSR223.
You won??™t use migrations, instead resorting to regular SQL, because we don??™t have the
framework necessary to make migrations easy to use . When it gets time to deploy the enterprise
bean, you??™ll do that in the excellent GlassFish container. This chapter will require you to use at
least Java 5, because the EJB3 standard is too tempting to resist for an application like this.
When you??™re through, you should have many new ideas and approaches to handle your
enterprise problems.
Pages:
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259