멀티스레드 환경에서 이뮤터블 패턴이 장점을 가짐. 즉 스레드간 특정 자원을 공유하는
문제에 대해 방지가 가능. 물론 concurrent패키지 계열의 클래스들을 사용해도 될테지만..
그래서 string이 이뮤터블이 된듯(물론 풀링도 가능하고).. 흐음.. 원본을 두고 사본을 건낸다..
어제 ejb패턴에서도 봤듯.. 서버측에서 데이터에 대해 클라가 요청시 사본을 생성해서 보내주
는 의미를 고민해볼것


lock관련

http://docs.oracle.com/javase/tutorial/essential/concurrency/newlocks.html



동기화 관련

생산자,소비자 패턴


생뚱맞지만.. 예전에 bean xmlencoder xmldecoder .. 스윙 컴포넌트(bean베이스)의 정보를 xml로..


글고 property change 서포터..


오픈소스 관련


************************************************************************************

생뚱2.. 스윙 유틸의 메서드중.. addnotify..  awt.frame -> awt.window -> awt.container -> awt.component까지.. 환장함..

Makes this Component displayable by connecting it to a native screen resource. This method is called internally by 

the toolkit and should not be called directly by programs.
This method changes layout-related information, and therefore, invalidates the component hierarchy.

Since:
JDK1.0

See also:
isDisplayable()
removeNotify()
invalidate()


6855 
6856     public void More ...addNotify() {
6857         synchronized (getTreeLock()) {
6858             ComponentPeer peer = this.peer;
6859             if (peer == null || peer instanceof LightweightPeer){
6860                 if (peer == null) {
6861                     // Update both the Component's peer variable and the local
6862                     // variable we use for thread safety.
6863                     this.peer = peer = getToolkit().createComponent(this);
6864                 }
6865 
6866                 // This is a lightweight component which means it won't be
6867                 // able to get window-related events by itself.  If any
6868                 // have been enabled, then the nearest native container must
6869                 // be enabled.
6870                 if (parent != null) {
6871                     long mask = 0;
6872                     if ((mouseListener != null) || ((eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0)) {
6873                         mask |= AWTEvent.MOUSE_EVENT_MASK;
6874                     }
6875                     if ((mouseMotionListener != null) ||
6876                         ((eventMask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0)) {
6877                         mask |= AWTEvent.MOUSE_MOTION_EVENT_MASK;
6878                     }
6879                     if ((mouseWheelListener != null ) ||
6880                         ((eventMask & AWTEvent.MOUSE_WHEEL_EVENT_MASK) != 0)) {
6881                         mask |= AWTEvent.MOUSE_WHEEL_EVENT_MASK;
6882                     }
6883                     if (focusListener != null || (eventMask & AWTEvent.FOCUS_EVENT_MASK) != 0) {
6884                         mask |= AWTEvent.FOCUS_EVENT_MASK;
6885                     }
6886                     if (keyListener != null || (eventMask & AWTEvent.KEY_EVENT_MASK) != 0) {
6887                         mask |= AWTEvent.KEY_EVENT_MASK;
6888                     }
6889                     if (mask != 0) {
6890                         parent.proxyEnableEvents(mask);
6891                     }
6892                 }
6893             } else {
6894                 // It's native. If the parent is lightweight it will need some
6895                 // help.
6896                 Container parent = getContainer();
6897                 if (parent != null && parent.isLightweight()) {
6898                     relocateComponent();
6899                     if (!parent.isRecursivelyVisibleUpToHeavyweightContainer())
6900                     {
6901                         peer.setVisible(false);
6902                     }
6903                 }
6904             }
6905             invalidate();
6906 
6907             int npopups = (popups != null? popups.size() : 0);
6908             for (int i = 0 ; i < npopups ; i++) {
6909                 PopupMenu popup = (PopupMenu)popups.elementAt(i);
6910                 popup.addNotify();
6911             }
6912 
6913             if (dropTarget != null) dropTarget.addNotify(peer);
6914 
6915             peerFont = getFont();
6916 
6917             if (getContainer() != null && !isAddNotifyComplete) {
6918                 getContainer().increaseComponentCount(this);
6919             }
6920 
6921 
6922             // Update stacking order
6923             updateZOrder();
6924 
6925             if (!isAddNotifyComplete) {
6926                 mixOnShowing();
6927             }
6928 
6929             isAddNotifyComplete = true;
6930 
6931             if (hierarchyListener != null ||
6932                 (eventMask & AWTEvent.HIERARCHY_EVENT_MASK) != 0 ||
6933                 Toolkit.enabledOnToolkit(AWTEvent.HIERARCHY_EVENT_MASK)) {
6934                 HierarchyEvent e =
6935                     new HierarchyEvent(this, HierarchyEvent.HIERARCHY_CHANGED,
6936                                        this, parent,
6937                                        HierarchyEvent.DISPLAYABILITY_CHANGED |
6938                                        ((isRecursivelyVisible())
6939                                         ? HierarchyEvent.SHOWING_CHANGED
6940                                         : 0));
6941                 dispatchEvent(e);
6942             }
6943         }
6944     }



by givingsheart 2014. 1. 2. 09:40