Randy Johnson

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

Recent posts by Randy Johnson

Is there a way to use the Class.forName() method to instantiate an object with a constructor signature that includes arguments? I know the javadocs indicate that a no-arg constructor must be supplied, but was hoping someone came up with an ingenious way to make it work.
17 years ago
In an object-relational mapping model, one would have an instance of an object mapped to a row in a relational table. To manage a collection of instances, a separate object manager instance could be created to: get a list of instances, save a list of instances, etc.
An alternative would be to use static methods at the instance's class level to perform the same management functions.
What are the advantages/disadvantages to each approach? It seems like static methods would cut down on object clutter, but do they perform well in a high volume, multi-user environment? Is there a potential bottleneck issue with multiple users accessing the same static methods?
17 years ago
Using JBoss4, when a stateful session bean is activated via ejbActivate(), does the container automatically call the EJB's default constructor (to initialize instance variables) as part of the restoration from a .ser file?
Thank you for this response. Can you direct me to a document/book which discusss the mechanics of this process in more detail?
18 years ago
In our case, we are using a separate Bean instance for each thread.
18 years ago
When multiple instances (i.e. multiple users) of the same java bean are running in the same JVM, does the JVM manage multiple complete copies of the Bean, or is it smart enough to have ONE copy of methods, with separate variables, managed for each thread?

I'm referring to a plain java bean here, not an EJB.

We have a group of very large java beans that perform a server-side domain business function. We are performance testing multiple users of this group using the JMeter scripting tool. We encounter out of memory errors as we 'ramp up' the number of concurrent users, so I'm trying to learn more about how the JVM manages memory relative to this scenario.

Thanks
18 years ago
I am looking for an open-source set of components that can help manage numeric business-type data (i.e. quantities, costs, prices, currencies) where the number of decimal places can be defined, and mathematics operations (add, subtract, multiply, divide) are defined as methods, to cover rounding issues, etc. Does such a set of generic components exist? IBM offered something like this in Websphere with their Business Components, but its not open-source. It seems like they should be complex data storage classes, that ultimately map to storage of floats to the RDBMS, but would be accessed in java via the above methods.
I could write the code myself, but it sure seems like a wheel reinvention to me. Any ideas?
If an object instance contains a HashTable with many entries, and a client class or object wants to access the HashTable entries, which approach is more appropriate:
String keyInformation = "KEY";
HashTable hashTable = targetClass.getHashTable();
if hashTable.containsKey(keyInformation) {}
OR
String keyInformation = "KEY";
if targetClass.hashtable.containsKey(keyInformation) {}
The second approach seems as thought it would be more efficient use of memory, but I suspect it violates the objective of information-hiding.
Any thoughts?
20 years ago
Simple question - there are many java docs and books that refer to callback methods. Is there a single definition to what a callback method is. It appears to me that it is a method (posssibly with a standardized signature) that the programmer implements, but does not call directly. It is developed with the assumption that some other class(es) may call it if certain conditions are met. Is this somewhat accurate?
20 years ago
Some time ago, I saw an example of an applet that used a JTree, but the display actually looked more like a JTable. Each node in the tree had columnar data. You could expand/collapse nodes, just like a tree, but when you expanded, for example, each new node had its column data displayed as well.
Has anyone seen something like this? If so, could you point me to a technical paper, book, code sample, etc., that shows how this is done?
Thanks!
21 years ago
Kyle,
Thanks for the help. I guess I should have known better. (If it helps, I did get a copy of your book! - I suppose I just need to read it thoroughly).
I have a stateless session bean. It uses a local interface to retrieve Entity Bean instances into a Vector. I then use a Java client program to access the Session Bean method that returns the Vector. When I run the client, I get an error that the Vector is not serializable. Shouldn't this work?
Is there a way to change the column headings for a JTable that has already been instantiated? I have spent hours going over the API's for TableModel, TableColumnModel, etc., and just can't find a Class or method that will let me do it!
Any ideas?
Thanks
21 years ago
I have a Java application using multiple layers of panels. From one of the panels, I need to display a JDialog box. The constructor of the JDialog needs the parent Frame as an argument. One way I have retrieved this is by calling getParent() multiple times from within the panel, until I get an instance of the Frame. I HAVE to believe there is a more efficient way to do this?
Is there?
21 years ago
So...
Given that scenario, can I somehow force a Window Closing event?
If I use the dispose method, the Dialog is garbage collected (apparently immediately), and I cannot retrieve any of its attributes (I CAN get the attributes after WindowClose is executed).
Any ideas?
21 years ago