Rahul JG

Ranch Hand
+ Follow
since Jun 05, 2002
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rahul JG

I have an Entity Bean with two methods A() & B() with the following transaction attributes

A() - Required
B() - Required

Processing is as follows:

Client -> some logic -> A() -> B()

client is not associated with any transaction context & method A() internally calls method B().

What would happen to the transaction context of B()? Would it get the same transaction context that was started in A(), or would it create a new one.

The specs say that the container interposes every method invocation on the home or component interface and applies the transaction parameters accordingly. In the above case the call from A() to B() is not a remote one, but a local one.
A MIDlet registers for timer-based activation and while it is still executing receives a notification for the alarm.
Since the MIDlet is active, the MIDlet itself is responsible for all push events.

How does the MIDlet respond? What is the sequence of method execution?

If the MIDlet was not active, I guess the sequence would have been new() -> startApp()
Look at it from the Push Registry perspective:

How does an application indicate to the Push Registry to activate it when there is a message on port 5000?


In this case the application/Push Registry listens on port 5000.

Now if an application on some other device sends a message to port 5000, then for it, port 5000 is that of the destination application. I feel destination & source should be used in the proper context.
From the specs:

The receiving application in a device is identified with the port number included in the message. When opening the server mode MessageConnection, the application specifies the port number that it will use for receiving
These port numbers are split into ranges. The IANA (Internet Assigned Numbers Authority) controls one of the ranges.

Hence the exception
Port number is of the device that is listening for incoming messages at the specified port.
Things will be clear after reading this (Push Registry):

When using a system-assigned address, you must publish this address so that external systems can connect to your aplication.
If I understand it correctly:

<b>RecordStore.openRecordStore(String name, boolean create)</b> will always default to the namespace in the MIDlet is loaded. So even if there are two record stores with the same name, the one in the active namespace will be loaded.

To load a record store in a different namespace, use
<b>RecordStore.openRecordStore(String name, String vendor, String suite)</b>

By the way, I haven't referred to any mock exams as yet.
So its just a coincidence that the question happens to be from one of the mock exams.
1) A MIDlet in one MIDlet suite is allowed to have a record store with the same name as a MIDlet in another MIDlet suite.

2) Sharing of RecordStores is possible from MIDP2.0

If there are 2 RecordStores with the same name which reference would one get when RecordStore.openRecordStore() is called?
Given that a bean instance can move from the Pooled state to the Ready state under two circumstances:
1) via creation
2) via activation
how does the container decide whether to "create" the bean or to "activate" the bean. In other words how does the
container decide whether to call ejbCreate() or ejbActivate() on the Pooled bean instance.
Try this:
Manifest-Version: 1.0
Main-Class: zzz.class
Space in Manifest-Version:1.0 was missing.
20 years ago
Integer.parseInt("<input>") parses the string argument as a signed decimal integer.
The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' ('\u002d') to indicate a negative value.
It will throw a NumberFormatException if the string does not contain a parsable integer.
20 years ago
20 years ago
I can write an essay on that.
Please indicate in what context?
20 years ago
I need to rephrase my statement:
Objects are passed by value but modified by reference.
I can write an essay on that.
Please indicate in what context?
20 years ago
In case of method f(String s), you are setting the copy of the reference to null, you are in no way modifying the data which the reference points to.
In case of method f(String[] s), you are modifying the array which the reference points to.
Things would have been similar if method f(String[] s) also did something similar to s = null;
Consider there is a lock with 2 keys (one with me one with you).
In method f(String s), you loose your key (reference==null), nothing happens to the lock.
In method f(String[] s), you play around with the lock and then loose the key.