J2EE への統合 / J2EE Integration

This document serves to answer a few common questions about integration of Turbine with J2EE technologies including Servlets, EJB, Swing, JMS, Transactions, JNDI, XML, JDBC, JSP, and Security. The short answer is that it is all Java code and you can choose to use Turbine's solutions to some things or you can choose to use J2EE solutions to some things. Turbine is increasingly flexible about what parts you choose to use and what parts you don't. The reason is because there has been quite a lot of de coupling of the various Turbine components as a result of years of development and use by people all over the world in various different ways. Wow, isn't that cool?

このドキュメントは Servlet 、 EJB 、Swing、 JMS 、トランザクション、 JNDI 、 XML 、 JDBC 、 JSP とセキュリティを含んでいる J2EE テクノロジーで Turbine の統合についてのいくつかの共通の質問に答えるのに役立ちます。手短に答えると、すべては Java コードであり、Turbine の持つ解決策をいくつかに、また J2EE の解決策をいくつかの事柄に与えるのか選択することが出来るのです。使用にあたってどの箇所を選択し、どの箇所を選択しないのかということについて、Turbine はますます柔軟性のあるものになっています。この訳は、開発を進めてきたことと世界中の人々に様々な方法で使用されてきたことの結果として、とても多くの分割された Turbine の様々なコンポーネントがあるからです。クールだと思いませんか?

何と共にどのように Turbine は稼動しますか...? / How does Turbine work with ... ?

Servlet

It is a servlet. It is also a set of re-usable components assembled into a framework. You can choose to work with just the Servlet, you can choose to work with just the components or you can choose to work with both. In a lot of normal development cases, people start off with a simple servlet and tack on various components (like Connection Pooling, Cron Schedulers, User Management, Services, etc.). That is what we have done as well, however we have done it in such a way that it is very pluggable. Mix and match and use what you want to use. Ignore the rest.

それはServlet です。それは同様にフレームワークの中へ組み立てられることに関してに再利用に適したコンポーネント群です。多くの開発ケースにおいて、人々はシンプルな Servlet で始めようとし、様々なコンポーネント(コネクションプーリング、Cron スケジューラ、ユーザ管理、さまざまなサービス)を付加します。どんなに私たちが非常に追加可能なものを利用しても、それは私たちが同様に行なったことです。混成させて調和するようにあなたが使いたいことを使ってください。残りは無視して構いません。

EJB

Turbine provides a framework for developing web applications - specifically the front end. EJB provides a framework for developing n-tier applications - specifically the back ends - thus Turbine and EJB complement each other well at that level.

Turbine はフレームワークをWebアプリケーション開発に - 特にフロントエンドへ - 供給します。 EJB はフレームワークを n 層のアプリケーションを開発 - 特にバックエンドへ - することに供給します。このように Turbine と EJB はそのレベルで良くお互いを補足します。

Swing

Turbine is the for the web - Swing is not - not applicable.

Turbine は Web のためにのものです。 Swing はそうではありません - 適用範囲外です。

JMS

Turbine provides facilities for plugging in other Services - and thus JMS could be plugged in as a service to that. Even if it isn't plugged in through Turbine's Services facilities, you can still put your JMS related methods into your code. Turbine doesn't prevent you from calling other Java code.

Turbine は他の Service にプラグを差し込むことのための機能を供給します。ですので JMS はそれに対する貢献としてプラグを差し込まれるかもしれません。それはプラグを差し込まれて Turbine の Service 群の機能を通じても、 JMS 関連メソッドを作成しているコード内に書くことが出来ます。Turbine は他の Java コードからコールを行うことを阻むものではありません。

トランザクション

There is nothing in Turbine explicitly using the JTS/JTA - but can use EJB and hence these technologies. That belongs in EJB's anyways. :-)

Turbine には明確に JTS/JTA を使用するものはありませんが、 EJB とそれらの技術を使用することが出来ます。それは EJB に常に属します :-)

JNDI

Turbine provides access to JNDI via a Service facility. You can always choose to implement your own facility as well (ie: if you have an existing code base that you would like to use, Turbine does not stop you from using it).

Turbine は Service 機能経由で JNDI に対するアクセスを提供します。常にあなたの機能を実装することを同様に選択することができます ( 参照 : 使いたいものに既存のコード基盤があれば、 Turbine はそれを使うことを阻みません ) 。

XML

Turbine provides support for using and working with XML. Again, nothing preventing you from using XML within Turbine or even sending XML out of Turbine.

Turbine は 使用することと稼動することで XML への対応を提供します。復唱しますが Turbine で XML を使うことや、 Turbine から XML を出力することも阻まれることではありません。

JDBC

