This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!

Khamon Mann

+ Follow
since Nov 08, 2000
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 Khamon Mann

Is there life after taking mock exam after mock exam after mock exam for several months?
21 years ago
The following is a cookbook for object initialization, with final variable initialization considerations included. Tell me what you think.
Object initialization involves constructing the initial state of the object when it�s created using the "new" operator. These are the steps taken:
1. Instance variables are initialized to their default values.
2. Local constructor is invoked. This can lead to local constructor chaining.
3. Superclass�s constructor is invoked, either implicitly or explicitly from the end of the local constructor chain. The superclass�s constructor then executes to completion. Thus, the inherited state of the object is constructed first.
4. Instance member variables are then initialized by executing their instance initializer expressions.
5. If any instance initializer blocks are coded, they�re executed in the order they�re specified in the class definition. If a final var is initialized in step 4, it can�t be changed in step 5.
6. If a final var is initialized in steps 4 or 5, it can�t be changed by a local constructor.
7. If a local constructor chain exists, constructor execution resumes with the local constructor at the end of the chain. Constructor execution then procedes down the local contructor chain, in reverse invocation order.
8. The local constructor that was originally invoked is executed.
9. If a final var isn�t initialized by now, it�s a compiler error.
The following is a cookbook for Event Listener creation. It has helped me in various mock tests. Tell me what you think.
1. If coding the Listener as an anonymous class, skip ahead to step 4.
2. Instantiate a named class, which could be a stand-alone class or an inner class. This will create <classInst>, which is needed in step 5.
3. <ClassType> <classInst> = new <ClassType> ( );
4. Code the call to the inherited addXyListener method.
5. <AWTComponentInst>.addXyListener( <classInst> );
6. Step 5�s <AWTComponentInst> could be an instantiation of like a button, list, choice, textArea, etc.
7. If ref�ing the top-level container, step 5�s <AWTComponentInst> could be an instantiation of a frame, the keyword "this", or blank.
8. Step 5�s addXyListener is addActionListener, addWindowListener, or any of the other valid addXyListener methods.
9. If step 5�s <classInst> is from step 2, skip ahead to building the named class. Skip to step 14.
10. Substitute an anonymous class for step 5�s <classInst>, with the entire anonClass coded inside of step 5�s parens.
11. ( new Xy[Listener|Adapter] ( ) { methOverride { methBody } } );
12. Step 5�s parens and semi-colon were repeated in step 11, for continuity. Seems odd that step 11 ends with 2 closing braces, a closing paren, and semi-colon, however that�s correct syntax, for sure. Step 11�s new object can be either a Listener or an Adapter.
13. Step 11�s { methOverride { methBody } } is common to the named class implementation. Skip to step 17.
14. Declare the named class. This could be a stand-alone class or an inner class. Remember the "extends" for the adapter (if any) and/or the "implements" for the Listeners (if any).
15. �class <ClassType> extends XyAdapter implements XyListener{ methOverride { methBody } }
16. Step 15 would, for sure, have an extends and/or an implements clause. Could be 0, 1, or more Listeners.
17. Back to commonality. Override the method(s) you�re interested in. If it�s an anonymous class, there�s probably only one overridden method in the class. Examples below:
18. public void actionPerformed( ActionEvent evt ) { do something }
19. public void windowClosing( WindowEvent evt ) { System.exit(0); }
I've noticed that starting with "int", the wideners, in order add one byte to the name of the primitive, like this:
Kinda stupid memorization tool, I know, but there it is.
Then you just have to remember the 2 paths to int:
char->int & byte->short->int
and you've got it.
Thanks for your reply. Sorry that my initial post mostly just vented my frustration, but didn't give much useful information. Here's the Tandem part: TCPIP Line Handler listens on a TCPIP port/line and routes requests to the data server, which reads Key Sequenced files (think IBM VSAM) with realtime data, then the data server formats a response, which goes back out on the port/line. Don't worry about the Tandem side, it's handled. Talking to the Tandem, I envision a Jave Servlet running on an NT server, with the Java Servlet executing a "Socket" class call. You can think of the Tandem Line Handler having already done the equivalent of a "ServerSocket" call. To me, all of this seems trivial, easily doable. Jumping to the other side of my Black Hole, I have a combination application/applet written in Java. It needs to be an application to handle the fileReader and fileWriter intermediate testing I/O. However, when the Black Hole is bridged, I envision the Java I've already written coming from the Servlet as a "web page" that has my applet imbedded in some minimal Html. I envision the fileReader and fileWriter stuff replaced by InputStream and OutputStream exchanges between the Applet and Servlet. I envision the Applet and the Tandem exchanging requests and responses, with Servlet mostly just a pass thru. I envision the Applet as a thick client that builds requests when buttons are pressed and populates TextFields and Labels with data obtained by parsing responses that arrive as a flat stream of data from the Servlet, which merely passed thru the Tandem response. My question is therefore, how do I get the Applet and Servlet talking in the manner I've described. I've read about the Applet "tunneling" to the Servlet, with the aid of a "web server", but I don't understand this much. How is the first page requested? How are subsequent pages requested? Where does the web server reside? Is the web server like a pass thru between the applet and servlet? Is the Applet/Servlet exchange in JSP (Java Server Page) protocol?
21 years ago
Got a Tandem legacy system, ugly screens, Online servers, and data, all on the Tandem. Self-studied Java, then went to Java class for a week. Meanwhile, I rewrote an ugly legacy screen in Java and rewrote the screen's Tandem data server in C. Requests and responses are FTP'd back and forth to test functionality. The Java "interface" is merely a fileWriter and a fileReader. The Java I/O is split off into a separate little class, with a RqstMethod and a RespMethod, but it's really no big deal. I knew I was writing a client/server app with a giant Black Hole for connectivity, but I thought surely there'd be a plug & play solution to fill the gap. I mean like we're a big company with scads of web applications, I thought surely there'd be a company approved methodology for filling the black hole I created. But, it's pretty clear that there isn't any money in my group's budget to pay another group in the company to tell us how eliminate this web connectivity black hole. Instead of concrete help, my coworkers merely talk about using an NT server they found gathering dust in a spare room and suggest I should rewrite my Java to be a servlet that would respond to the User with web pages. Up to today my attitude has been to hide in my office focussing entirely on my 2 end pieces and hope that somebody will eradicate my Black Hole for me, but today a co-worker let me know that he bought 2 Java networking books for our group's "Java library", implying that I should use them for ideas on establishing web connectivity, and it pissed me off, you know? I mean like I spent a lot of time writing the Java code and corresponding C data server, why should I also have to write the network server, and hook it all up by myself? I don't know squat about web connectivity. Any comments on how I could simply accomplish some basic web connectivity?
21 years ago