J2EE 测试题 : SUN - Developing Business Tier Components WJ-3102A

Question 1 of 20:
Which methods are invoked to transition an entity bean from a pooled state to a ready state? (Check all that apply.)

A. The EJB Constructor
B. setEntityContext(EntityContext ec)
C. ejbCreateXXX(args) and ejbPostCreate(args)
D. ejbActivate()
Question 2 of 20:
Which of the following must a Session Bean or an Entity Bean contain? (Check all that apply.)

A. A home interface
B. A component interface
C. The bean implementation class
D. External resource references
Question 3 of 20:
Which methods maybe invoked in order to transition an entity bean from a pooled state to a ready state? (Check all that apply.)

A. The EJB Constructor
B. setEntityContext(EntityContext ec)
C. ejbCreateXXX(argument)
D. ejbActivate()
Question 4 of 20:
Which of the following statements are true about Standalone Clients and Application Client Containers in J2EE? (Check all that apply.)

A. Standalone clients are not part of the application server's run-time environment.
B. If a Standalone client authenticates a user, the application server will not necessarily trust the user's identity.
C. Standalone clients executing do not have a local namespace and must use real JNDI names to locate EJB components.
D. An Application Client Container contains a security interface which can be trusted by the Application Server, as well as a local namespace which can be used to map indirect names to real JNDI names.
Question 5 of 20:
Which of the following Enterprise JavaBeans can be stored in a persistent backend? (Check all that apply.)

A. CMP Entity Beans
B. BMP Entity Beans
C. Message Driven Beans
D. Stateless Session Beans
Question 6 of 20:
Which of the following is the correct sequence of methods invoked by a J2EE container for a Session EJB?

i. ejbCreate()
ii. setSessionContext(SessionContext sc)
iii. Constructor call to instantiate the bean
iv. ejbRemove()

A. i, ii, iii, iv
B. iii, i, ii, iv
C. iii, ii, i, iv
D. i, iii, ii, iv
Question 7 of 20:
Which method(s) signature(s) can be declared in a Stateless Session Bean implementation class? (Check all that apply.)

A. public void ejbActivate(){}
B. public void setSessionContext(){}
C. public void ejbCreate(String init){}
D. public void ejbCreate(){}
Question 8 of 20:
Which of the following statements about ejbCreate() and ejbPostCreate() methods are true? (Check all that apply.)

A. For each ejbCreate() method, there is a corresponding ejbPostCreate() method with the same argument list.
B. The bean developer should modify values of cmr-fields (Container Managed Relationship fields) in the ejbPostCreate() and not in the ejbCreate() method.
C. The ejbCreate() method returns an object of the PrimaryKey type, whereas the ejbPostCreate() returns void.
D. In the ejbPostCreate() method, the bean instance can discover the PrimaryKey associated with it by calling the getPrimaryKey() method on its entity context object.
Question 9 of 20:
What is/are the key difference(s) between a pooled and a ready instance of an entity bean instance? (Check all that apply.)

A. All pooled instances are identical objects.
B. A Pooled instance has no EJB object identity associated with it.
C. A Ready instance has no EJB object identity associated with it.
D. All ready instances are identical objects.
Question 10 of 20:
Which of the following statements are true about the EJB component environment? (Check all that apply.)

A. It is a read only environment.
B. It is specific to a particular EJB component.
C. Environment values are set at deployment time and the application server vendors are not required to facilitate runtime modifications.
D. The name prefix for a particular environmental value contains "java:comp/env"
Question 11 of 20:
Which of the following, according to the EJB specification, pertains to the Home interface? (Check all that apply.)

A. Extends the EJBLocalObject interface and provides a local EJB object.
B. Extends the EJBObject interface and provides a remote EJB object.
C. Extends the EJBHome interface and provides a remote home object.
D. Is a factory interface for an EJB component, regardless of it being local or remote.
Question 12 of 20:
How does a Container Managed Persistence (CMP) entity bean differ from a Bean Managed Persistence (BMP) entity bean?

A. CMP supports both bean managed and container managed transactions.
B. CMP entity beans does not mandate a Primary Key class definition.
C. CMP entity beans do not contain persistence logic.
D. The BMP model delegates thread management responsibilities to the bean developer.
Question 13 of 20:
Which of the following statements are the true? (Check all that apply.)

A. The finder methods are generated at the entity bean deployment time using Container provided tools.
B. EJB QL is a query specification language for the finder and select methods of entity beans with Container Managed Persistence (CMP).
C. EJB QL query string contains a SELECT, a FROM, an optional WHERE, and an optional ORDER BY clause.
D. All identification variables, such as special operators IN and AS, can only be declared in the FROM clause in an EJB QL query.
Question 14 of 20:
How can Timer events be scheduled? (Check all that apply.)

A. At a specific time
B. After a specified elapsed duration
C. At specific recurring intervals
D. For Stateful session beans only
Question 15 of 20:
Which methods maybe invoked in order to transition an entity bean from a state of non-existence to a pooled state? (Check all that apply.)

A. The EJB Constructor
B. setEntityContext(EntityContext ec)
C. ejbCreateXXX(argument)
D. ejbLoad()
Question 16 of 20:
Which of the following statements about ejbLoad() and ejbStore() methods are true? (Check all that apply.)

A. The ejbLoad() method is called when the container needs to synchronize the enterprise bean instance with the entity object's persistent state.
B. The ejbStore() method is called when the container needs to synchronize the entity object's persistent state with the entity bean instance.
C. The ejbStore() method executes in the same transaction context as the previous ejbLoad() or ejbCreate() method invoked on the entity bean.
D. The ejbLoad() and ejbStore() methods are used to transition an entity bean to and from the pooled state to the ready state.
Question 17 of 20:
What are the advantages of using a indirect Object lookup over a direct object lookup? (Check all that apply.)

A. The client does not perform a lookup using the real JNDI name of an object when performing an indirect lookup.
B. The client maps an indirect name to a direct/real JNDI name.
C. Indirect object lookup enforces fewer namespace management constraints on the server side.
D. A direct object lookup does not use a central naming service.
Question 18 of 20:
Which method declaration can be inserted in line 3 to correctly define the home interface for the following code example?

A. public EJBHome create() throws javax.ejb.CreateException, java.rmi.RemoteException;
B. public EJBSession create() throws javax.ejb.CreateException, java.rmi.RemoteException;
C. public EJBHome home() throws java.rmi.RemoteException;
D. public EJBSession home() throws java.rmi.RemoteException;
Question 19 of 20:
How is a Container Managed Persistence (CMP) entity bean distinguished from a Bean Managed Persistence (BMP) entity bean in the EJB deployment descriptor? (Check all that apply.)

A. By the value of the <persistence-type> attribute
B. By the <cmp-field> attribute(s)
C. By the <primkey-field> attribute
D. By the <cmp-bean> attribute
Question 20 of 20:
Which of the following statements are true? (Check all that apply.)

A. The three basic types of J2EE components located in the EJB container include Session Beans, Entity Beans and Timer Beans.
B. EJB components contain lifecycle or callback methods as well as business methods.
C. The EJB Local component or the Remote component interface provides business methods that can be invoked by the EJB.
D. Entity Beans are either Stateful or Stateless in nature.


Answer:
1,CD
2,ABC
3,CD
4,ABCD
5,AB
6,C
7,AD
8,ABCD
9,AB
10,ABCD
11,CD
12,C
13,ABCD
14,ABC
15,AB,
16,ABC
17,ABC
18,B
19,AB
20,BC
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值