Spring MCQ Quiz Hub

Spring Mcq Set 19

Choose a topic to test your knowledge and improve your Spring skills

To create services and have those automatically installed in the registry.





✅ Correct Answer: 1

Element to export the bean as an OSGi service, classified by the interface we specify.





✅ Correct Answer: 2

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>





✅ Correct Answer: 1

An anonymous bean specified inside of the osgi:service element allows you to avoid cluttering the namespace.





✅ Correct Answer: 1

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:-





✅ Correct Answer: 1

By default, beans created in a Spring application context are global to the entire OSGi runtime.





✅ Correct Answer: 1

Sometimes, you may want to limit the visibility of a service so that multiple clients each get their own instance of the bean.





✅ Correct Answer: 2

Spring Dynamic Modules also supports injection and manipulation of bundles themselves. An injected bundle is of type:-





✅ Correct Answer: 2

Once acquired, the Bundle can be interrogated to introspect information about the bundle itself, including any entries, its current state.





✅ Correct Answer: 1

OSGi will let you maintain multiple versions of a service in your registry at the same time.





✅ Correct Answer: 1

Multiple services of the same interface may be registered inside of an OSGi environment, which necessitates a conflict-resolution process.





✅ Correct Answer: 1

When specified on a service element, allows the ascription of a rank relative to other beans with the same interface.





✅ Correct Answer: 1

A more robust solution to service discrimination is service attributes.





✅ Correct Answer: 1

There are frequently situations where OSGi will return more than one instance of a service that satisfies the interface.





✅ Correct Answer: 1

Attribute, which, is the symbolic name of another bundle.





✅ Correct Answer: 2

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.





✅ Correct Answer: 2

OSGi doesn’t solve framework concerns, instead focusing on infrastructure requirements for Java applications.





✅ Correct Answer: 1

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.





✅ Correct Answer: 2

SpringSource dm Server many advances focus on delivering a solution, and not just a framework, for delivering:-





✅ Correct Answer: 3

SpringSource dm Server provides value above and beyond a regular OSGi solution.





✅ Correct Answer: 1

OSGi–enabling all of these interwoven dependencies via the granular use of the Import-Package header would be tedious.





✅ Correct Answer: 1

SpringSource dm Server also allows you to bend the rules where necessary.





✅ Correct Answer: 1

SpringSource dm Server works with several types of deployment formats:-





✅ Correct Answer: 4

Application isolation is critical because it allows you to solve the issue of reconciliation of two services whose interfaces collide. You can use:-





✅ Correct Answer: 3

SpringSource dm Server provides the robustness needed to commoditize enterprise application development in an OSGi environment.





✅ Correct Answer: 1

To begin with SpringSource dm Server but need a way to rapidly turnaround development.





✅ Correct Answer: 3

SpringSource has provided solid tooling for Eclipse, called :-





✅ Correct Answer: 2

These tools—part of the broader SpringSource Tool Suite—are available as :-





✅ Correct Answer: 3

Java provides a mechanism, where an object can be represented as a sequence of bytes:-





✅ Correct Answer: 1

After a serialized object has been written into a file, it can be read from the file and deserialized.





✅ Correct Answer: 1

Serialization is JVM independent.





✅ Correct Answer: 1

The ObjectOutputStream class contains methods for writing various data types.





✅ Correct Answer: 1

The ObjectInputStream class contains methods for writing various data types.





✅ Correct Answer: 1

For a class to be serialized successfully:





✅ Correct Answer: 1

When serializing an object to a file, the standard convention in Java is to give the file a:





✅ Correct Answer: 3

What will be the value of transient field after deserialization:-





✅ Correct Answer: 3

If the class implements java.io.Serializable, then it is serializable; otherwise, it’s not.





✅ Correct Answer: 1

To send an email using your Java Application:-





✅ Correct Answer: 3

If you want to send an email to multiple recipients:-





✅ Correct Answer: 1

void addRecipients(Message.RecipientType type, Address[] addresses) Parameter:- type: This would be set to:-





✅ Correct Answer: 4

void addRecipients(Message.RecipientType type, Address[] addresses) Parameter:- addresses: This is the array of email ID, the method used while specifying email IDs





✅ Correct Answer: 2

To set content whose second argument is “text/html” to specify that the HTML content is included in the message.





✅ Correct Answer: 1

If it is required to provide user ID and Password to the email server for authentication purpose then you can set properties:





✅ Correct Answer: 3

It is assumed that your localhost is connected to the internet and capable enough to send an email.





✅ Correct Answer: 1