Source Code Cross Referenced for AnyImpl.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » iiop » any » 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 » EJB Server resin 3.1.5 » resin » com.caucho.iiop.any 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003:         *
004:         * This file is part of Resin(R) Open Source
005:         *
006:         * Each copy or derived work must preserve the copyright notice and this
007:         * notice unmodified.
008:         *
009:         * Resin Open Source is free software; you can redistribute it and/or modify
010:         * it under the terms of the GNU General Public License as published by
011:         * the Free Software Foundation; either version 2 of the License, or
012:         * (at your option) any later version.
013:         *
014:         * Resin Open Source is distributed in the hope that it will be useful,
015:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
016:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017:         * of NON-INFRINGEMENT.  See the GNU General Public License for more
018:         * details.
019:         *
020:         * You should have received a copy of the GNU General Public License
021:         * along with Resin Open Source; if not, write to the
022:         *
023:         *   Free Software Foundation, Inc.
024:         *   59 Temple Place, Suite 330
025:         *   Boston, MA 02111-1307  USA
026:         *
027:         * @author Scott Ferguson
028:         */
029:
030:        package com.caucho.iiop.any;
031:
032:        import org.omg.CORBA.Any;
033:        import org.omg.CORBA.TypeCode;
034:        import org.omg.CORBA.Principal;
035:
036:        import org.omg.CORBA.portable.InputStream;
037:        import org.omg.CORBA.portable.OutputStream;
038:        import org.omg.CORBA.portable.Streamable;
039:
040:        import com.caucho.iiop.IiopReader;
041:        import com.caucho.iiop.IiopWriter;
042:
043:        /**
044:         * Implementation of the IIOP Any
045:         */
046:        public class AnyImpl extends Any {
047:            private TypeCodeFactory _factory;
048:
049:            private TypeCode _typeCode;
050:            private Object _value;
051:
052:            public AnyImpl() {
053:            }
054:
055:            public AnyImpl(TypeCodeFactory factory) {
056:                _factory = factory;
057:            }
058:
059:            public InputStream create_input_stream() {
060:                throw new UnsupportedOperationException();
061:            }
062:
063:            public OutputStream create_output_stream() {
064:                throw new UnsupportedOperationException();
065:            }
066:
067:            public boolean equal(Any any) {
068:                return this  == any;
069:            }
070:
071:            public Any extract_any() {
072:                return (Any) _value;
073:            }
074:
075:            public boolean extract_boolean() {
076:                return (Boolean) _value;
077:            }
078:
079:            public char extract_char() {
080:                return (Character) _value;
081:            }
082:
083:            public double extract_double() {
084:                return (Double) _value;
085:            }
086:
087:            public java.math.BigDecimal extract_fixed() {
088:                return (java.math.BigDecimal) _value;
089:            }
090:
091:            public float extract_float() {
092:                return (Float) _value;
093:            }
094:
095:            public int extract_long() {
096:                return (Integer) _value;
097:            }
098:
099:            public long extract_longlong() {
100:                return (Long) _value;
101:            }
102:
103:            public org.omg.CORBA.Object extract_Object() {
104:                return (org.omg.CORBA.Object) _value;
105:            }
106:
107:            public byte extract_octet() {
108:                return (Byte) _value;
109:            }
110:
111:            public Principal extract_Principal() {
112:                throw new UnsupportedOperationException();
113:            }
114:
115:            public short extract_short() {
116:                return (Short) _value;
117:            }
118:
119:            public Streamable extract_Streamable() {
120:                return (Streamable) _value;
121:            }
122:
123:            public String extract_string() {
124:                return (String) _value;
125:            }
126:
127:            public TypeCode extract_TypeCode() {
128:                return (TypeCode) _value;
129:            }
130:
131:            public int extract_ulong() {
132:                return (Integer) _value;
133:            }
134:
135:            public long extract_ulonglong() {
136:                return (Long) _value;
137:            }
138:
139:            public short extract_ushort() {
140:                return (Short) _value;
141:            }
142:
143:            public java.io.Serializable extract_Value() {
144:                return (java.io.Serializable) _value;
145:            }
146:
147:            public char extract_wchar() {
148:                return (Character) _value;
149:            }
150:
151:            public String extract_wstring() {
152:                return (String) _value;
153:            }
154:
155:            public void insert_any(Any v) {
156:                _value = v;
157:            }
158:
159:            public void insert_boolean(boolean v) {
160:                _typeCode = BooleanTypeCode.TYPE_CODE;
161:                _value = v;
162:            }
163:
164:            public void insert_char(char v) {
165:                _value = v;
166:            }
167:
168:            public void insert_double(double v) {
169:                _value = v;
170:            }
171:
172:            public void insert_fixed(java.math.BigDecimal v) {
173:                _value = v;
174:            }
175:
176:            public void insert_fixed(java.math.BigDecimal v, TypeCode type) {
177:                throw new UnsupportedOperationException();
178:            }
179:
180:            public void insert_float(float v) {
181:                _value = v;
182:            }
183:
184:            public void insert_long(int v) {
185:                _value = v;
186:            }
187:
188:            public void insert_longlong(long v) {
189:                _value = v;
190:            }
191:
192:            public void insert_Object(org.omg.CORBA.Object v) {
193:                _value = v;
194:            }
195:
196:            public void insert_Object(org.omg.CORBA.Object v, TypeCode t) {
197:                _value = v;
198:            }
199:
200:            public void insert_octet(byte v) {
201:                _value = v;
202:            }
203:
204:            public void insert_Principal(Principal v) {
205:                _value = v;
206:            }
207:
208:            public void insert_short(short v) {
209:                _value = v;
210:            }
211:
212:            public void insert_Streamable(Streamable v) {
213:                _value = v;
214:            }
215:
216:            public void insert_string(String v) {
217:                _value = v;
218:            }
219:
220:            public void insert_TypeCode(TypeCode v) {
221:                _value = v;
222:            }
223:
224:            public void insert_ulong(int v) {
225:                _value = v;
226:            }
227:
228:            public void insert_ulonglong(long v) {
229:                _value = v;
230:            }
231:
232:            public void insert_ushort(short v) {
233:                _value = v;
234:            }
235:
236:            public void insert_Value(java.io.Serializable v) {
237:                System.out.println("VALUE: " + v);
238:                _typeCode = _factory.createTypeCode(v.getClass());
239:                _value = v;
240:            }
241:
242:            public void insert_Value(java.io.Serializable v, TypeCode t) {
243:                System.out.println("VALUE1: " + v + " " + t);
244:                _typeCode = t;
245:                _value = v;
246:            }
247:
248:            public void insert_wchar(char v) {
249:                _value = v;
250:            }
251:
252:            public void insert_wstring(String v) {
253:                _value = v;
254:            }
255:
256:            public void read_value(InputStream is, TypeCode typeCode) {
257:                _typeCode = typeCode;
258:
259:                _value = ((AbstractTypeCode) typeCode)
260:                        .readValue((IiopReader) is);
261:            }
262:
263:            public TypeCode type() {
264:                return _typeCode;
265:            }
266:
267:            public void type(TypeCode t) {
268:                _typeCode = t;
269:                _value = null;
270:            }
271:
272:            public void write_value(OutputStream os) {
273:                System.out.println("WRITE: " + _typeCode + " " + _value);
274:                ((AbstractTypeCode) _typeCode).writeValue((IiopWriter) os,
275:                        _value);
276:            }
277:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.