Source Code Cross Referenced for MyRemoteObject.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » rmi » test » 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 » Apache Harmony Java SE » org package » org.apache.harmony.rmi.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License.
017:         */
018:
019:        /**
020:         * @author  Mikhail A. Markov, Vasily Zakharov
021:         * @version $Revision: 1.1.2.1 $
022:         */package org.apache.harmony.rmi.test;
023:
024:        import java.rmi.Remote;
025:        import java.rmi.RemoteException;
026:
027:        import java.rmi.server.UnicastRemoteObject;
028:
029:        /**
030:         * @author  Mikhail A. Markov, Vasily Zakharov
031:         * @version $Revision: 1.1.2.1 $
032:         */
033:        public class MyRemoteObject extends UnicastRemoteObject implements 
034:                MyRemoteInterface {
035:
036:            public MyRemoteObject() throws RemoteException {
037:                super ();
038:            }
039:
040:            public void test_String_Void(String param) throws RemoteException {
041:                System.out.println("MyRemoteObject: test_String_Void: param = "
042:                        + param);
043:            }
044:
045:            public String test_Void_String() throws RemoteException {
046:                System.out.println("MyRemoteObject: test_Void_String");
047:                return "MyRemoteObject.test_Void_String";
048:            }
049:
050:            public void test_Int_Void(int param) throws RemoteException {
051:                System.out.println("MyRemoteObject: test_Int_Void: param = "
052:                        + param);
053:            }
054:
055:            public int test_Void_Int() throws RemoteException {
056:                System.out.println("MyRemoteObject: test_Void_Int");
057:                return 987654321;
058:            }
059:
060:            public void test_Remote_Void(Remote param) throws RemoteException {
061:                System.out.println("MyRemoteObject: test_Remote_Void: param = "
062:                        + param);
063:                System.out.println("Call param.test method: "
064:                        + ((MyRemoteInterface1) param).test1());
065:            }
066:
067:            public void test_UnicastRemoteObject_Void(Remote param)
068:                    throws RemoteException {
069:                System.out
070:                        .println("MyRemoteObject: test_UnicastRemoteObject_Void: param = "
071:                                + param);
072:            }
073:
074:            public Remote test_Void_Remote() throws RemoteException {
075:                System.out.println("MyRemoteObject: test_Void_Remote");
076:                return new MyRemoteObject2("MyRemoteObject.test_Void_Remote");
077:            }
078:
079:            public long test_Long_Long(long param) throws RemoteException {
080:                System.out.println("MyRemoteObject: test_Long_Long: param = "
081:                        + param);
082:                return 998877665544332211L;
083:            }
084:
085:            public String test_String_String(String param)
086:                    throws RemoteException {
087:                System.out
088:                        .println("MyRemoteObject: test_String_String: param = "
089:                                + param);
090:                return "MyRemoteObject.test_String_String";
091:            }
092:
093:            public Remote test_Remote_Remote(Remote param)
094:                    throws RemoteException {
095:                System.out
096:                        .println("MyRemoteObject: test_Remote_Remote: param = "
097:                                + param);
098:                System.out.println("Call param.test method: "
099:                        + ((MyRemoteInterface1) param).test1());
100:                return new MyRemoteObject2("MyRemoteObject.test_Remote_Remote");
101:            }
102:
103:            public void test_RemoteString_Void(Remote param1, String param2)
104:                    throws RemoteException {
105:                System.out
106:                        .println("MyRemoteObject: test_RemoteString_Void: param1 = "
107:                                + param1 + ", param2 = " + param2);
108:                System.out.println("Call param1.test method: "
109:                        + ((MyRemoteInterface1) param1).test1());
110:            }
111:
112:            public Remote test_RemoteRemote_Remote(Remote param1, Remote param2)
113:                    throws RemoteException {
114:                System.out
115:                        .println("MyRemoteObject: test_RemoteRemote_Remote: param1 = "
116:                                + param1 + ", param2 = " + param2);
117:                System.out.println("Call param1.test method: "
118:                        + ((MyRemoteInterface1) param1).test1());
119:                System.out.println("Call param2.test method: "
120:                        + ((MyRemoteInterface3) param2).test3());
121:                return new MyRemoteObject2(
122:                        "MyRemoteObject.test_RemoteRemote_Remote");
123:            }
124:
125:            public void test_BooleanStringRemote_Void(boolean param1,
126:                    String param2, Remote param3) throws RemoteException {
127:                System.out
128:                        .println("MyRemoteObject: test_BooleanStringRemote_Void: "
129:                                + "param1 = "
130:                                + param1
131:                                + ", param2 = "
132:                                + param2
133:                                + ", param3 = " + param3);
134:                System.out.println("Call param3.test method: "
135:                        + ((MyRemoteInterface1) param3).test1());
136:            }
137:
138:            public void test_Proxy_Void(Object param) throws RemoteException {
139:                System.out.println("MyRemoteObject: test_Proxy_Void: param = "
140:                        + param);
141:            }
142:
143:            public void test_IntArray_Void(int[] param) throws RemoteException {
144:                System.out
145:                        .println("MyRemoteObject: test_IntArray_Void: param = ");
146:                printIntArray(param);
147:            }
148:
149:            public int[] test_Void_IntArray() throws RemoteException {
150:                System.out.println("MyRemoteObject: test_Void_IntArray");
151:                return new int[] { 1, 2 };
152:            }
153:
154:            public void test_Array_Void(String[] param) throws RemoteException {
155:                System.out.println("MyRemoteObject: test_Array_Void: param = ");
156:                printArray(param);
157:            }
158:
159:            public String[] test_Void_Array() throws RemoteException {
160:                System.out.println("MyRemoteObject: test_Void_Array");
161:                return new String[] { "MyRemoteObject.test_Void_Array 1",
162:                        "MyRemoteObject.test_Void_Array 2" };
163:            }
164:
165:            public void test_RemoteArray_Void(Remote[] param)
166:                    throws RemoteException {
167:                System.out
168:                        .println("MyRemoteObject: test_RemoteArray_Void: param = ");
169:                printArray(param);
170:            }
171:
172:            public Remote[] test_Void_RemoteArray() throws RemoteException {
173:                System.out.println("MyRemoteObject: test_Void_RemoteArray");
174:                return new Remote[] {
175:                        new MyRemoteObject1(
176:                                "MyRemoteObject.test_Void_RemoteArray 1"),
177:                        new MyRemoteObject1(
178:                                "MyRemoteObject.test_Void_RemoteArray 2") };
179:            }
180:
181:            public void test_Exception() throws RemoteException, MyException {
182:                System.out.println("MyRemoteObject: test_Exception");
183:                throw new MyException("MyRemoteObject.test_Exception");
184:            }
185:
186:            public void test_Error() throws RemoteException, MyException {
187:                System.out.println("MyRemoteObject: test_Error");
188:                throw new Error("MyRemoteObject.test_Error");
189:            }
190:
191:            public void test_RuntimeException() throws RemoteException,
192:                    MyException {
193:                System.out.println("MyRemoteObject: test_RuntimeException");
194:                throw new RuntimeException(
195:                        "MyRemoteObject.text_RuntimeException");
196:            }
197:
198:            public void test_RemoteException() throws RemoteException {
199:                System.out.println("MyRemoteObject: test_RemoteException");
200:                throw new RemoteException("MyRemoteObject.text_RemoteException");
201:            }
202:
203:            public static void printArray(Object[] objs) {
204:                if (objs == null) {
205:                    System.out.println("    Array is NULL.");
206:                }
207:
208:                for (int i = 0; i < objs.length; ++i) {
209:                    System.out.println("    " + objs[i]);
210:                }
211:            }
212:
213:            public static void printIntArray(int[] arr) {
214:                if (arr == null) {
215:                    System.out.println("    Int Array is NULL.");
216:                }
217:
218:                for (int i = 0; i < arr.length; ++i) {
219:                    System.out.println("    " + arr[i]);
220:                }
221:            }
222:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.