Turbine provides good support for working with JDBC through the Village API, the Torque Object Relational Tool and its connection pooling facilities. The connection pool is not yet fully J2EE "compatible" in that it does not support DataSources. However, at some point we may choose to implement that. Note, again, Turbine does not prevent you from using your own Connection pooling mechanism, we simply created one because at the time, we needed one and ours works just fine.

Turbine はvillage API Torque オブジェクトリレーショナルツール とそのコネクションプール機能を通じて JDBC をともなう機能に対する良い対応を提供します。コネクションプールはそれが DataSources をサポートしないということでは J2EE “互換”ではありません。しかし、いくつかのポイントで私たちはそれを実装することを決心するかもしれません。再度記述しますが、 Turbine はあなたの接続プールメカニズムを使うことを阻むものではありません。私たちは必要だったので一時的に、私たちのものを作成しました。私たちが作成したものは上手く動いています。

JSP

Turbine provides excellent support for using JSP in its model of working - which is based on the Model 2 style with enhancements, such as solving the Action portion of the Model. However, we strongly suggest that you do not use JSP and seek out other alternatives.

Model2のAction部分を解決するような JSP を Model2形式の拡張において使用するときに Turbine は素晴らしい対応を提供します。しかしながら、私たちは強くあなたが JSP を使わないと示唆して外に他の選択肢を求めます。

セキュリティ

Turbine was created long before J2EE was created. Therefore, we needed to implement our own Security Model. This model is based on Users, Roles, Permissions and Object Groups. It is an Access Control List (ACL) based security scheme and can grow to support nearly any level of access control people can come up with. It follows our extensible design pattern and you can use Turbine's code as the basis for any additional security your application requires.

J2EE が作成されるはるか以前に、 Turbine は作成されました。 それゆえに、私たちは自分達自身でセキュリティモデルを実装する必要がありました。 このモデルはユーザ、ロール、パーミッションとオブジェクトグループに基づいています。 それはどのようなレベルのアクセスコントロールでも人々が追いつけるように成長することが出来る Access Control List (ACL) ベースのセキュリティスキーマです。 私たちの拡張的なデザインパターンを理解でき、Turbine のコードをアプリケーションの必要に応じて追加的なセキュリティの基礎として使用することが出来ます。

Container Managed Security

コンテナ管理のセキュリティ

You can use container managed security if you wish, and Turbine provides you with mechanism for application manged security, in case you need them.

望むのであれば、コンテナ管理のセキュリティを使うことができて、そして Turbine はアプリケーション管理のセキュリティのためにあなたにメカニズムを供給します。

The main problem with container managed security is that it cannot be managed from the inside of the application. Whenever you want to add/remove users to your application (or suite of them) or want to modify user's roles, you need to use whatever tool your application server provides for that.

コンテナ管理のセキュリティとの主な問題は、アプリケーションの内部からそれが管理されることができないということです。あなたがあなたのアプリケーションへのユーザの追加/削除( またはそれらの両方 )へ望む時はいつでも、またはユーザのロールを修正するには、アプリケーションサーバがその目的のために提供するどのようなツールでも使う必要があります。

Now, this could work just fine for closed-public applications and intranets, but would be really unacceptable on open-public sites, where the users need the ability to register and receive 'accounts' without human interaction.

現在、これは閉ざされた公共のアプリケーションとイントラネットのために上手く働くことが出来ました。しかし公共のサイトでは、ユーザは登録する能力を必要としているので人間的な相互作用なしには、『アカウント』を受け取る場所で受け入れられないでしょう。

Currently Turbine supports the latter model - application managed security. This is because if it didn't have it, many people would have to write code to provide it. That's why we created SecurityService in a cooperative effort.

現在 Turbine は後のモデル - アプリケーション管理のセキュリティをサポートします。これはそれがなかったならば、多くの人々がそれを提供するためにコードを書かなければならないだろうからです。それは私たちが協力的な成果で SecurityService を作成した理由です。

On the other hand, you don't need to write any code to use declarative container managed security. You can restrict access to the Turbine servlet with the usual web.xml magic. If you wish to use programmatic container managed security code, there is relatively very little code to write. You need to create your own SecureScreens (probably extending VelocityScreen) and SecureActions that contained code that calls the HttpServletRequest getUserPrincipal and isUserInRole methods. above.

他の方面では、あなたは説明したコンテナ管理のセキュリティを使うために少しもコードを書く必要がありません。あなたは普通の web.xml の魔法で Turbine Servlet に対するアクセスを制限することができます。プログラム的なコンテナ管理のセキュリティコードを使うことを望むのであれば、書く分にはとても少量のコードがあるだけです。あなたは(おそらく VelocityScreen を拡張して)HttpServletRequest getUserPrincipalisUserInRoleメソッドをコールする自分の SecureScreens と SecureActions を作り出す必要があります。