Explore topic-wise InterviewSolutions in Current Affairs.

This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.

1.

Is It Possible To Put A Jboss Server Instance Into Multiple Cluster At The Same Time ?

Answer»

It is TECHNICALLY POSSIBLE to put a JBoss server INSTANCE into MULTIPLE clusters at the same time, this practice is generally not recommended, as it increases the management complexity.

It is technically possible to put a JBoss server instance into multiple clusters at the same time, this practice is generally not recommended, as it increases the management complexity.

2.

Which Component Handles Cluster Communication In Jboss ?

Answer»

The JGroups framework provides services to ENABLE peer-to-peer communications between nodes in a cluster. It is built on top a stack of network communication protocols that provide transport, discovery, reliability and failure DETECTION, and cluster MEMBERSHIP MANAGEMENT services.

The JGroups framework provides services to enable peer-to-peer communications between nodes in a cluster. It is built on top a stack of network communication protocols that provide transport, discovery, reliability and failure detection, and cluster membership management services.

3.

How Can You Start A Jta Transaction From A Servlet Deployed On Jboss ?

Answer»

JBOSS registers in the JNDI TREE a JTA UserTransaction Object which can be user to MANAGE a distributed TRANSACTION.

JBoss registers in the JNDI tree a JTA UserTransaction Object which can be user to manage a distributed transaction.

4.

What Is Jta?

Answer»

Java Transaction API is a STANDARD between the transaction manager and the entities participated in the distributed transaction system. These entities are transaction manager, the APPLICATION server and transactional applications. JTA allows the applications to PERFORM distributed transactions between one or more systems CONNECTED to the network. The database access power is greatly increased by supporting JTA in a JDBC driver.

The resource manager can be viewed as a RDBMS. This component handles the ACTUAL database management. The communication channel is the resource adapter which is a JDBC driver. For a specific enterprise database, the resource manager local transaction is performed for a single transaction.

Java Transaction API is a standard between the transaction manager and the entities participated in the distributed transaction system. These entities are transaction manager, the application server and transactional applications. JTA allows the applications to perform distributed transactions between one or more systems connected to the network. The database access power is greatly increased by supporting JTA in a JDBC driver.

The resource manager can be viewed as a RDBMS. This component handles the actual database management. The communication channel is the resource adapter which is a JDBC driver. For a specific enterprise database, the resource manager local transaction is performed for a single transaction.

5.

What Is Jboss?

Answer»

JBoss is a popular OPEN source application SERVER based on JEE technology. Being JEE based, the JBoss supports cross-platform java applications. It was embedded with Apache Tomcat web server. It runs under any JVM of 1.3 or later versions. JBoss supports JNDI, Servlet/JSP (Tomcat or Jetty), EJB, JTS/JTA, JCA, JMS, CLUSTERING (JavaGroups), Web SERVICES (Axis), and IIOP integration (JacORB).

JBoss is a popular open source application server based on JEE technology. Being JEE based, the JBoss supports cross-platform java applications. It was embedded with Apache Tomcat web server. It runs under any JVM of 1.3 or later versions. JBoss supports JNDI, Servlet/JSP (Tomcat or Jetty), EJB, JTS/JTA, JCA, JMS, Clustering (JavaGroups), Web Services (Axis), and IIOP integration (JacORB).

6.

Explain About Ruby Code Blocks?

Answer»

Ruby code blocks form an important part of ruby and are very fun to use. With the HELP of this feature you can place your code between do-end and you can associate them with method invocations and you can get an impression that they are LIKE PARAMETERS. They may appear near to a SOURCE of the code and adjacent to a method call. The code is not executed during the program execution but it is executed when the context of its appearance is MET or when it enters a method.

Ruby code blocks form an important part of ruby and are very fun to use. With the help of this feature you can place your code between do-end and you can associate them with method invocations and you can get an impression that they are like parameters. They may appear near to a source of the code and adjacent to a method call. The code is not executed during the program execution but it is executed when the context of its appearance is met or when it enters a method.

7.

Explain About Interpolation?

Answer»

