Home
MCQS
Spring MCQ Quiz Hub
Spring Mcq Set 19
Choose a topic to test your knowledge and improve your Spring skills
1. To create services and have those automatically installed in the registry.
Spring Dynamic Modules
Spring DM Server
Spring Tooling
None of the mentioned
2. Element to export the bean as an OSGi service, classified by the interface we specify.
osgix
osgi:service
all of the mentioned
None of the mentioned
3. These beans are proxies, some may load asynchronously or take a longer time to register. <osgi:service interface="com.apress.springrecipes. osgi.helloworld.service.GreeterService"> <bean class="com.apress.springrecipes.osgi.helloworld. service.GreeterServiceImpl"/> </osgi:service>
True
False
none
all the mentoined
4. An anonymous bean specified inside of the osgi:service element allows you to avoid cluttering the namespace.
True
False
none
all the mentoined
5. The first, most direct connection to OSGi is the bean that’s created on your behalf when you export a service. This bean, an instance of:-
org.osgi.framework.ServiceRegistration
org.osgi.framework.Service
org.osgi.framework.ServiceRegister
None of the mentioned
6. By default, beans created in a Spring application context are global to the entire OSGi runtime.
True
False
none
all the mentoined
7. Sometimes, you may want to limit the visibility of a service so that multiple clients each get their own instance of the bean.
time
scope
attr
None of the mentioned
8. Spring Dynamic Modules also supports injection and manipulation of bundles themselves. An injected bundle is of type:-
org.osgi.framework.savedBundle
org.osgi.framework.Bundle
org.osgi.framework.BundleInstance
None of the mentioned
9. Once acquired, the Bundle can be interrogated to introspect information about the bundle itself, including any entries, its current state.
True
False
none
all the mentoined
10. OSGi will let you maintain multiple versions of a service in your registry at the same time.
True
False
none
all the mentoined
11. Multiple services of the same interface may be registered inside of an OSGi environment, which necessitates a conflict-resolution process.
True
False
none
all the mentoined
12. When specified on a service element, allows the ascription of a rank relative to other beans with the same interface.
Ranking
Service
All of the mentioned
None of the mentioned
13. A more robust solution to service discrimination is service attributes.
True
False
all of the mentioned
None of the mentioned
14. There are frequently situations where OSGi will return more than one instance of a service that satisfies the interface.
True
False
none
all the mentoined
15. Attribute, which, is the symbolic name of another bundle.
Fragment
Fragment-Host
All of the mentioned
none of the mentioned
16. Support for deployment of traditional .war artifacts, enable use of some of the standard Java EE libraries, provide useful defaults for many de facto standard libraries, and provide fully integrated support for Spring Dynamic Modules.
Spring Dynamic Modules
Spring dm Server
Spring Tooling
all of the mentioned
17. OSGi doesn’t solve framework concerns, instead focusing on infrastructure requirements for Java applications.
True
False
all of the mentioned
None of the mentioned
18. Spring Dynamic Modules was, while powerful for those already invested in an OSGi platform, not the most natural accommodations for those trying to migrate large code into the OSGi environment, SpringSource created.
Spring Dynamic Modules
Spring dm Server
Spring Tooling
all of the mentioned
19. SpringSource dm Server many advances focus on delivering a solution, and not just a framework, for delivering:-
Spring Tooling
Spring dm
OSGi
None of the mentioned
20. SpringSource dm Server provides value above and beyond a regular OSGi solution.
True
False
none
None of the mentioned
21. OSGi–enabling all of these interwoven dependencies via the granular use of the Import-Package header would be tedious.
True
False
none
all the mentoined
22. SpringSource dm Server also allows you to bend the rules where necessary.
True
False
none of the mentioned
all the mentoined
23. SpringSource dm Server works with several types of deployment formats:-
bundle
Java EE .war
platform archive
all of the mentioned
24. Application isolation is critical because it allows you to solve the issue of reconciliation of two services whose interfaces collide. You can use:-
.WAR
.XML
.PAR
all of the mentioned
25. SpringSource dm Server provides the robustness needed to commoditize enterprise application development in an OSGi environment.
True
False
all of the mentioned
None of the mentioned
26. To begin with SpringSource dm Server but need a way to rapidly turnaround development.
Spring Dynamic Module
Spring Dynamic Server
SpringSource dm Server
none of the mentioned
27. SpringSource has provided solid tooling for Eclipse, called :-
Spring Dynamic Module
dm Server Tools
SpringSource dm Server
None of the mentioned
28. These tools—part of the broader SpringSource Tool Suite—are available as :-
plug-in
stand-alone environment
all of the mentioned
None of the mentioned
29. Java provides a mechanism, where an object can be represented as a sequence of bytes:-
Serialization
Compilation
All of the mentioned
None of the mentioned
30. After a serialized object has been written into a file, it can be read from the file and deserialized.
True
False
none
all the mentoined
31. Serialization is JVM independent.
True
False
none
all the mentoined
32. The ObjectOutputStream class contains methods for writing various data types.
public final void writeObject(Object x)
public final void write(Object x)
public final void writeToObject(Object x)
all of the mentioned
33. The ObjectInputStream class contains methods for writing various data types.
public final Object readObject()
public final Object read(Object x)
public final Object readFromObject(Object x)
all of the mentioned
34. For a class to be serialized successfully:
The class must implement the java.io.Serializable interface.
Every field in the class must be volatile.
All of the mentioned
None of the mentioned
35. When serializing an object to a file, the standard convention in Java is to give the file a:
.war
.java
.ser
None of the mentioned
36. What will be the value of transient field after deserialization:-
0
NULL
All of the mentioned
None of the mentioned
37. If the class implements java.io.Serializable, then it is serializable; otherwise, it’s not.
True
False
none
all the mentoined
38. To send an email using your Java Application:-
JavaMail API
Java Activation Framework (JAF)
All of the mentioned
none of the mentioned
39. If you want to send an email to multiple recipients:-
void addRecipients(Message.RecipientType type, Address[] addresses)
void addRecipients(Message.RecipientType type)
all of the mentioned
None of the mentioned
40. void addRecipients(Message.RecipientType type, Address[] addresses) Parameter:- type: This would be set to:-
TO
CC
BCC
All of the mentioned
41. void addRecipients(Message.RecipientType type, Address[] addresses) Parameter:- addresses: This is the array of email ID, the method used while specifying email IDs
Internet
InternetAddress
BCC
All of the mentioned
42. To set content whose second argument is “text/html” to specify that the HTML content is included in the message.
setContent
content
setMail
none of the mentioned
43. If it is required to provide user ID and Password to the email server for authentication purpose then you can set properties:
props.setProperty(“mail.user”, “myuser”)
props.setProperty(“mail.password”, “mypwd”)
all of the mentioned
None of the mentioned
44. It is assumed that your localhost is connected to the internet and capable enough to send an email.
True
False
none
all the mentoined
Submit