2011年12月29日 星期四

Java Question Notes

1. final class A {}; //  Define a final class:
- Cannot be subclass. (String is a final class)
- The methods in the class are also final => run twice faster than normal method!
-Extends: abstract class b{}: an abstract class with can have methods
                interface class b{}:

2.   volatile int b;  // an indicator to Thread that do not cache value of this variable

3.

2011年12月14日 星期三

websphere: broker programming

1. compute node:
Compute Mode: - LocalEnvironemnt => pass whole message but not the LocalEnvironment
- Message => pass whole LocalEnvironmentbut not the Message
input: InputRoot, InputLocalEnvironment;
output: OutputRoot, OutputLocalEnvironment;


=============================================
- Collector, Trace node only has ${Root}, not ${InputRoot}
- OutputRoot.MQMD should be set before OutputRoot.XMLNSC & OutputRoot.BLOB
- InputLocalEnvironment.WrittenDestination.MQ.DestinationData.msgId contain the msgId from MQOutput node

2011年12月4日 星期日

java programming: vector, hashtable, ThreadPoolExecutor

1. Java.util.Vector
- 是一種JDK 內建的 API,它的定義就是一種能夠自動長大或縮小的陣列形態,其最大的用途就是彌補Array 的彈性不足,在宣告的時後,可以不必宣告其大小,等到物件一個個的加入時,容量不足時就會自動加大容量。使用的方式如下

Vector v=new Vector();
v.addElement("line 1");
v.addElement("line 2");
v.addElement("line 3");
v.addElement("line 4");

2.Java.util.Hashtable
- 顧名思義來說,就是資料結構中,搜尋這個章節所提到的雜湊表。

Hashtable h=new Hashtable();
h.put("a","line 1");
h.put("b","line 2");
h.put("c","line 3");
h.put("d","line 4");


3.ThreadPoolExecutor and CompletionService
[ref: http://vivyzer.wordpress.com/2009/01/08/use-javautilconcurrent-threadpoolexecutor-and-completionservice-to-know-the-status-of-thread-execution/]

2011年12月1日 星期四

websphere: concept

1. load balancing
-load balancing in cluster is effective for PER connection, not PER message sent

websphere: command

1. dspmq
(display the mq status)

2.setmqaut -m MQ.T.GW1 -n Q.TEST.IN2 -t queue -p user1 +all
(set permission for user user1 on the MQ.T.GW1/Q.TEST.IN2)
-When the queue is deleted and recreate, the permission is lost.
-P.S. user1 reuire connect permission on MQ.T.GW1 in order to write message to TEST.IN2

3. crtmqm -q mq / dltmqm mq
(create mq / delete mq)

4. strmqm mq / endmqm [-i] mq
(start mq/ stop [force to stop] mq)

5. runmqsc mq
(enter mq command status)

6.dspmqrte -m MQ.T.BRG1 -q Q.TEST.IN -qm MQ.T.MB1
(trace message routing, -m: Qmgr for input, -qm:target Qmgr, q: target Q)??

7.endmqlsr -m MQ.T.BRG1
(stop listener on MQ.T.BRG1)