Sample Code: Choice 1 Choice 2 Choice 3 Choice 4 Choice 5
Sample Code: Choice 1 Choice 2 Choice 3 Choice 4 Choice 5
Which one of the following design pattern strategies does the class "Sample" in the sample code above illustrate? Immutable Business Delegate
Choice 1
Session Facade
Choice 4
Submit
Image
Referring to the diagram above, which one of the following states the start and end locations of this transaction? Start: AccountBean End: PaymentBean Start: PurchaseBean End: PurchaseBean Start: PurchaseBean End: AccountBean Start: AccountBean End: PurchaseBean Start: PurchaseBean End: PaymentBean
Submit
Java - EJB 2.0, Question 2 of 40 On which one of the following is asynchronous integration based?
Submit
Java - EJB 2.0, Question 3 of 40 Which one of the following is one of the two types of JMS messaging models?
Remote method invocation Upload and download TCP/IP Publish and subscribe Deliver and extract
105
Submit
Java - EJB 2.0, Question 4 of 40 An entity bean has been developed to represent a customer. Referring to the above scenario, which one of the following entity bean calls removes the underlying customer data from the database? ejbStore() ejbDelete()
Scenario
Choice 1 Choice 2
ejbRemove()
Choice 3
ejbLoad()
Choice 4
ejbCreate()
Choice 5
Submit
Java - EJB 2.0, Question 5 of 40 In an e-commerce application, it is likely that the number of clients accessing the application may increase significantly, for example, from one user per hour to 10,000 users per hour. Application components that maintain performance well in this scenario are often described as "scalable." Referring to the scenario above, which one of these component types generally performs well in handling the increased usage when clients do NOT require conversational state? Synchronized bean Stateful session bean
Scenario
Choice 1 Choice 2
Standard JavaBean
Choice 3
Passivated bean
Choice 5
Submit
Java - EJB 2.0, Question 6 of 40 Which one of the following types of method does the bean provider define as abstract and use EJB-QL as declared in the deployment descriptor?
ejbCreate() methods ejbHome...(...) methods ejbSelect...(...) methods ejbFind...(...) methods ejbLoad() methods
87
Submit
Java - EJB 2.0, Question 7 of 40 In an application using Enterprise JavaBeans, which one of the following provides the implementation of the EJB object?
Deployment descriptor Web container EJB context Client application EJB container
13
Submit
Image
Servlets
Choice 2
Remote interfaces
Choice 3
Enterprise Beans
Choice 5
Submit
Java - EJB 2.0, Question 9 of 40 Which one of the following is a performance benefit of using message-driven beans? A message can be sent to a message-driven bean without blocking the workflow of an application. Message-driven beans are able to recognize a client's security identity more quickly. There is no network overhead involved in sending messages, which increases data throughput. Message-Oriented Middleware uses networking protocols, which are faster than RMI-IIOP. You receive an instant response from the message-driven bean's business method.
Submit
42
Java - EJB 2.0, Question 10 of 40 What is a JNDI initial context? It is the initial starting point at which naming and directory operations can be resolved. It is the initialization procedure for an entity bean when loaded from the database. It is the initial place at which the container-generated EJBObject is instantiated. It is the initialization procedure for a stateful session bean with conversational state. It is the initial object that provides run-time information about an enterprise bean's environment.
Submit
59
Java - EJB 2.0, Question 11 of 40 Under which directory is the ejb-jar.xml file found within the EJBJAR Java archive file?
Submit
Java - EJB 2.0, Question 12 of 40 Client code calls the method "create(Integer primaryKey)" on an entity home interface. A new entity bean with this primary key is then created in the EJB container. What happens in the EJB Container in the above scenario? A bean instance is created but nothing is added to the database.
Scenario
Choice 1
Choice 4 Choice 5
A bean instance in the ready state loads pre-existing data from the database. Another entity bean is removed from the database to make space for the new entity bean.
Submit
Image
Referring to the diagram above, if Company and Employee are entity beans, what is the term generally used to describe the relationship between the Company and Employee beans? Superclass-to-subclass
Choice 1
One-to-many
Choice 2
Singular-to-plural
Choice 3
Unique-to-duplicate
Choice 4
Singleton-to-collection
Choice 5
Submit
Java - EJB 2.0, Question 14 of 40 Which one of the following code fragments tests to see if two remote references to enterprise beans refer to the same bean?
EJBObject.isTheSame(EJBObject obj) EJBObject.isIdentical(EJBObject obj) EJBObject.equals(EJBObject obj) EJBObject.isEqual(EJBObject obj) EJBObject.isEquivalent(EJBObject obj)
50
Submit
Java - EJB 2.0, Question 15 For each stateful session bean instance in an EJB container, what is the maximum number of clients it may have?
Choice 4 Choice 5
Submit
Java - EJB 2.0, Question 16 of 40 The primary key of a CustomerBean entity bean has been defined as one of its entity data fields, customerNumber. These customer numbers are also used by real-life customers to identify themselves when purchasing products from an e-commerce site. Referring to the scenario above, which one of the following is a potential disadvantage of using business data such as "customerNumber" as natural primary keys? Using an existing data field is likely to cause errors in the database (in particular, duplicate key errors). If the format of "customerNumber" is changed for business reasons, the application developer has to update that primary key field, as well as every place where it is used as a foreign key, throughout the whole database. Much more effort needs to be put into designing the format of the "customerNumber" field so that only universally unique keys are generated. It is not possible to use letter characters in the primary key because the word "Number" is a sub-string of the primary key name "customerNumber." The database has a parallel field called "customerNumberPK" with the same data, which is redundant and uses up unnecessary storage space. Java - EJB 2.0, Question 17 of 40
Scenario
Choice 1 Choice 2
Submit
Sample Code
Referring to the sample code fragment above, which one of the following is the bean type? BMT entity bean
Choice 1
Submit
Nav 19.
Sample Code
Referring to the code sample above, if the class Answer is NOT itself a remote object, which one Java interface must it implement? java.io.Serializable
Choice 1
javax.jms.Message
Choice 2
java.rmi.Naming
Choice 3
javax.sql.DataSource
Choice 4
java.lang.Comparable
Choice 5
Submit
Sample Code
Referring to the sample code above, how does the OrderBean check whether or not its calling client matches the role name "admin"? context.getCallerInRole("admin")
Choice 1
context.getCallerPrincipal("admin")
Choice 2
context.isCallerInRole("admin")
Choice 3
context.isCaller("admin")
Choice 4
context.isCallerPrincipal("admin")
Choice 5
Submit
Java - EJB 2.0, Question 21 of 40 Which one of the following method types found in the home interface do you use to locate existing entity bean data from the persistent store?
Choice 4 Choice 5
Sample Code
Choice 1
Choice 2
Choice 3
Choice 4
Choice 5
Which one of the following lines of code do you place at Line 12 in the sample code above? dataSource = (DataSource) initContext.bind("java:comp/env/jdbc /Database").getDataSource(); dataSource = (DataSource) initContext.getEnvironment("java:com p/env/jdbc/Database"); dataSource = (DataSource) initContext.rebind("java:comp/env/jd bc/Database"); dataSource = (DataSource) initContext.forName("java:comp/env/j dbc/Database"); dataSource = (DataSource) initContext.lookup("java:comp/env/jd bc/Database");
Submit
Java - EJB 2.0, Question 23 of 40 Which one of the following methods sets the container-provided runtime context for an Entity Bean?
setEntityContext(EntityContext context) setContext(Context context) setEJBObject(EJBObject object) setEnterpriseContext(EnterpriseContext context) setEJBContext(EJBContext context)
Submit 55
Which one of the following bean instances can have a loopback call, allowing the bean instance to behave as a multi-threaded object?
Choice 1 Choice 2 Choice 3 Choice 4 Choice 5
Synchronized entity bean Pooled stateless session bean Stateful session bean Stateless session bean Re-entrant entity bean
Submit 206
Java - EJB 2.0, Question 25 of 40 During design, a method of a session bean corresponds to which one of the following parts of speech found in the requirements?
Sample Code
Choice 1
Choice 2
Choice 3
Choice 4
Choice 5
In the deployment descriptor fragment above, what does the <res-sharing-scope> element declare? Serializable transactions are not allowed in the TestDB database because database records must always be shared. Connections obtained through the javax.sql.DataSource resource manager connection factory reference can be shared. Phantom reads may occur when accessing the TestDB database because database records can be shared. Security principals using the javax.sql.DataSource resource manager connection factory reference can be shared. Clients may share stateful session beans that access the TestDB database through the javax.sql.DataSource resource manager connection factory.
Submit
Java - EJB 2.0, Question 27 of 40 Which one of the following is the method that processes JMS messages?
public Message getMessage() public void processMessage(Message message) public void onMessage(Message message) public Message receiveMessage() public void receive(Message message)
Submit 103
Java - EJB 2.0, Question 28 of 40 What does the term "RMI-IIOP" mean? Remote Method Invocation over Internet Inter-Orb Protocol Remote Method Invocation over Internet Integration Objects Protocol Remote Method Invocation with International Internet Objects Protocol Remote Method Invocation for Industry Internet Objects Protocol Remote Method Invocation over Isolated Internet Objects Protocol
Submit
10
Image
Choice 1 Choice 2
Referring to the diagram above, which one of the following methods is Method "X"? setMessageDrivenContext(MessageDrivenContext context) ejbStore() onMessage(Message message)
Choice 3
ejbActivate()
Choice 4
Submit
Java - EJB 2.0, Question 30 of 40 A client of an enterprise bean wishes to execute a use case in a single business method but does not want to
Scenario
be held up waiting for a response from the enterprise bean before continuing. This would, for example, allow a Web page to state to a user: "We have received your request, which we are currently processing." Which one of the following design patterns is suitable for the scenario above? Business Interface
Choice 1
Message Facade
Choice 2
Service Locator
Choice 4
Value Object
Choice 5
Submit
Java - EJB 2.0, Question 31 of 40 Which one of the following stateful session bean lifecycle methods may be defined with more than one parameter in its method signature?
Java - EJB 2.0, Question 32 of 40 Which interface provides the method getHandle()?
Sample Code
Referring to the sample code above, if Line 6 throws a RuntimeException, what is the effect on the client that sent the message?
The client is not able to send messages since the RuntimeException causes the EJB container to crash. The client receives a special RuntimeException message that acknowledges that the exception happened. The client is not able to send messages since the bean instance is in the "Does not exist" state. The client looses the JMS connection. The client does not notice anything; the EJB container passes messages from the JMS server to a different bean instance.
Submit
Java - EJB 2.0, Question 34 of 40 Which one of the following enterprise bean types does NOT use create() methods that have one or more parameters?
CMP entity bean Stateless session bean Stateful session bean BMP entity bean Entity bean using container managed transactions
49
Submit
Java - EJB 2.0, Question 35 of 40 Which one of the following enterprise bean types does NOT use create() methods that have one or more parameters?
CMP entity bean Stateless session bean Stateful session bean BMP entity bean Entity bean using container managed transactions
49
Submit
Java - EJB 2.0, Question 35 of 40 This is a method of the javax.ejb.EJBObject interface: getEJBHome() Referring to the text above, what does the "getEJBHome()" method do? It obtains the local interface.
Text
Choice 1
Submit
Sample Code Which one of the following exceptions must the method doSomething() declare that it does throw in the code shown above? javax.ejb.FinderException
Choice 1
javax.ejb.CreateException
Choice 2
java.rmi.ServerException
Choice 3
java.lang.InterruptedException
Choice 4
java.rmi.RemoteException
Choice 5
Submit
Java - EJB 2.0, Question 38 of 40 Which method associates a session bean instance with information above its runtime context?
public void ejbCreate(Runtime rtm) public void setSessionContext(SessionContext ctx) public void ejbCreate() public void setEnvironment(Environment env) public void setRuntime(Runtime rtm)
136
Submit
Sample Code Referring to the sample code above, when client code calls the method "create(testString)" on a stateful session bean home interface, which one of the following methods does the EJB container call on the stateful session bean class? create(testString)
Choice 1
ejbActivate()
Choice 2
create()
Choice 3
ejbCreate()
Choice 4
ejbCreate(testStri
Choice 5
Submit
Sample Code
Which one of the following statements is true with respect to the deployment descriptor sample above? The bean may hold conversational state on behalf of the client application that uses it. The Bean Provider must handle transaction management in code by using the javax.transaction.UserTransaction interface. The bean has local home and local interfaces as well as remote home and remote interfaces.
Choice 4 Choice 5
The bean is required to have member variables to monitor transactional state during transactions. The container will start a new transaction if the bean is not called within the scope of a transaction.
Submit
Java - EJB 2.0, Question 1 of 40 Requirements call for the use of an existing legacy database for an EJB deployment. The EJB container does not provide the developer with tools for mapping the legacy database to fields in enterprise bean business objects. Which one of the following enterprise bean types is most applicable for use in the above scenario? CMP entity bean Stateful session bean
Scenario
Choice 1 Choice 2
Message-driven bean
Choice 4
Submit
Java - EJB 2.0, Question 2 of 40 What are the typical contents of an ejb-client JAR file?
All the class files needed for the client to use an enterprise bean An XML file containing details of the enterprise beans used by the client An identical copy of the ejb-jar file on the server The EJBObject and EJBHome object class files as implemented by the container The Java source code files for the enterprise beans the client uses
25
Submit
Java - EJB 2.0, Question 4 of 40 Which transaction isolation level allows transactions but also allows dirty reads, phantom, reads, and repeatable reads?
Submit
Java - EJB 2.0, Question 5 of 40 In which one of the following types of bean is persistence management delegated to the EJB container?
Choice 1 Choice 2
Submit
Sample Code
Given the above session bean code sample, which one of the following transaction types do you use for deployment? Bean-managed
Choice 1
Supports
Choice 2
RequiresNew
Choice 3
Required
Choice 4
Mandatory
Choice 5
Submit
Java - EJB 2.0, Question 9 of 40 A client of an enterprise bean wishes to execute a use case in a single business method but does not want to be held up waiting for a response from the enterprise bean before continuing. This would, for example, allow a Web page to state to a user: "We have received your request, which we are currently processing." Which one of the following design patterns is suitable for the scenario above? Data Access Object Business Interface
Scenario
Choice 1 Choice 2
Value Object
Choice 3
Service Locator
Choice 4
Message Facade
Choice 5
Submit
Sample Code
Referring to the sample code above, which one of the following database schemas describes a valid and most logical way to map CompanyBean and EmployeeBean to a relational database using the database tables "Company" and "Employee"?
Choice 1
Choice 2
Choice 3
Choice 4
Choice 5
Submit
Image
Referring to the diagram above describing CMP entity bean relationships, which one of the following lines of code produces the effects of the "Before" and "After" relationships between Company and Employee entity beans? Collection employeesA = companyA.getEmployees();
Choice 1
Sample Code
Referring to the deployment descriptor fragment above, which one of the following specifies that the Company bean does NOT
<cmr-field-no-duplicates/>
Choice 2
<cmr-field-type>java.util.Map</cmr-field-type>
Choice 3
<cmr-field-no-dups/>
Choice 4 Choice 5
<cmr-field-type>java.util.Collection</cmr-fieldtype>
Submit
Java - EJB 2.0, Question 15 of 40 In the EJB 2.0 spec, which one of the following protocols must the EJB container support when a standalone client accesses an EJB remote home object?
CORBA over any protocol The container provider decides. RMI over IIOP RMI over JRMP CORBA over IIOP
207
Submit
Java - EJB 2.0, Question 18 of 40 This is a method of the javax.ejb.EJBHome interface: remove(java.lang.Object primaryKey) Referring to the text above, what does the "remove()" method do? It removes a stateless session bean.
Text
Choice 1
Submit
Java - EJB 2.0, Question 21 of 40 Which EJB deployment descriptor element is typically defined by the Application Assembler?
Submit
Java - EJB 2.0, Question 23 of 40 A single Java class is used to encapsulate the business data of an
Scenario
entity bean. This allows the business data to be returned to a remote client using only one method call. Which one of the following design patterns achieves the requirements described in the scenario above? Model-View-Controller
Choice 1
Value Object
Choice 2
Session Facade
Choice 4
Business Delegate
Choice 5
Submit
Java - EJB 2.0, Question 26 of 40 Which one of the following is an important performance benefit of using the Session Facade design pattern with remote clients? It allows the remote clients to directly access the entity bean local interfaces, which are faster than remote interfaces. It allows the remote client to cache entity bean remote references more efficiently. It ensures that expensive network calls to perform business methods are minimized. It allows the remote client to make direct fine-grained access calls to the entity bean. It enables asynchronous operations that do not block application workflow.
Submit
44
Java - EJB 2.0, Question 29 of 40 Which type of EJB holds NO conversational state and is anonymous to the client?
Message-driven bean Stateful session bean Container-managed persistence entity bean Standard JavaBean Bean-managed persistence entity bean
217
Submit
Java - EJB 2.0, Question 31 of 40 Message-queuing is well-suited for which one of the following?
Asynchronous method calls Streaming media Authentication Real-time processing Serialized method calls
205
Submit
Java - EJB 2.0, Question 33 of 40 In order for a BMP entity bean's ejbRemove() method to identify
which data instance to delete from the database, which one of the following items of code must it contain? A call to prepareStatement() to obtain a PreparedStatement from a database connection A call the getConnection() which obtains a database connection from a DataSource A call to ejbLoad() to reload the data from the database before deletion A call to getPrimaryKey() that retrieves the bean's primary key from the bean's entity context A call to ejbActivate() to ensure that the bean instance is active before deletion
66
Submit
Java - EJB 2.0, Question 35 of 40 With respect to CMP entity beans in an EJB 2.0 container, how does the bean provider implement "lazy-loading"? The ejb-jar deployment descriptor element <lazy-loading/> must be declared for the entity bean. Check against the bean's instance variables for null references. Also, only load the data in code when the data is needed, ensuring "lazy-loading." Lazy-loading is a side-effect of declaring only "setter methods" and not declaring "getter methods." It is only necessary to call the method "setLazyLoading(true)" with a Boolean value of "true" on the entity context. The bean provider may not implement lazy-loading because the EJB container manages persistence and therefore implements any lazy-loading strategy.
Choice 1 Choice 2
Submit
86
Sample Code Given the flawed method signature above, which one of the following statements correctly identifies the error? The finder method cannot have a String argument for the primary key. The method is named incorrectly. The method throws incorrect exceptions.
Choice 3
Choice 1 Choice 2
Submit
Java - EJB 2.0, Question 37 of 40 Which one of the following is a method of javax.ejb.EJBContext that returns an object that identifies the caller of an enterprise bean method?
Choice 5
getCallerPrincipal()
121
Submit
Java - EJB 2.0, Question 39 of 40 In the javax.ejb.SessionBean interface, there is a method called ejbActivate(). The javax.ejb.SessionBean interface is used by both stateless and stateful session beans. Referring to the text above, which one of the following describes what the ejbActivate() method can do on a stateless session bean? It does nothing, and the method is never called. It restores passivated conversational state during activation.
Text
Choice 1 Choice 2
Submit