Programming Business Logic using EJB
1.
2.
3.
4.
WORA stands for _________________.
a) Write Once Read Always
c) Work Once Run Afterwards.
b) Write Once Run Anywhere
d) Wrong Out Read Again.
Which of the following is not an advantage of the multi-tier application
model.
a) Providing user interaction,
using client-side applications.
c) Platform independence
b) Programming business logic
d) Relying on backend services
Which of the following statements is not true regarding EJB.
a) It is container dependent.
c) It collects all the common
elements present during the
development of server-side
processes and applications.
b) It is server-side component
architecture.
d) Transaction oriented
components are written in
Java.
The client side is more complex than the server side
a) True
5.
[0.5]
[1.0]
[1.5]
[0.5]
b) False
A ______________________ in EJB is an object that is deployed on
any EJB server.
a)
Component
c) Chunk
b)
Container
d) Logic
[0.5]
6.
7.
8.
9.
Which of the following statements is false with respect to a distributed
application.
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
[1.5]
___________________ is not a model for developing distributed [1.0]
applications.
a) DCOM
c) RMI
b) COM
d) CORBA
Generally, ________________________ objects do not implement any [0.5]
interfaces.
a) remote
c) public
b) distributed
d) local
Which of the following statements does not describe a component.
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.
[2.0]
10.
11.
12.
13.
Server side component architecture manages the components during
____________.
a) Compilation
c) logic building
b) Development
d) run time
Which of the following lines pertaining to local objects are true.
a)
They are created in a totally c) References are obtained
different JVM.
directly.
b)
They are
interfaces.
[2.0]
using d) They always implement a
remote interface.
______________________________________ enhances reusability [1.0]
and portability.
a)
Client side component
architecture.
c) Server-side component
architecture.
b)
JVM
d) Remote objects.
The J2EE platform does not contain middleware services.
a)
14.
accessed
[1.0]
True
b) False
Match the following:
1. EJB
2. JDBC
3. JTA
4. JMS
[0.5]
[2.5]
a) It acts as a relational database
b) It allows asynchronous communication
c) It is a component technology
d) It is used for reliable transaction support
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
15.
16.
17.
Multiple connections from the client are taken care of by the [0.5]
__________________.
a) Remote reference layer
c) Skeleton layer
b) Stub layer
d) Transport layer
The ______________ is an implementation of CORBA.
a) Enterprise Java Beans
c) Java Transaction API
b) Java Messaging Service
d) Java IDL
Socket communication is ideal for exchanging files or small amounts of
data.
a) True
18.
19.
20.
b)
[1.0]
[0.5]
False
The RMI defines the difference between _______________ and [1.0]
_______________ objects.
a) public/global
c) remote/local
b) distributed/concentrated
d) random/definite
The ______________________________ supports communication [1.5]
between the stub and skeleton.
a) remote reference layer
c) transport layer
b) stub layer
d) Architecture
Method calls by the client, to the remote object leads to an invocation [1.5]
of a method on the _________which in turn passes control to the
_________________ layer.
a) transport layer/top
c) remote reference
layer/lowermost
b) stub/underlying
21.
d) transport layer/next
Providing a user-defined interface can change the implementation of [2.0]
the transport layer.
a) True
22.
23.
24.
25.
b) False
A _____________ must be acquired to the remote object, before a
client can invoke a method on that object.
a) tag
c) connection
b) reference
d) loop
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) 2 – 5 – 3 – 4 – 1
c) 3 – 5 – 1 – 2 – 4
b) 1 – 2 – 3 – 4 – 5
d) 4 – 1 – 5 – 2 – 3
All distributed systems
___________________.
consist
of
_________________
a) remote objects/random objects
c) stubs/skeletons
b) transport layers/reference
layers
d) JTA/JMS
[1.0]
[2.5]
and [1.0]
The _______________________ is responsible for unicast point-to- [0.5]
point invocation.
a) remote reference layer
c) skeleton layer
b) stub layer
d) transport layer
26.
27.
At present, ____________ is used by RMI to communicate between [1.5]
the ____________ transport layer and the _________________
transport layer.
a) IPX/PX, client, user
c) Remote access, remote,
network
b) NetBEUI, proxy, host
d) TCP/IP, client, server
The remote registry is stored on the client.
a) True
28.
29.
[0.5]
b) False
Which of the following classes belong to the java.rmi package.
a) MarshalledObject
c) Naming
b) RegistryHandler
d) Skeleton
The ___________________ does not have any methods.
a) MarshalledObject
d) Remote Interface
b) RMISecurityManager
e) Naming
[1.0]
[1.0]
c) RegistryHandler
30.
Arrange the order in which a remote object will be created and [2.0]
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.
31.
32.
a) 1 – 2 – 3 – 4 – 5
c) 5 – 1 – 3 – 4 – 2
b) 3 – 2 – 1 – 5 – 4
d) 2 – 4 – 1 – 5 – 3
The interfaces and classes of the __________________ package are [1.0]
used to handle and register remote objects by name.
a)
java.rmi.server package
c)
java.rmi.package
b)
java.rmi.registry package
d)
java.rmi.activation package
Remote objects are always referenced through an interface.
a) True
33.
b) False
The client object can call all the methods of the remote object. Do you
agree with this statement?
a) Agree
34.
35.
[0.5]
Every method of the
______________________.
[1.0]
b) Disagree
remote
interface
must
a) getData()
c) getDataNum()
b) RemoteException
d) interface
throw
a [0.5]
The statements given below define the implementation of the Remote
Interface. Which of these is not true.
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.
[2.0]
36.
How many errors are there in the following code snippet.
[2.5]
import java.rmi.;
public interface MyEx extends Remote
{
String getDataNum();
String getData(int a) throws RemoteException
}
a) None
c) Five
b) Four
d) Two
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.
39.
a) Myex instance = new Myex();
Naming.rebind(“//”+hostName+”/myobj”
, instance));
c) Myex = new Myex();
Naming.(“hostName”, instance));
b) DistributedExImpl instance = new
DistributedExImpl();
Naming.rebind(“//”+hostName+”
/DistributedExample”, instance));
d) Myex instance = new Myex;
Naming.rebind(“//”+hostName+”/myobj”,
instance)
The _______________ compiler is used to register the class that
implements the remote interface, with the remote registry.
a)
rmi
c) rmic
b)
class
d) java
When the compiler is executed for the ‘Myex.class’ program, then the
following files are generated. (Choose the correct answer/s).
a) Myex.java
c) Myex.class
b) Myex_Stub.class
d) Myex_Skel.class
[1.0]
[1.5]
[
40.
41.
42.
The command required
____________________
44.
45.
start
the
RMI
registry
a) start rmiregistry
c) execute rmiregistry
b) rmiregistry
d) begin rmiregistry
is [1.5]
For listening to incoming requests the RMI registry uses port [1.0]
___________.
a) 1024
c) 1099
b) 65535
d) 1020
The client is able to directly code the container. Do you agree with this [0.5]
statement?
a) Agree
43.
to
b) Disagree
Connection pooling and security management are examples of
_____________________.
a) Multi-tier applications.
c) Components.
b) Application servers
d) Middleware.
The ______________________ meets the low-level
execution environment required by EJB applications.
a) Container provider
c) Server provider
b) Bean provider
d) Deployer
run
time [1.0]
Match the following.
1.Bean provider
and deploys them
2.Application assembler
3.Deployer
[0.5]
[2.5]
a) It takes prewritten components
b) It provides reusable components
c) It is similar to the container provider
4.Server provider
together
46.
47.
d) It is used for putting the components
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
The EJB ___________ consists of the EJB ____________, which in [1.5]
turn contains the EJB ___________.
a) components/container/server
c) container/server/components
b) server/container/component
s
d) components/server/container
The EJB architecture consists of the following tiers.
a) Client
d) Database
b) Container
e) EJB server
[1.5]
Home interface
48.
49.
50.
The bean accesses the database using ______________.
a) ODBC
c) JDBC
b) MS-SQL
d) server
[0.5]
Interaction with the bean by the client is done using the [1.0]
_____________ interface and the ___________ interface.
a) home/remote
c) user/EJB
b) database/server
d) random/client
The ___________________ acts as a buffer between the bean and [1.0]
the outside world.
51.
52.
a) Component
c) Container
b) EJB server
d) Client
Which of the following statement is false with respect to the EJB
container.
a)
It consists of a representation c) The bean is aware of the
of the bean requested by the
methods used by the
client.
container to implement the
services.
b)
It provides services to the d) It provides support to
bean.
manage and keep track of
beans.
The EJB object and EJB home for a bean are managed by the [0.5]
container.
a)
53.
54.
55.
[2.0]
True
b) False
Which of the specifications is not available in EJB1.1?
[2.5]
a) Session Beans
c) Java Messaging Service
b) Entity Beans
d) Message
(MDB)
Driven
The Life cycle of EJB is defined by__________________.
a) Remote Interface
c) Implemented by User
b) Home Interface
d) None of the above
Match the following directory services
(2.5)
Bean
[2.5]
[2.5]
a) LDAP
b) NDS
c) NIS
56.
57.
58.
1. SUN OS
2. Netscape
3.Novell
a) a-2 ,b-3 ,c-1
b) a-2 ,b-1 ,c-3
b) a-1 ,b-2 ,c-3
d) a-3 ,b-1 ,c-2
In JNDI, binding is an association of a ________________ with a/an [2.5]
_____________.
a) class/library
c) client/server
b) name/object
d) file/directory
Marshalling is the process that converts arguments and return values [2.5]
into ___________________ that can be sent over the network.
a) data
c) stream of bytes
b) bits of information
d) bits and bytes.
Stub file resides on the server. State whether the statement is true or
false.
a) True
59.
b) False
Depending on the environment, the deployer adapts the [1.5]
_________________, _________________ and _______________ to
that environment.
a) beans/server/container
c) server/component/database
interface/middleware/hardwar
e
d)
b) client/object/component
60.
[2.5]
The container along with
___________________.
a) client
all
its
interfaces
c) beans
resides
in
the
[0.5]
b) object
61.
d) server
Which of the following is not an example of EJB server/container.
a) IBM’s Websphere
d) BEA’s Weblogic
b) Jakarta Tomcat’s Jboss
e) Oracle’s Oracle Application
Server
[1.0]
c) SQL server
62.
63.
Assembling of the deployable server side components, at the [1.0]
customers end is done by the ________________.
a) application assembler
c) client
b) client assembler
d) server
Which of the following is not a function of the application server
[1.5]
a) Mapping components which c) Providing a user interface
are different from each other
b) Providing an environment in d) Making
sure
that
the
which the enterprise bean
component is like a given
can run
entity
64.
The EJB deployer is unaware of the operational environments.
a) True
65.
b) False
Match the following.
1.Consistency
2.Isolation
3.Atomicity
committed
[0.5]
[2.0]
a) changes stored permanently
b) changes are not saved
c) prevents viewing till transaction is
4.Durability
66.
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
As of now, the terms container and EJB server in EJB can be used [1.5]
inter-changeably. Do you agree with this statement?
a) Agree
67.
69.
70.
b) False
The management tools used by the EJB server and container are
controlled by the _________________.
a) EJB deployer
c) EJB container
b) EJB server
d) EJB administrator
Identify the services that the container or the server fails to provide
a) Security support
c) Persistence support
b) Writing of code
d) Management
instances.
of
1.0
[2.0]
multiple
The properties that characterize transactions are known as ACID [0.5]
properties.
a) True
71.
b) Disagree
Adaptation of the access level of beans to fit into a particular system is [1.0]
done by the system administrator.
a) True
68.
d) one logical unit
b) False
The _______________ notification at given at the start of the [1.0]
transaction, signals the start of the transaction.
72.
a) Start
c) Initial
b) Begin
d) First
Can a transactional context be propagated from client? Comment.
a) True
73.
[2.0]
b) False
Which transaction attribute cannot be set while deployment
a) TX_NOT_SUPPORTED
d) TX_NOT_REQUIRED
b) TX_SUPPORTS
e) TX_REQUIRES_NEW
[2.5]
c) TX_REQUIRED
74.
75.
The person deploying the bean specifies the ________________ for [1.5]
that bean for better __________________.
a) ACID/transaction
c) State
of
object/consistency
b) Start/durability
d) ACL’s/security
Repeated creation of an object whenever it is required is persistence.
a) True
76.
[1.0]
b) False
Constant storage can be done on a file.
a) True
77.
the
[0.5]
b) False
For efficient management of multiple instances, the server performs a [2.0]
variety of tasks. Which of the tasks mentioned below, is not one of
them.
78.
79.
a) Instance passivation
c) Message pooling
b) Instance pooling
d) Database
pooling.
The Life cycle of EJB is defined by:
c) Implemented by User
b) Home Interface
d) None of the above
The specifications set by EJB need not match with those of the [0.5]
component interface.
b) False
When the client calls a bean, it can in turn call another bean. Do you [1.0]
agree with this statement?
a) Agree
81.
[2.0]
a) Remote Interface
a) True
80.
connection
b) Disagree
What do A and B represent in the diagrammatic representation given
below; (1.5)
[1.5]
A
Session Bean
B
a) A – Stateful Bean, B – c) A – BMP, B – CMP
Stateless Bean
b) A – Entity Bean, B – Enterprise d) A – JavaBean, B
Bean
Enterprise Java Bean
–
82.
A session bean being used by a client can also be used by another [0.5]
client.
a) True
83.
84.
The instantiation of a session bean is done by the [1.5]
____________________ while the management of the lifetime of the
bean is done by the ___________________________.
a) EJB server/container
c) Component/client
b) Container/EJB server
d) Client/component
Once the client ceases to exist, the session bean is also destroyed.
State True or False.
a) Yes
85.
87.
[0.5]
c) No
Suppose in a garment shop, a request is made for all the colors [1.5]
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?
a) Stateful session bean
86.
b) False
b) Stateless session bean
Stateless session beans are also known as
_________________________.
[1.0]
a) Stateful session beans
c)
Anonymous
providers
method
b) Container
d)
Know method providers
Measuring in terms of throughput and resource consumption, [2.0]
____________________ beans provide the highest performance.
a)
Stateless session beans
b)
Stateful session beans
c) Entity beans
88.
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.
a) True
89.
90.
[2.0]
a) Stateful session beans
c) CMP
b) State less session beans
d) BMP
In J2EE Design Business process is
________________ and Business data is
__________________.
b) Stateless
beans
92.
False
Which of the beans cannot be pooled?
a) Session
beans
91.
b)
beans
/
Entity c)
beans/stateful d)
represented
represented
as [2.0]
as
CMP/BMP
Transaction/process
Which of the following statement does not represent an entity bean.
a)
They are shared by multiple c) An entire chunk of data can
clients
be read once into an entity
bean.
b)
They are modeled on real d) It cannot be manipulated.
world objects.
The life of an entity bean is as long as the client session.
a) True
[1.5]
b) False
[1.5]
[0.5]
93.
If a ______________is being used then all the operations need to be
written by the developer to a persistent API.
a)
94.
95.
96.
97.
Bean-Managed
entity bean.
[0.5]
persistent b) Container-Managed
persistent entity bean.
_____________________ beans have a higher level of reuse.
a) Session beans
c)
Stateful session beans
b) Entity beans
d)
Stateless session beans
What is known as instance pooling.
[1.0]
[1.5]
a) The instantiation, destroying b)
and reuse of a bean by the
EJB container.
If the bean is not required
after use, then the container
destroys it.
b) If a requested bean has to be d)
created, then the container
does the instantiation.
All of the above.
A ____________ is a group of operations, which appear as one large [1.0]
operation during execution.
a) Transaction
c)
Task
b) State
d)
Process
At the time of creation, beans are written as ______________ [1.0]
components, while during deployment they are ___________
components.
a)
Distributed/individual
c) Networked/single
b)
Separate/distributed
d) Whole/networked.
98.
The bean class is different from a Java class.
a) True
99.
b)
[0.5]
False
The implementation of a session bean is the same as an entity bean. [1.5]
Do you agree with this statement? Select the correct reason to
support your answer.
a) Yes – because both are types c) Yes
–
because
the
of enterprise javabeans.
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, [1.5]
when the ________________________ as per the EJB specification
are implemented.
a) Components
c) Interfaces
b) Containers
d) Objects
101. The
statement
javax.ejb.Enterprisebean
java.io.Serializable signifies:a) The bean class is confirmed.
extends [1.5]
c) None of the above
b) The enterprise beans can d) Both a and b
share all the properties of the
serializable objects.
102. What takes place when a client invokes a method on a bean?
a) The bean is directly invoked.
c) The EJB container delegates
[1.5]
- Xem thêm -