1. WORA stands for _________________. [0.5] a) Write Once Read Always c) Work Once Run Afterwards.
Trang 1Programming Business Logic using EJB
1. WORA stands for _ [0.5]
a) Write Once Read Always c) Work Once Run Afterwards.
b) Write Once Run Anywhere d) Wrong Out Read Again.
2. Which of the following is not an advantage of the multi-tier application model
[1.0]
a) Providing user interaction,
using client-side applications c) Platform independence
b) Programming business logic d) Relying on backend services
3. Which of the following statements is not true regarding EJB [1.5]
a) It is container dependent c) It collects all the common
elements present during the development of server-side processes and applications
5. A in EJB is an object that is deployed on
any EJB server
[0.5]
Trang 26. Which of the following statements is false with respect to a distributed application.
[1.5]
a) Processing is distributed
across multiple networked
computers
c) It allows for a more
accessible business system
b) It is based on a two-tier
application development d) The user interface is on one network while the business
rules and database is on another network
7. _ is not a model for developing distributed applications
9. Which of the following statements does not describe a component [2.0]
a) It is an object d) It can be described as a
chunk of logic
b) Performs a set of functions e) It has an independent
existence of its own.
c) Can consist of one or more
classes
Trang 310 Server side component architecture manages the components during
[1.0]
11 Which of the following lines pertaining to local objects are true [2.0]
a) They are created in a totally
a) Client side component
architecture c) Server-side component architecture.
13 The J2EE platform does not contain middleware services [0.5]
14 Match the following:
1 EJB a) It acts as a relational database
2 JDBC b) It allows asynchronous communication
3 JTA c) It is a component technology
4 JMS d) It is used for reliable transaction support
[2.5]
a) 1 – a, 2 – b, 3 – c, 4 – d c) 1 – d, 2 – b, 3 – a, 4 – c
b) 1 – c, 2 – a, 3 – d, 4 – b d) 1 – d, 2 – c, 3 – b, 4 – a
Trang 415 Multiple connections from the client are taken care of by the
[0.5]
a) Remote reference layer c) Skeleton layer
16 The is an implementation of CORBA [1.0]
a) Enterprise Java Beans c) Java Transaction API
b) Java Messaging Service d) Java IDL
17 Socket communication is ideal for exchanging files or small amounts of
19 The supports communication
a) remote reference layer c) transport layer
20 Method calls by the client, to the remote object leads to an invocation
of a method on the _which in turn passes control to the _ layer
[1.5]
a) transport layer/top c) remote reference
layer/lowermost
Trang 5b) stub/underlying d) transport layer/next
21 Providing a user-defined interface can change the implementation of
22 A _ must be acquired to the remote object, before a
client can invoke a method on that object
[1.0]
23 Arrange the Events given below in the correct sequence.
1) The skeleton contacts the remote registry
2) The object method is called
3) Invocation of the stub
4) Result is passed to the client object
Forwarding the request the reference layer
a) remote reference layer c) skeleton layer
Trang 626 At present, is used by RMI to communicate between
the transport layer and the _ transport layer
[1.5]
a) IPX/PX, client, user c) Remote access, remote,
network
b) NetBEUI, proxy, host d) TCP/IP, client, server
27 The remote registry is stored on the client [0.5]
28 Which of the following classes belong to the java.rmi package [1.0]
29 The _ does not have any methods [1.0]
a) MarshalledObject d) Remote Interface
c) RegistryHandler
30 Arrange the order in which a remote object will be created and
registered
1.Create the stub and skeleton classes
2.Create the Remote interface
3.Create and register the Remote object
4.Create a class that implements the Remote interface
5.Copy the Remote interface and stub file to the client
[2.0]
Trang 7a) 1 – 2 – 3 – 4 – 5 c) 5 – 1 – 3 – 4 – 2
b) 3 – 2 – 1 – 5 – 4 d) 2 – 4 – 1 – 5 – 3
31 The interfaces and classes of the package are
used to handle and register remote objects by name [1.0]
a) java.rmi.server package c) java.rmi.package
b) java.rmi.registry package d) java.rmi.activation package
32 Remote objects are always referenced through an interface [0.5]
33 The client object can call all the methods of the remote object Do you
agree with this statement?
35 The statements given below define the implementation of the Remote
Interface Which of these is not true
[2.0]
a) Classes that implement the
remote interface generally
extend the
‘UnicastRemoteObject’ class
c) The implementation class
also implements all the methods present in the remote interface
b) The implementation class
does not require a
constructor.
d) The implementation class
has a main() function
Trang 836 How many errors are there in the following code snippet.
37 Which of the following lines of code will be required to register the class ‘Myex’, where
the name of the host machine is stored in ‘hostName’ and the name used by the client to
call the remote object is ‘myobj’
38 The _ compiler is used to register the class that
implements the remote interface, with the remote registry
[1.0]
39 When the compiler is executed for the ‘Myex.class’ program, then the
following files are generated (Choose the correct answer/s) [1.5]
Trang 940 The command required to start the RMI registry is
[1.5]
a) start rmiregistry c) execute rmiregistry
41 For listening to incoming requests the RMI registry uses port
a) Multi-tier applications c) Components.
b) Application servers d) Middleware.
44 The meets the low-level run time
execution environment required by EJB applications [1.0]
a) Container provider c) Server provider
45 Match the following.
1.Bean provider a) It takes prewritten components and deploys them
2.Application assembler b) It provides reusable components
3.Deployer c) It is similar to the container provider
[2.5]
Trang 104.Server provider d) It is used for putting the components together
a) 1 – a, 2 – b, 3 – c, 4 – d c) 1 – d, 2 – c, 3 – b, 4 – a
b) 1 – b, 2 – d, 3 – a, 4 – c d) 1 – c, 2 – a, 3 – d, 4 – b
46 The EJB _ consists of the EJB , which in
turn contains the EJB _
49 Interaction with the bean by the client is done using the
_ interface and the _ interface [1.0]
50 The _ acts as a buffer between the bean and
the outside world
[1.0]
Trang 11a) Component c) Container
51 Which of the following statement is false with respect to the EJB
b) It provides services to the
53 Which of the specifications is not available in EJB1.1? [2.5]
a) Session Beans c) Java Messaging Service
(MDB)
54 The Life cycle of EJB is defined by [2.5]
a) Remote Interface c) Implemented by User
b) Home Interface d) None of the above
55 Match the following directory services (2.5) [2.5]
Trang 1257 Marshalling is the process that converts arguments and return values
into _ that can be sent over the network
[2.5]
b) bits of information d) bits and bytes.
58 Stub file resides on the server State whether the statement is true or
59 Depending on the environment, the deployer adapts the
_, _ and _ to that environment
[1.5]
a) beans/server/container c) server/component/database
interface/middleware/hardware
Trang 13b) object d) server
61 Which of the following is not an example of EJB server/container [1.0]
b) Jakarta Tomcat’s Jboss e) Oracle’s Oracle Application
Server
c) SQL server
62 Assembling of the deployable server side components, at the
customers end is done by the
[1.0]
a) application assembler c) client
63 Which of the following is not a function of the application server [1.5]
a) Mapping components which
are different from each other
c) Providing a user interface
b) Providing an environment in
which the enterprise bean
can run
d) Making sure that the
component is like a given entity
64 The EJB deployer is unaware of the operational environments [0.5]
65 Match the following.
1.Consistency a) changes stored permanently
2.Isolation b) changes are not saved
3.Atomicity c) prevents viewing till transaction is
committed
[2.0]
Trang 144.Durability d) one logical unit
a) 1 – b, 2 – c, 3 – d, 4 – a c) 1 – a, 2 – b, 3 – d, 4 – c
b) 1 – d, 2 – c, 3 – a, 4 – b d) 1 – c, 2 – a, 3 – b, 4 – d
66 As of now, the terms container and EJB server in EJB can be used
inter-changeably Do you agree with this statement?
[1.5]
67 Adaptation of the access level of beans to fit into a particular system is
done by the system administrator
[1.0]
68 The management tools used by the EJB server and container are
controlled by the _ 1.0
69 Identify the services that the container or the server fails to provide [2.0]
a) Security support c) Persistence support
b) Writing of code d) Management of multiple
instances
70 The properties that characterize transactions are known as ACID
71 The _ notification at given at the start of the
transaction, signals the start of the transaction [1.0]
Trang 1574 The person deploying the bean specifies the for
that bean for better
77 For efficient management of multiple instances, the server performs a
variety of tasks Which of the tasks mentioned below, is not one of [2.0]
Trang 16a) Instance passivation c) Message pooling
pooling
a) Remote Interface c) Implemented by User
b) Home Interface d) None of the above
79 The specifications set by EJB need not match with those of the
component interface
[0.5]
80 When the client calls a bean, it can in turn call another bean Do you
agree with this statement?
Trang 1782 A session bean being used by a client can also be used by another
client
[0.5]
83 The instantiation of a session bean is done by the
while the management of the lifetime of the bean is done by the _
[1.5]
a) EJB server/container c) Component/client
b) Container/EJB server d) Client/component
84 Once the client ceases to exist, the session bean is also destroyed
State True or False
[0.5]
85 Suppose in a garment shop, a request is made for all the colors
available in a particular garment along with the all the sizes and their respective prices, then which session bean will be used to handle such processes?
[1.5]
a) Stateful session bean b) Stateless session bean
86 Stateless session beans are also known as
_
[1.0]
a) Stateful session beans c) Anonymous method
providers
87 Measuring in terms of throughput and resource consumption,
beans provide the highest performance
[2.0]
a) Stateless session beans c) Entity beans
b) Stateful session beans
Trang 1888 When multiple clients try to access the same bean, then the developer
needs to take care of instantiating an equal number of components for servicing the multiple clients
[1.5]
a) Stateful session beans c) CMP
b) State less session beans d) BMP
90 In J2EE Design Business process is represented as
and Business data is represented as
91 Which of the following statement does not represent an entity bean [1.5]
a) They are shared by multiple
clients c) An entire chunk of data can be read once into an entity
Trang 1993 If a is being used then all the operations need to be
written by the developer to a persistent API
[0.5]
a) Bean-Managed persistent
entity bean.
b) Container-Managed
persistent entity bean
94 _ beans have a higher level of reuse [1.0]
a) Session beans c) Stateful session beans
a) The instantiation, destroying
and reuse of a bean by the
EJB container
b) If the bean is not required after use, then the container destroys it
b) If a requested bean has to be
created, then the container
does the instantiation
d) All of the above.
96 A is a group of operations, which appear as one large
97 At the time of creation, beans are written as
components, while during deployment they are _ components
[1.0]
a) Distributed/individual c) Networked/single
b) Separate/distributed d) Whole/networked.
Trang 2098 The bean class is different from a Java class [0.5]
99 The implementation of a session bean is the same as an entity bean
Do you agree with this statement? Select the correct reason to support your answer
[1.5]
a) Yes – because both are types
of enterprise javabeans
c) Yes – because the
implementation details of the components are present in the bean class
b) No – because entity beans
relate to persistent objects,
whereas session beans
contain business-process
related logic.
100 The bean class has to portray a set of methods specific to beans,
when the as per the EJB specification are implemented
a) The bean class is confirmed c) None of the above
b) The enterprise beans can
share all the properties of the
serializable objects
d) Both a and b
102 What takes place when a client invokes a method on a bean? [1.5]
a) The bean is directly invoked c) The EJB container delegates
Trang 21the client request to the bean instance.
b) The EJB container intercepts
the call by the client
d) The EJB container delegates
the client request to the bean instance
103 Which of the following is not a management function performed by an
a) Container logic c) Bean instance logic
b) Security logic d) Transaction logic
104 Which of the following statements is not true regarding an EJB object [2.0]
a) The EJB container manifests
itself as a single
network-aware object
c) This is the original object aware of networking, transactions and security.
b) The network-aware object is
also called the EJB object
d) This object performs the
intermediate logic necessary for the EJB container to service the method calls
105 The interface, which duplicates the methods exposed by the bean
class, is called the _
[1.0]
a) Remote interface c) External interface
b) Home interface d) Internal interface
106 Which of the following functions does the remote interface perform? [1.5]
Trang 22107 All the remote interface types extend the
109 The _ method is used to delete an entity
bean from the persistent store
111 The client is unaware of the physical location of a remote object in
EJB Do you agree with this statement?
Trang 23a) Home Object c) Container
113 Only entity beans can be destroyed by passing the
_
[1.0]
a) EJBMetadata object c) Secondary key
114 Which of the following is not the responsibility of the EJB home object [1.5]
a) Make a copy of every
method exposed by the
bean class.
c) Instantiate an EJB object.
b) Remove the EJB objects d) Search for an existing EJB
object
115 The deployment descriptor is essentially a file [0.5]
116 Choose the correct answer/s from below.
The deployment descriptor contains essential information regarding _
[2.0]
a) Remote interface d) Home interface
c) Classes that form the bean
117 Can a blank method be added in Home interface as per EJB 1.1 [1.0]
Trang 24119 Deployment descriptors provide persistence requirement, wherein the
EJB container is informed whether a session bean can take care of persistence on its own, or whether it should delegate the persistence
to the container Do you agree with this statement?
[2.0]
120 Generation of the EJB object, and the home objects, and tuning the
bean, are functions that have to be performed by the _
a) Entity bean/session bean b) Session bean/entity bean
122 Session beans are able to survive machine crashes Do you agree
with this statement? Give reasons for your answer
[1.0]
a) Yes – because they are
enduring objects c) Yes – because they can be constructed in memory from
the data in the database
Trang 25b) No – because they die along
with the surrounding
environment.
d) No – because they represent
business logic
a) Container calling methods of
bean
c) Methods representing business logic
b) Non-enduring methods d) Methods representing
business data
124 _ session beans are more functional,
as they can retain their conversational state
128 Deployment descriptors are that describe the bean
and some of its runtime behavior to the container
[2.5]
Trang 26a) jar files c) serialized classes
132 The _ is a gateway for the bean to interact
with the container
133 The container may not call the ejbRemove() method Why? [1.5]
a) Because the life of the bean
has expired
c) Because the bean is an
entity session bean
b) Because the bean is a
stateless session bean
d) Because of a container crash.
Trang 27134 Study the code given below The method simpleint() given below is
[2.0]
a) ejbCreate() method c) ejbPassivate() method
b) business method d) ejbActivate method
135 Binding is an association of a _ with a/an
136 Which of the following is not a step involved in JNDI? [2.0]
a) Specify initial context factory c) Acquire Initial context
b) Information for Service
provider to start up d) Connecting the bean with the container
a) Stateful session beans c) CMP
b) State less session beans d) BMP
Trang 28138 The major advantage of bean pooling is that there is maximum
utilization of time and resources
[0.5]
140 Point out the error in the following code, assuming that a remote
interface ‘myeg’ has already been created
b) Error in line 3 – the package
javax.ejb EJBHome needs to
be extended
d) Error in line 5 – two
exceptions cannot be thrown together
141 While defining the bean class, are the following statements valid:
………
………
public void ejbActivate(){}
public void ejbPassivate(){}
public void ejbRemove(){}
………
[2.5]
a) Yes – they are valid b) No – they will generate an
error
142 Which of the following methods of stateless session beans never have
their callback methods invoked [2.5]
Trang 29144 The process of swapping out a bean and saving the conversational
state to a storage device is known as _
[1.0]
145 At any point of time _ instance/s of stateful
sessions beans are/is allowed in the container when there are clients making requests
a) Last remote user c) Last recently used
b) Least recently used d) Least resource utilized
Trang 30148 Once the server has been started, the client code can be executed
from the same window
[1.0]
149 Arrange the activation process in the proper sequence.
1) Serialize the bean state
2) Conversational state is read back into memory
3) The ejbActivate() method restores the resources of the bean
Container reconstructs the memory state
a) Nothing important, these lines
just have to be compulsorily
given
c) Indicates the way to locate
the client, which is 1099
b) Indicates the way to locate
the server, which is 1099 d) Mentions how the bean will interact with the container
151 What do the following lines of code indicate? (2)
a) Stateless session bean class
has been created
c) The above method will begin a conversation with
Trang 31the client in a stateful session bean.
b) Simply, a variable myvar has
been declared
d) None of the above.
152 Point out the error/s in the following code for the creation of the
b) Error in line 1 and 5 d) Error in line 3
153 Assume that the files Myeg, Myeghome and Myegbean representing
the remote interface, home interface and the bean class
respectively, have been created in the myeg directory What will
the following command do:
jar cvf myeg.jar Myeg.class Myeghome.class Myegbean.class
[2.5]
a) Create a myeg.jar file in the
META-INF directory c) Will give an error
b) Create a myeg.jar file in the
current directory
d) None of the above.
154 Assume that the files Myeg, Myeghome and Myegbean representing
the remote interface, home interface and the bean class
respectively, have been created in the myeg directory What will
the following command do and will this jar file work with the client
code?
jar cvf myeg.jar Myeg.* Myeghome.* Myegbean.* META-INF
[2.5]
Trang 32a) It will create a myeg.jar file
and will include all the java
files also Yes, it will work
with the client code.
c) It will create a myeg.jar file
and will include only the class files and it will work with the client code
b) It will create a myeg.jar file
and will include only the class
files but it will not work with the
client code
d) It will generate an error.
155 Assume that the files Myeg, Myeghome and Myegbean representing
the remote interface, home interface and the bean class
respectively, have been created in the myeg directory Will the
following command work with the client code Give reasons for
your answer
jar cvf myeg.jar Myeg.class Myeghome.class Myegbean.class
[2.5]
a) Yes it will work normally with
the client code
c) No it will not work with the client code, as the files in the META-INF directory are not included.
b) No it will not work with the
client code, as the jar file
needs to be created in the
META-INF directory
d) None of the above.
156 To run the client, the server [1.5]
a) Needs to be started before
we run the client c) Need not be started.
b) Needs to be started after we
run the client
d) None of the above.
157 In order to start the server, we need to give the
_ command at the command prompt
[1.0]
Trang 33158 The passivation process is the opposite of the activation process [0.5]
159 If invocation/s is/are required, then
stateful session beans need to be used, whereas for _ method call/s the stateless session bean has to be used
a) There are a lot of input/output
bottlenecks c) Client-specific data needs to be given
b) Increased congestion in the
network
d) Pooling is simple.
161 There is an increased chance of losing conversations while using
stateless session beans
163 The conversation with the client _ be lost, due
to caching of client conversation, while using stateful session beans
[1.0]
Trang 34b) will always d) none of the above
164 What are the don’ts while using stateful session beans? [1.5]
conversation long.
c) Try to use EJB products that
persists stateful conversations
b) Always write the client code
that takes into account bean
failures
d) None of the above
165 The rules for the conversational state are put forward by
[2.0]
b) Java object serialization d) The client
166 The _ method is used to read the
conversational state back into the memory
[1.5]
167 Which of the following files is not included in the jar file [1.5]
b) remote interface d) client code
168 To be able to execute the bean, the jar file needs to be copied to the
directory of the server
[1.0]
Trang 35169 Stateful session beans tend to be specific to one scenario Do you
agree with this statement?
[2.0]
170 Stateful session beans are dedicated to _ client/s and
have a preset period
[2.5]
171 Stateless session beans are dedicated to one client [2.0]
172 A client is able to maintain a connection to a stateless session bean’s
_, but the _ itself is free to service requests from anywhere
[2.5]
a) container/server c) server/component
b) component/container d) EJB object/bean
173 Since the stateless session bean does not contain any
_ information, there is _ between one client and the next
[2.5]
a) State/no difference c) Bean/always a similarity
b) Conversational/difference d) None of the above.
174 Stateless session beans often perform services that are fairly generic
in nature and are reusable Do you agree with this statement
[2.0]
Trang 36175 Entity beans are called _ objects [0.5]
176 To be able to deploy entity beans, the EJB container has to be
compliant with Enterprise JavaBeans version 1.0 [1.0]
c) The state of an entity bean is
permanently stored in the database
b) Persistence is expected to
operate with transactional
integrity
d) Entity beans are durable
178 In EJB, persistence can also be termed as [1.0]
a) Object serialization c) EJB object
179 Which is not a way of making an object persistent [1.5]
a) Object Database Management
Trang 37180 The capturing of Java Objects in their current state for permanent
storage is known as
[1.0]
a) Object capturing c) Object Serialization.
b) Object Database Management
182 Which of the following statements is not part of the Java object
a) It consists of a simple method
to marshall an object graph
into a compact representation
c) This enables the developer
to pull the data over a network.
b) The serialization of a graph
converts it into a byte stream
d) The data may be saved as a
stream to a storage
183 In _ databases, each Java object is
decomposed into its constituent part, which is stored separately
Trang 38185 Either or _ can be used to map
the object data to the relational database, while saving the objects
[1.0]
186 Arrange the sequence in which the object is read back from a
relational database
1.The object is instantiated from the Java class
2.The data is read from the database
3.The field of the Java class instance is populated with the data
b) Java serialization d) Object-relational
189 Sun’s JavaBlend and Object People’s TOP link are examples of a/an
Trang 39190 Programming to a relational database is required in object database
management
[0.5]
a) Other Query Language c) On Question loop
b) Object Query Language d) Oriented Question language
192 Which line does not describe the object database management
system
[1.5]
a) The OQL adds a layer of
abstraction from the relational
database queries
c) Object oriented databases
give better mapping between the entity bean and the database
b) A decomposed part of the
object forms a row in the
relational database
d) Serializable objects can be
stored in the object-oriented database
193 Systems based on mainframe and non-relational database
applications are
[1.0]
a) Persistence systems c) Java object serialization
b) Object database management
194 CMP’s are preferred to BMP’s in legacy systems [0.5]
195 The calculation of the salary of an employee will be handled by the
component
[1.5]
Trang 40a) Application logic
component
c) None of the above
b) Persistent data component
196 The employee details, i.e., the name, designation, H.R.A, D.A., etc
will be managed by the _ component
[1.5]
a) Application logic component c) None of the above
b) Persistent data component
197 Which of the statements given below does not answer the following
question
Why is data treated as an object?
[1.5]
a) It is simple to treat data as an
object c) Middleware services can be gained
b) Related data can be grouped d) None of the above.
198 Choose the correct answer/s from below.
Entity beans are persistent by themselves, because they
include:-[2.0]
processes
c) Object database persistence
199 Which of the following statements is false regarding entity beans [1.5]
a) Entity beans may last for years c) The entity bean instance is
an instance of the entity bean class
b) Entity beans can survive a
JVM crash
d) None of the above.