Interpolation is a very important process in Ruby. Interpolation is the process of INSERTING a string into a literal. There is only one way in which you can interpolate a string into a literal by placing a HASH (#) within {} OPEN and close brackets. This refers to a NEW name to by REFERRING to the copy of the original method.

Interpolation is a very important process in Ruby. Interpolation is the process of inserting a string into a literal. There is only one way in which you can interpolate a string into a literal by placing a Hash (#) within {} open and close brackets. This refers to a new name to by referring to the copy of the original method.

8.

Explain About Float, Dig And Max?

Answer»

FLOAT class is used WHENEVER the function changes constantly. It acts as a SUB class of numeric. They represent real characters by making use of the native architecture of the double precision floating point.
Max is used whenever there is a huge need of Float.
DIG is used whenever you want to represent a float in decimal DIGITS.

Float class is used whenever the function changes constantly. It acts as a sub class of numeric. They represent real characters by making use of the native architecture of the double precision floating point.
Max is used whenever there is a huge need of Float.
Dig is used whenever you want to represent a float in decimal digits.

9.

How Does Ruby Deal With Extremely Large Numbers?

Answer»

Unlike other programming languages ruby deals with extremely large numbers it doesn’t have any barriers. There is no limit on the extent of limit of NUMBER USAGE. Ruby performs this function with two different classes they are fixnum and BIGNUM. Fixnum represents EASILY managed small numbers and bignum represents big numbers. Ruby entirely handles the FUNCTIONING of these two classes which leaves a programmer to concentrate on his arithmetic operations.

Unlike other programming languages ruby deals with extremely large numbers it doesn’t have any barriers. There is no limit on the extent of limit of number usage. Ruby performs this function with two different classes they are fixnum and bignum. Fixnum represents easily managed small numbers and bignum represents big numbers. Ruby entirely handles the functioning of these two classes which leaves a programmer to concentrate on his arithmetic operations.

10.

Explain About Class Variable And Global Variable?

Answer»

A CLASS variable STARTS with an @@ sign which is immediately followed by upper or lower case letter. You can also put some name characters after the LETTERS which stand to be a pure optional. A class variable can be shared AMONG all the objects of a class. A single copy of a class variable exists for each and every given class.
To write a global variable you START the variable with a $ sign which should be followed by a name character. Ruby defines a number of global variables which also include other punctuation characters such as $_ and $-k.

A class variable starts with an @@ sign which is immediately followed by upper or lower case letter. You can also put some name characters after the letters which stand to be a pure optional. A class variable can be shared among all the objects of a class. A single copy of a class variable exists for each and every given class.
To write a global variable you start the variable with a $ sign which should be followed by a name character. Ruby defines a number of global variables which also include other punctuation characters such as $_ and $-k.

11.

Explain About Variables?

Answer»

There are four different types of variables they are LOCAL, instance, global, and class. Variables can be USED in the program without any declaration and they can CONTAIN data of any type. A local VARIABLE contains lower case characters followed by name characters. Instance variable starts with a @ sign followed by name characters.

There are four different types of variables they are local, instance, global, and class. Variables can be used in the program without any declaration and they can contain data of any type. A local variable contains lower case characters followed by name characters. Instance variable starts with a @ sign followed by name characters.

12.

Explain About Ruby Names?

Answer»

Classes, variables, methods, constants and modules can be referred by ruby names. When you want to DISTINGUISH between various names you can specify that by the first character of the name. Some of the names are USED as reserve words which should not be used for any other purpose. A name can be lowercase letter, upper case letter, number, or an UNDERSCORE, MAKE SURE that you follow the name by name characters.

Classes, variables, methods, constants and modules can be referred by ruby names. When you want to distinguish between various names you can specify that by the first character of the name. Some of the names are used as reserve words which should not be used for any other purpose. A name can be lowercase letter, upper case letter, number, or an underscore, make sure that you follow the name by name characters.

13.

Explain About Normal Method Class?

Answer»

This function calls a method and it can take any number of ARGUMENTS and expr. Make sure that you put an asterisk or an AMPERSAND before the expression. Last expr argument can be declared with a HASH without any braces. If you want to increase the size of the array value then make sure that you put an asterisk before expression. “::” can be used to separate the class from METHODS.

This function calls a method and it can take any number of arguments and expr. Make sure that you put an asterisk or an ampersand before the expression. Last expr argument can be declared with a hash without any braces. If you want to increase the size of the array value then make sure that you put an asterisk before expression. “::” can be used to separate the class from methods.

14.

Explain About Methods?

Answer»

Methods in ruby basically perform two functions, named operation and the code present in the class which does a specific function. In Ruby all your algorithms live in methods which inturn is present on OBJECTS. Ruby does not have any provision for functions. Code present in Ruby is ALWAYS a method of some object. Behind the scenes ruby GIVES you the flexibility to work with methods as functions if you are considering working with other languages.

Methods in ruby basically perform two functions, named operation and the code present in the class which does a specific function. In Ruby all your algorithms live in methods which inturn is present on objects. Ruby does not have any provision for functions. Code present in Ruby is always a method of some object. Behind the scenes ruby gives you the flexibility to work with methods as functions if you are considering working with other languages.

15.

Explain About The Defined Operator?

Answer»

Define operator DEFINES whether a passed expression is defined or not. If the expression is defined it RETURNS the description STRING or null if the expression is not defined. If a variable is defined it GETS initialized. If method_call is defined as true then method also gets defined. This is also the same case with super and yield.

Define operator defines whether a passed expression is defined or not. If the expression is defined it returns the description string or null if the expression is not defined. If a variable is defined it gets initialized. If method_call is defined as true then method also gets defined. This is also the same case with super and yield.

16.

Explain About Operators In Ruby?

Answer»

Like all the modern languages Ruby supports many DIFFERENT operators to its credit. Most of the operators in Ruby are in FACT methods due to the object ORIENTED nature of the language. This feature gives Ruby an EDGE over its competitors. Semantics of these operators can be CHANGED due to the object oriented nature of the language.

Like all the modern languages Ruby supports many different operators to its credit. Most of the operators in Ruby are in fact methods due to the object oriented nature of the language. This feature gives Ruby an edge over its competitors. Semantics of these operators can be changed due to the object oriented nature of the language.

17.

Explain About Environment Variables Present In Ruby?

Answer»

Following are some of the environment variables used to control the behavior PROGRAMMING of RUBY. While programming ENV object LISTS some of the current variables. RUBYLIB PATH searches for libraries. MAKE sure that you separate each path with colons. RUBYOPT passes command line options to Ruby interpreter. There are many more which can be obtained by searching the huge pool of library.

Following are some of the environment variables used to control the behavior programming of ruby. While programming ENV object lists some of the current variables. RUBYLIB path searches for libraries. Make sure that you separate each path with colons. RUBYOPT passes command line options to Ruby interpreter. There are many more which can be obtained by searching the huge pool of library.

18.

Explain About The Command Line Options?

Answer»

Ruby`s LANGUAGE is EXECUTED from the command line like most of the scripting languages. Programming and behavior language environment can be controlled from the interpreter itself. Some of the commands which are USED are as FOLLOWS –d, -h, -e PROG, -v, -T, -r lib, etc.

Ruby`s language is executed from the command line like most of the scripting languages. Programming and behavior language environment can be controlled from the interpreter itself. Some of the commands which are used are as follows –d, -h, -e prog, -v, -T, -r lib, etc.

19.

Explain About Garbage Collection Feature Of Ruby?

Answer»

Ruby is an object oriented language and every object oriented language TENDS to allocate many OBJECTS during execution of the PROGRAM. Ruby DELETES UNALLOCATED and unused objects automatically. This feature can be controlled by applying proper syntax and program through ruby.

Ruby is an object oriented language and every object oriented language tends to allocate many objects during execution of the program. Ruby deletes unallocated and unused objects automatically. This feature can be controlled by applying proper syntax and program through ruby.

20.

Explain About Portability?

Answer»

RUBY language can be PORTED to many platforms. Ruby programs can be ported to many platforms without any MODIFICATION to the source code. This feature MADE the language very useful and highly used by many programmers worldwide. Some of the platforms used are DOS, UNIX, WINDOWS, ETC.

Ruby language can be ported to many platforms. Ruby programs can be ported to many platforms without any modification to the source code. This feature made the language very useful and highly used by many programmers worldwide. Some of the platforms used are DOS, UNIX, WINDOWS, etc.

21.

Explain About Class Libraries In Ruby?

Answer»

RUBY has a strong SET of class libraries and it covers from a VARIETY of DOMAINS such as thread programming, domains and data types. ALSO ruby is a new language and it also has additional libraries coming every day. Many of the new languages which do exist have huge libraries because of their age.

Ruby has a strong set of class libraries and it covers from a variety of domains such as thread programming, domains and data types. Also ruby is a new language and it also has additional libraries coming every day. Many of the new languages which do exist have huge libraries because of their age.

22.

Explain About The Programming Language Ruby?

Answer»

Ruby is the brain child of a Japanese PROGRAMMER Matz. He created Ruby. It is a cross platform object oriented language. It helps you in knowing what your code does in your application. With LEGACY code it GIVES you the power of ADMINISTRATION and organization tasks. Being open source, it did GO into great lengths of development.

Ruby is the brain child of a Japanese programmer Matz. He created Ruby. It is a cross platform object oriented language. It helps you in knowing what your code does in your application. With legacy code it gives you the power of administration and organization tasks. Being open source, it did go into great lengths of development.

23.

What Is Messaging?

Answer»

MESSAGING is a MECHANISM by which data can be passed from ONE application to ANOTHER application.

Messaging is a mechanism by which data can be passed from one application to another application.

24.

What Is The Difference Between Queue And Topic ?

Answer»

A topic is TYPICALLY used for one to many messaging , while QUEUE is used for one-to-one messaging. Topic .e. it supports PUBLISH subscribe model of messaging where queue supports POINT to Point Messaging.

A topic is typically used for one to many messaging , while queue is used for one-to-one messaging. Topic .e. it supports publish subscribe model of messaging where queue supports Point to Point Messaging.

25.

What Is Stream Message ?

Answer»

STREAM messages are a group of java primitives. It CONTAINS some convenient methods for reading the data. However Stream Message prevents reading a long value as short. This is so because the Stream Message also WRITES the TYPE information along with the value of the primitive type and enforces a set of strict conversion rules which actually prevents reading of ONE primitive type as another.

Stream messages are a group of java primitives. It contains some convenient methods for reading the data. However Stream Message prevents reading a long value as short. This is so because the Stream Message also writes the type information along with the value of the primitive type and enforces a set of strict conversion rules which actually prevents reading of one primitive type as another.

26.

What Is Map Message?

Answer»

MAP message CONTAINS NAME value Pairs. The values can be of type PRIMITIVES and its wrappers. The name is a string.

map message contains name value Pairs. The values can be of type primitives and its wrappers. The name is a string.

27.

What Is Text Message?

Answer»

TEXT messages contains String messages (since being widely used, a separate messaging Type has been supported) . It is useful for exchanging textual DATA and complex CHARACTER data like XML.

Text messages contains String messages (since being widely used, a separate messaging Type has been supported) . It is useful for exchanging textual data and complex character data like XML.

28.

What Is Object Message ?

Answer»

Object MESSAGE CONTAINS a group of serializeable java object. So it allows EXCHANGE of Java objects between applications. SOT both the applications must be Java applications.

Object message contains a group of serializeable java object. So it allows exchange of Java objects between applications. sot both the applications must be Java applications.

29.

What Is Byte Message ?

Answer»

Byte Messages contains a Stream of uninterrupted bytes. Byte Message contains an array of primitive bytes in it's payload. Thus it can be USED for TRANSFER of data between two applications in their native format which may not be COMPATIBLE with other Message types. It is also be useful where JMS is used purely as a transport between two SYSTEMS and the message payload is opaque to the JMS client.

Byte Messages contains a Stream of uninterrupted bytes. Byte Message contains an array of primitive bytes in it's payload. Thus it can be used for transfer of data between two applications in their native format which may not be compatible with other Message types. It is also be useful where JMS is used purely as a transport between two systems and the message payload is opaque to the JMS client.

30.

What Is The Difference Between Byte Message And Stream Message?

Answer»

Bytes MESSAGE stores data in bytes. Thus the message is one contiguous stream of bytes. While the Stream Message maintains a boundary between the different data types stored because it also stores the type information along with the value of the primitive being stored. Bytes Message allows data to be read using any type. Thus even if your payload contains a long value, you can invoke a method to read a short and it will return you something. It will not give you a semantically correct data but the call will succeed in reading the first two bytes of data. This is STRICTLY PROHIBITED in the Stream Message. It maintains the type information of the data being stored and enforces strict conversion RULES on the data being read.

Bytes Message stores data in bytes. Thus the message is one contiguous stream of bytes. While the Stream Message maintains a boundary between the different data types stored because it also stores the type information along with the value of the primitive being stored. Bytes Message allows data to be read using any type. Thus even if your payload contains a long value, you can invoke a method to read a short and it will return you something. It will not give you a semantically correct data but the call will succeed in reading the first two bytes of data. This is strictly prohibited in the Stream Message. It maintains the type information of the data being stored and enforces strict conversion rules on the data being read.

31.

What Is The Role Of The Jms Provider?

Answer»

The JMS PROVIDER HANDLES security of the MESSAGES, data CONVERSION and the client triggering. The JMS provider specifies the level of encryption and the security level of the message, the best data type for the non-JMS client.

The JMS provider handles security of the messages, data conversion and the client triggering. The JMS provider specifies the level of encryption and the security level of the message, the best data type for the non-JMS client.

32.

What Are The Different Parts Of A Jms Message ?

Answer»

A JMS message contains THREE PARTS. a header, an OPTIONAL properties and an optional body.

A JMS message contains three parts. a header, an optional properties and an optional body.

33.

What Type Messaging Is Provided By Jms?

Answer»

Both SYNCHRONOUS and ASYNCHRONOUS are PROVIDED by JMS.

Both synchronous and asynchronous are provided by JMS.

34.

Where Does The Start_tabnav Gets Informations For Tabs Rendering In Ruby Rail?

Answer»

<%= start_tabnav :main %>
The :main Symbol let the start_tabnav method KNOW to LOOK for a special MainTabnav CLASS where all the magic happens.

<%= start_tabnav :main %>
The :main Symbol let the start_tabnav method know to look for a special MainTabnav class where all the magic happens.

35.

What Is The Use Of Global Variable $ In Ruby?

Answer»

If you declare one VARIABLE as GLOBAL we can ACCESS any where, as class variable.

If you declare one variable as global we can access any where, as class variable.

36.

What Is The Scope Of A Local Variable In Ruby?

Answer»

A new scope for a local variable is introduced in the toplevel, a class (module) definition, a method defintion. In a procedure BLOCK a new scope is introduced but you can access to a local variable outside the block.

The scope in a block is special because a local variable should be localized in Thread and Proc objects. while, until, and for are control structures and the scope is SHARED with the outside of these structures. LOOP is a method and the APPENDED block introduces a new scope.

A new scope for a local variable is introduced in the toplevel, a class (module) definition, a method defintion. In a procedure block a new scope is introduced but you can access to a local variable outside the block.

The scope in a block is special because a local variable should be localized in Thread and Proc objects. while, until, and for are control structures and the scope is shared with the outside of these structures. loop is a method and the appended block introduces a new scope.

37.

What Is The Log That Has To Seen To Check For An Error In Ruby Rails?

Answer»

Rails will report errors from APACHE in log/apache.log and errors from the Ruby code in log/development.log. If you're having a problem, do have a LOOK at what these logs are saying. On Unix and Mac OS X you may run tail -f log/development.log in a separate TERMINAL to monitor your application's EXECUTION.

Rails will report errors from Apache in log/apache.log and errors from the Ruby code in log/development.log. If you're having a problem, do have a look at what these logs are saying. On Unix and Mac OS X you may run tail -f log/development.log in a separate terminal to monitor your application's execution.

38.

What Function Converts All Html Special Symbols To Html Entities In Ruby?

Answer»

This FUNCTION ae_some_html converts all HTML SPECIAL SYMBOLS to HTML entities.

This function ae_some_html converts all HTML special symbols to HTML entities.

39.

What Is The Use Of Load And Require In Ruby?

Answer»

A method that loads and PROCESSES the Ruby code from a separate file, including WHATEVER classes, MODULES, methods, and constants are in that file into the current scope. load is similar, but RATHER than performing the inclusion operation once, it reprocesses the code every time load is called.

A method that loads and processes the Ruby code from a separate file, including whatever classes, modules, methods, and constants are in that file into the current scope. load is similar, but rather than performing the inclusion operation once, it reprocesses the code every time load is called.

40.

What Are The Core Jms-related Objects Required For Each Jms-enabled Application?

Answer»

Each JMS-enabled client MUST establish the following:
• A connection object provided by the JMS server (the message broker)
• Within a connection, one or more sessions, which provide a context for message sending and RECEIVING
• Within a session, either a queue or TOPIC object representing the destination (the message staging area) within the message broker
• Within a session, the appropriate sender or publisher or receiver or subscriber object (DEPENDING on whether the client is a message producer or consumer and uses a point-to-point or publish/subscribe strategy, RESPECTIVELY) Within a session, a message object (to send or to receive)

Each JMS-enabled client must establish the following:
• A connection object provided by the JMS server (the message broker)
• Within a connection, one or more sessions, which provide a context for message sending and receiving
• Within a session, either a queue or topic object representing the destination (the message staging area) within the message broker
• Within a session, the appropriate sender or publisher or receiver or subscriber object (depending on whether the client is a message producer or consumer and uses a point-to-point or publish/subscribe strategy, respectively) Within a session, a message object (to send or to receive)

41.

What Are The Types Of Messaging?

Answer»

There are two kinds of MESSAGING.

Synchronous Messaging: Synchronous messaging INVOLVES a CLIENT that waits for the server to RESPOND to a message.

Asynchronous Messaging: Asynchronous messaging involves a client that does not wait for a message from the server. An event is used to trigger a message from a server.

There are two kinds of Messaging.

Synchronous Messaging: Synchronous messaging involves a client that waits for the server to respond to a message.

Asynchronous Messaging: Asynchronous messaging involves a client that does not wait for a message from the server. An event is used to trigger a message from a server.

42.

What Is Mdb And What Is The Special Feature Of That?

Answer»

MDB is Message driven bean, which very much resembles the STATELESS session bean. The incoming and out going MESSAGES can be HANDLED by the Message driven bean. The ABILITY to COMMUNICATE asynchronously is the special feature about the Message driven bean.

MDB is Message driven bean, which very much resembles the Stateless session bean. The incoming and out going messages can be handled by the Message driven bean. The ability to communicate asynchronously is the special feature about the Message driven bean.

43.

How Is A Java Object Message Delivered To A Non-java Client?

Answer»

It is according to the specification that the message SENT should be received in the same format. A non-java CLIENT cannot receive a message in the FORM of java object. The provider in between handles the CONVERSION of the data type and the message is transferred to the other end.

It is according to the specification that the message sent should be received in the same format. A non-java client cannot receive a message in the form of java object. The provider in between handles the conversion of the data type and the message is transferred to the other end.

44.

Give An Example Of Using The Publish/subscribe Model.

Answer»

JMS can be used to BROADCAST SHUTDOWN messages to clients connected to the Weblogic server on a module wise basis. If an application has six MODULES, each module behaves LIKE a subscriber to a named topic on the server.

JMS can be used to broadcast shutdown messages to clients connected to the Weblogic server on a module wise basis. If an application has six modules, each module behaves like a subscriber to a named topic on the server.

45.

What Is The Advantage Of Persistent Message Delivery Compared To Nonpersistent Delivery?

Answer»

If the JMS server experiences a failure, for example, a power outage, any MESSAGE that it is holding in primary storage potentially COULD be lost. With PERSISTENT storage, the JMS server logs every message to secondary storage. (The logging occurs on the front end, that is, as part of handling the send operation from the message producing client.) The logged message is REMOVED from secondary storage only after it has been successfully delivered to all consuming clients .

If the JMS server experiences a failure, for example, a power outage, any message that it is holding in primary storage potentially could be lost. With persistent storage, the JMS server logs every message to secondary storage. (The logging occurs on the front end, that is, as part of handling the send operation from the message producing client.) The logged message is removed from secondary storage only after it has been successfully delivered to all consuming clients .

46.

What Is Point-to-point Messaging?

Answer»

With point-to-point MESSAGE passing the SENDING application/client establishes a NAMED message queue in the JMS broker/server and sends messages to this queue. The RECEIVING client REGISTERS with the broker to receive messages posted to this queue. There is a one-to-one relationship between the sending and receiving clients.

With point-to-point message passing the sending application/client establishes a named message queue in the JMS broker/server and sends messages to this queue. The receiving client registers with the broker to receive messages posted to this queue. There is a one-to-one relationship between the sending and receiving clients.

47.

What Is The Difference Between Bytesmessage And Streammessage??

Answer»

BytesMessage stores the primitive data types by converting them to their BYTE representation. Thus the message is one contiguous stream of bytes. While the STREAMMESSAGE maintains a boundary between the different data types stored because it also stores the type information ALONG with the VALUE of the primitive being stored. BytesMessage allows data to be read using any type. Thus even if your payload contains a long value, you can invoke a method to read a short and it will return you something. It will not give you a semantically correct data but the CALL will succeed in reading the first two bytes of data. This is strictly prohibited in the StreamMessage. It maintains the type information of the data being stored and enforces strict conversion rules on the data being read.

BytesMessage stores the primitive data types by converting them to their byte representation. Thus the message is one contiguous stream of bytes. While the StreamMessage maintains a boundary between the different data types stored because it also stores the type information along with the value of the primitive being stored. BytesMessage allows data to be read using any type. Thus even if your payload contains a long value, you can invoke a method to read a short and it will return you something. It will not give you a semantically correct data but the call will succeed in reading the first two bytes of data. This is strictly prohibited in the StreamMessage. It maintains the type information of the data being stored and enforces strict conversion rules on the data being read.

48.

What Is The Use Of Mapmessage?

Answer»

A MapMessage CARRIES name-value pair as it's PAYLOAD. Thus it's payload is similar to the JAVA.util.Properties OBJECT of Java. The values can be Java primitives or their wrappers.

A MapMessage carries name-value pair as it's payload. Thus it's payload is similar to the java.util.Properties object of Java. The values can be Java primitives or their wrappers.

49.

What Is The Use Of Objectmessage?

Answer»

ObjectMessage contains a Serializable java object as it's payload. Thus it allows EXCHANGE of Java objects between applications. This in itself mandates that both the applications be Java applications. The CONSUMER of the message must typecast the object received to it's appropriate type. Thus the consumer should before hand know the ACTUAL type of the object sent by the sender. Wrong type casting would result in ClassCastException. Moreover the class definition of the object set in the payload should be available on both the machine, the sender as well as the consumer. If the class definition is not available in the consumer machine, an attempt to type cast would result in ClassNotFoundException. Some of the MOMs might support dynamic loading of the DESIRED class over the network, but the JMS specification does not mandate this behavior and would be a value added service if provided by your vendor. And relying on any such vendor specific functionality would hamper the portability of your application. Most of the time the class need to be put in the CLASSPATH of both, the sender and the consumer, manually by the developer.

ObjectMessage contains a Serializable java object as it's payload. Thus it allows exchange of Java objects between applications. This in itself mandates that both the applications be Java applications. The consumer of the message must typecast the object received to it's appropriate type. Thus the consumer should before hand know the actual type of the object sent by the sender. Wrong type casting would result in ClassCastException. Moreover the class definition of the object set in the payload should be available on both the machine, the sender as well as the consumer. If the class definition is not available in the consumer machine, an attempt to type cast would result in ClassNotFoundException. Some of the MOMs might support dynamic loading of the desired class over the network, but the JMS specification does not mandate this behavior and would be a value added service if provided by your vendor. And relying on any such vendor specific functionality would hamper the portability of your application. Most of the time the class need to be put in the classpath of both, the sender and the consumer, manually by the developer.

50.

What Is The Use Of Textmessage?

Answer»

TEXTMESSAGE contains instance of java.lang.String as it's payload. THUS it is very USEFUL for exchanging TEXTUAL data. It can also be used for exchanging complex character data such as an XML DOCUMENT.

TextMessage contains instance of java.lang.String as it's payload. Thus it is very useful for exchanging textual data. It can also be used for exchanging complex character data such as an XML document.