1Z0-895 無料問題集「Oracle Java EE 6 Enterprise JavaBeans Developer Certified Expert」
A developer creates a stateless session bean. This session bean needs data from a remote system. Reading this data takes a long time. Assume that the data will NOT change during the life time of the bean and that the information to connect to the remote system is defined in JNDI.
Which statement describes how to manage the data correctly?
Which statement describes how to manage the data correctly?
正解:B
解答を投票する
An ejb-jar also contains three interceptor classes: AInt, BInt, CInt. Each interceptor class defines an AroundInvoke method called intercept.
The ejb-jar also contains a stateless session bean FooBean with a local business interface Foo that declares a method foo ():
10.
@Stateless
11.
@Intercaptors ({CInt.class, BInt.class})
12.
public class FooBean implements Foo {
13.
14.
public void foo () {}
15.
16.
}
The ejb-jar contains a META-INF/ejb-jar.xml file with an <interceptor-binding> section:
<interceptor-binding>
<ejb-name>FooBean</ejb-name>
<interceptor-order>
<interceptor.class>com.acme.AInt</interceptor-class>
</interceptor-order>
</interceptor.binding>
What is the interceptor order when the business methodfoo() is invoked?
The ejb-jar also contains a stateless session bean FooBean with a local business interface Foo that declares a method foo ():
10.
@Stateless
11.
@Intercaptors ({CInt.class, BInt.class})
12.
public class FooBean implements Foo {
13.
14.
public void foo () {}
15.
16.
}
The ejb-jar contains a META-INF/ejb-jar.xml file with an <interceptor-binding> section:
<interceptor-binding>
<ejb-name>FooBean</ejb-name>
<interceptor-order>
<interceptor.class>com.acme.AInt</interceptor-class>
</interceptor-order>
</interceptor.binding>
What is the interceptor order when the business methodfoo() is invoked?
正解:A
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
Given a set of CMT bean methods with the following transaction attributes:
Method M1 = SUPPORTS
Method M2 = REQUIRED
Method M3 = NOT_SUPPORTED
Method M4 = REQUIRES NEW And the following method invocation sequence:
Method Ml invokes Method M2
Method M2 invokes Method M3
Method M1 invokes Method M4
If Method Ml is invoked by a method that does NOT have a transaction context, which describes a possible scenario?
Method M1 = SUPPORTS
Method M2 = REQUIRED
Method M3 = NOT_SUPPORTED
Method M4 = REQUIRES NEW And the following method invocation sequence:
Method Ml invokes Method M2
Method M2 invokes Method M3
Method M1 invokes Method M4
If Method Ml is invoked by a method that does NOT have a transaction context, which describes a possible scenario?
正解:D
解答を投票する
A developer writes a stateful session bean FooBean with one remote business interface Foo. Foo defines an integer / setter method pair implemented as:
10.
private int value;
11.
public void setValue (int i) {value = i; }
12.
public int getValue () {return value; }
A session bean ClientBean has a business method doSomething and an ejb-ref with ejb-ref-name "fooRef" that is mapped to FooBean's Foo interface.
11.
@Resource private SessionContext SessionCtx;
12.
public void doSomething () {
13.
Foo foo1 = (Foo) sessionCtx.lookup("fooRef");
14.
Foo foo2 = (Foo) sessionCtx.lookup("fooRef");
15.
foo1.setvalue(1);
Which statement is true after the code at line 15 completes?
10.
private int value;
11.
public void setValue (int i) {value = i; }
12.
public int getValue () {return value; }
A session bean ClientBean has a business method doSomething and an ejb-ref with ejb-ref-name "fooRef" that is mapped to FooBean's Foo interface.
11.
@Resource private SessionContext SessionCtx;
12.
public void doSomething () {
13.
Foo foo1 = (Foo) sessionCtx.lookup("fooRef");
14.
Foo foo2 = (Foo) sessionCtx.lookup("fooRef");
15.
foo1.setvalue(1);
Which statement is true after the code at line 15 completes?
正解:C
解答を投票する


