Source Code Cross Referenced for SimpleBean.java in  » Net » Terracotta » com » tctest » spring » bean » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » Terracotta » com.tctest.spring.bean 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice.  All rights reserved.
003:         */
004:        package com.tctest.spring.bean;
005:
006:        import org.springframework.beans.factory.BeanNameAware;
007:
008:        import com.tc.aspectwerkz.proxy.Uuid;
009:
010:        public class SimpleBean implements  ISimpleBean, BeanNameAware {
011:            private transient long id = System.identityHashCode(this )
012:                    + Uuid.newUuid();
013:
014:            private transient long timeStamp = System.currentTimeMillis();
015:            private long sharedId = 0;
016:
017:            private static int instanceCnt = 0;
018:
019:            private static String staticField = null;
020:            private transient String transientField = null;
021:            private String field = null;
022:            private String dsoTransientField = null;
023:
024:            private ISimpleBean sharedRef = null;
025:            private transient ISimpleBean transientRef = null;
026:            private transient ISimpleBean dsoTransientRef = null;
027:
028:            private transient String beanName;
029:
030:            public SimpleBean() {
031:                synchronized (SimpleBean.class) {
032:                    instanceCnt++; // this should have the number of instance in one CL, assuming constructor is invoked
033:                    sharedId = timeStamp;
034:                }
035:            }
036:
037:            public int getInstanceCnt() {
038:                synchronized (SimpleBean.class) {
039:                    return instanceCnt;
040:                }
041:            }
042:
043:            synchronized public String getStaticField() {
044:                return staticField;
045:            }
046:
047:            synchronized public void setStaticField(String staticField) {
048:                SimpleBean.staticField = staticField;
049:            }
050:
051:            synchronized public String getDsoTransientField() {
052:                return dsoTransientField;
053:            }
054:
055:            synchronized public void setDsoTransientField(
056:                    String dsoTransientField) {
057:                this .dsoTransientField = dsoTransientField;
058:            }
059:
060:            synchronized public String getField() {
061:                return field;
062:            }
063:
064:            synchronized public void setField(String field) {
065:                this .field = field;
066:            }
067:
068:            synchronized public ISimpleBean getTransientRef() {
069:                return transientRef;
070:            }
071:
072:            synchronized public void setTransientRef(ISimpleBean transientChild) {
073:                this .transientRef = transientChild;
074:            }
075:
076:            synchronized public String getTransientField() {
077:                return transientField;
078:            }
079:
080:            synchronized public void setTransientField(String transientField) {
081:                this .transientField = transientField;
082:            }
083:
084:            public int getHashCode() {
085:                return hashCode();
086:            }
087:
088:            synchronized public long getId() {
089:                return id;
090:            }
091:
092:            synchronized public long getSharedId() {
093:                return sharedId;
094:            }
095:
096:            synchronized public void setSharedId(long sharedId) {
097:                this .sharedId = sharedId;
098:            }
099:
100:            synchronized public ISimpleBean getDsoTransientRef() {
101:                return dsoTransientRef;
102:            }
103:
104:            synchronized public void setDsoTransientRef(
105:                    ISimpleBean dsoTransientRef) {
106:                this .dsoTransientRef = dsoTransientRef;
107:            }
108:
109:            synchronized public long getSharedRefId() {
110:                return this .sharedRef == null ? -1 : sharedRef.getId();
111:            }
112:
113:            synchronized public ISimpleBean getSharedRef() {
114:                return sharedRef;
115:            }
116:
117:            synchronized public void setSharedRef(ISimpleBean sharedRef) {
118:                this .sharedRef = sharedRef;
119:            }
120:
121:            public long getTimeStamp() {
122:                return timeStamp;
123:            }
124:
125:            public static class SBParent extends SimpleBean {
126:                static private int myInstanceCnt = 0;
127:
128:                public SBParent() {
129:                    synchronized (SimpleBean.class) {
130:                        myInstanceCnt++; // this should have the number of instance of this subtype in one CL, assuming constructor is invoked
131:                    }
132:                }
133:
134:                public int getInstanceCnt() {
135:                    synchronized (SimpleBean.class) {
136:                        return myInstanceCnt;
137:                    }
138:                }
139:            }
140:
141:            public String getBeanName() {
142:                return beanName;
143:            }
144:
145:            public void setBeanName(String beanName) {
146:                this.beanName = beanName;
147:            }
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.