Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
実行時のルックアップで、返されたオブジェクトがどの種類の EJB かを知るにはどうすればよいですか?
ステートフルかどうかだけを知っていると、私にとっては良いことです。
bound = new InitialContext().lookup(lookup); if(isStateful(bound)){...}
現在のアプリケーション サーバーは JBoss AS 6.1 です。
それは依存します...注釈Statefulとを使用しますStatelessか?
Stateful
Stateless
final Class<?> clazz = bound.getClass(); if (clazz.isAnnotationPresent(Stateful.class)) { /* stateful */ } else if (clazz.isAnnotationPresent(Stateless.class)) { /* stateless */ } else { /* woops? */ }