JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java Certification  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 SCBCD 模擬考題 [精華]
worookie

Small Ship

版主

發文: 2092
積分: 21
於 2003-08-23 14:47 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
底下 8 題是我的一個好友出的模擬題
題目雖和實際考題不同, 但是內容涵蓋範圍的命中率幾乎是百分之百.

(1) Which are true about session beans?

A. A client can pass a remote home object reference to another application.

B. The javax.ejb.EJBMetaData interface is intended to allow application assembly
tools to discover information about the session bean, and to allow loose
client/server binding and client-side scripting.

C. The javax.ejb.EJBLocalHome interface defines the method create() which returns
javax.ejb.EJBLocalObject.

D. The javax.ejb.EJBLocalHome interface defines the method remove(Object primaryKey)
which returns null.

(2) Consider the following session bean class:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import javax.ejb.*;
import javax.naming.*;
import javax.sql.*;
import javax.jms.*;
public class MySessionBean implements SessionBean {
    private SessionContext sessionContext;
    private Context jndiContext;
    private Queue queue;
    private UserDefinedClass userDefinedClass;
 
    public void ejbCreate() {
        try {
            queue = (Queue) jndiContext.lookup("java:comp/env/jms/StockQueue");
        } catch (NamingException ne) {
            throw new EJBException(ne);
        }
        userDefinedClass = new UserDefinedClass();
    }
 
    public void ejbRemove() {...}
    public void ejbActivate() {...}
    public void ejbPassivate() {...}
 
    public void setSessionContext(SessionContext sessionContext) {
        this.sessionContext = sessionContext;
        try {
            jndiContext = new InitialContext();
        } catch (NamingException ne) {
            throw new EJBException(ne);
        }
    }
 
    public class UserDefinedClass {
      String dummy;
        private DataSource dataSource;
        public UserDefinedClass() {
            try {
                dataSource = (DataSource) jndiContext.lookup(
                    "java:comp/env/jdbc/MyDB");
            } catch (NamingException ne) {
                throw new EJBException(ne);
            }
        }
    }
}

Which of the following are true about the conversational state?

A. The state of the variable sessionContext is kept after passivation/activation.

B. The state of the variable jndiContext is kept after passivation/activation.

C. The state of the variable queue is kept after passivation/activation.

D. The state of the variable userDefinedClass is kept after passivation/activation.

E. The container must be able to properly save and restore the reference to the
home and component interfaces of the EJBs stored in the instance's
state even if the classes that implement the object references are not
serializable.

F. The container may use the object replacement technique
(java.io.ObjectOutputStream/ObjectInputStream) to externalize the home and
component references.

(3) Which are true about session beans? (Choose all that apply)

A. An attempt to remove a session object while the object is in a transaction will
cause the container to throw the IllegalStateException to the client.

B. A session bean class must not implement the session bean's component interface.

C. A session bean class must not implement the ejbCreate() method.

D. The business methods of a session bean must not be declared as final or static.

E. The remote interface methods must not expose the managed collection classes
that are used for CMP entity beans as arguments or results.

(4) Given a CMP entity bean, which of the following statements are correct?
(Choose all that apply)

A. All the exceptions defined in the throws clause of the method of the remote interface
must be defined in the throws clause of the matching method of the enterprise Bean class.

B. The ejbSelect<METHOD>(...) must not be declared as static or abstract.

C. The ejbHome<METHOD>(...) can be declared as final.

D. The return value type of a business method of an entity bean class could be of MyClass defined
as follows:
1
2
3
4
5
public class MyClass {
    public int result;
    public int getResult() { return result; }
    public void setResult(int result) { this.result = result; }
}

E. The throws clause of an ejbPostCreate<METHOD>(...) may define
arbitrary application specific exceptions including javax.ejb.CreateException.

F. The bean provider must always define a query for each finder method in the deployment descriptor.

(5) Which of these is/are correct about exception? (Choose all that apply)

A. When a RemoveException is thrown from the ejbRemove() method of an entity bean
where the corresponding remove() method has CMT attribute Mandatory,
the client will receive this RemoveException.

B. If the Container denies a client access to a business method, the client will
receive RemoteException or EJBException.

C. When a NoSuchObjectException is thrown from an ejbHome<METHOD>(...) method of an entity bean
where the corresponding home method has CMT attribute RequiresNew,
the client's transaction if any must be marked for rollback.

D. When a system exception is thrown from the onMessage() method of a MDB
with BMT, any transaction that has been started, but not yet completed, by the instance
must be marked for rollback.

(6) Which are true about EJB environment? (Choose all that apply)

A. A resource manager connection factory reference is scoped to the EJB whose declaration
contains the resource-ref element.

B. By default, connections to a resource manager are shareable across other EJBs
in the application that use the same resource in the same transaction context.

C. The Deployer must ensure that all the declared resource environment references are bound to
administered objects that exist in the operational environment. The Deployer may use, for
example, the JNDI LinkRef mechanism to create a symbolic link to the actual JNDI name of
the target object.

D. The Deployer should be able to customize an EJB's business logic.

(7) Which is/are true about security responsibilities? (Choose all that apply)

A. The Deployer is responsible for configuring principal mapping for inter-EJB calls.
The management of caller principals passed on inter-EJB invocations is set up
by the Deployer and System Administrator.

B. Security roles are defined by the Bean Provider in the deployment descriptor.

C. The EJB Container can, but is not required to, provide support for multiple
security domains, and/or multiple principal realms.

D. If the client is in a different security domain than the target enterprise
bean, the system administrator is responsible for mapping the principals used by
the client to the principals defined for the enterprise bean.

(8) Which is/are true about ejb security? (Choose all that apply)

A. If the security infrastructure performs principal mapping, the
getCallerPrincipal() method must return the original caller principal.

B. If the run-as security identity is set up for the bean, its method getCallerPrincipal()
returns the principal that corresponds to the run-as security identity.

C. If transactional requests within a single transaction arrive from multiple clients, all requests
within the same transaction must be allowed to be associated with different security context.

D. The Container must allow multiple-deployed enterprise beans to co-exist at runtime.


swanky edited on 2004-01-30 22:31
reply to postreply to post
作者 Re:SCBCD 模擬考題 [Re:worookie]
worookie

Small Ship

版主

發文: 2092
積分: 21
於 2005-04-16 11:01 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
題目好久以前了(快兩年了), 答案好像找不到了 (以前這些題目都是貼在 JavaRanch 上). 我試著回答看看...

1. ABD
2. ABEF
3. DE
4. CDE
5. ABD
6. ABCD
7. AD
8. D


worookie edited on 2005-04-16 11:03
reply to postreply to post
作者 Re:SCBCD 模擬考題 [Re:worookie]
lianghua21cn





發文: 8
積分: 0
於 2005-08-07 13:26 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
多谢worookie。

有个问题:SCBCD的题目是多选的马?


reply to postreply to post
作者 Re:SCBCD 模擬考題 [Re:worookie]
bleed1979





發文: 67
積分: 2
於 2007-09-12 16:15 user profilesend a private message to usersend email to bleed1979reply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
post is deleted.

bleed1979 edited on 2009-02-28 07:32
reply to postreply to post
» JWorld@TW »  Java Certification

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8