Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
4ea64e75
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4ea64e75
编写于
5月 19, 2015
作者:
M
msheppar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8068721: RMI-IIOP communication fails when ConcurrentHashMap is passed to remote method
Reviewed-by: chegar, alanb
上级
8b13914c
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
759 addition
and
2 deletion
+759
-2
test/TEST.ROOT
test/TEST.ROOT
+1
-1
test/TEST.groups
test/TEST.groups
+1
-1
test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java
...javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java
+143
-0
test/javax/rmi/PortableRemoteObject/HelloClient.java
test/javax/rmi/PortableRemoteObject/HelloClient.java
+98
-0
test/javax/rmi/PortableRemoteObject/HelloImpl.java
test/javax/rmi/PortableRemoteObject/HelloImpl.java
+60
-0
test/javax/rmi/PortableRemoteObject/HelloInterface.java
test/javax/rmi/PortableRemoteObject/HelloInterface.java
+14
-0
test/javax/rmi/PortableRemoteObject/HelloServer.java
test/javax/rmi/PortableRemoteObject/HelloServer.java
+36
-0
test/javax/rmi/PortableRemoteObject/Test.java
test/javax/rmi/PortableRemoteObject/Test.java
+6
-0
test/javax/rmi/PortableRemoteObject/_HelloImpl_Tie.java
test/javax/rmi/PortableRemoteObject/_HelloImpl_Tie.java
+128
-0
test/javax/rmi/PortableRemoteObject/_HelloInterface_Stub.java
.../javax/rmi/PortableRemoteObject/_HelloInterface_Stub.java
+272
-0
未找到文件。
test/TEST.ROOT
浏览文件 @
4ea64e75
...
...
@@ -8,7 +8,7 @@ keys=2d dnd i18n
othervm.dirs=java/awt java/beans java/rmi javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces sun/rmi
# Tests that cannot run concurrently
exclusiveAccess.dirs=java/rmi/Naming java/util/Currency java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi
exclusiveAccess.dirs=java/rmi/Naming java/util/Currency java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi
javax/rmi
# Group definitions
groups=TEST.groups [closed/TEST.groups]
test/TEST.groups
浏览文件 @
4ea64e75
...
...
@@ -111,7 +111,6 @@ jdk_time = \
jdk_rmi = \
java/rmi \
javax/rmi/ssl \
sun/rmi
jdk_security1 = \
...
...
@@ -195,6 +194,7 @@ jdk_tools = \
jdk_other = \
java/sql \
javax/sql \
javax/rmi \
javax/naming \
javax/script \
javax/smartcardio \
...
...
test/javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java
0 → 100644
浏览文件 @
4ea64e75
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8068721
* @summary test RMI-IIOP call with ConcurrentHashMap as an argument
* @library /lib/testlibrary
* @build jdk.testlibrary.*
* @build Test HelloInterface HelloServer HelloClient HelloImpl _HelloImpl_Tie _HelloInterface_Stub ConcurrentHashMapTest
* @run main/othervm -Djava.naming.provider.url=iiop://localhost:1050 -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory ConcurrentHashMapTest
*/
import
java.io.DataInputStream
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.CountDownLatch
;
import
jdk.testlibrary.JDKToolFinder
;
import
jdk.testlibrary.JDKToolLauncher
;
public
class
ConcurrentHashMapTest
{
static
final
String
ORBD
=
JDKToolFinder
.
getTestJDKTool
(
"orbd"
);
static
final
String
JAVA
=
JDKToolFinder
.
getTestJDKTool
(
"java"
);
static
final
JDKToolLauncher
orbdLauncher
=
JDKToolLauncher
.
createUsingTestJDK
(
"orbd"
);
static
final
String
CLASSPATH
=
System
.
getProperty
(
"java.class.path"
);
static
final
int
FIVE_SECONDS
=
5000
;
private
static
Exception
clientException
;
private
static
boolean
exceptionInClient
;
private
static
Process
orbdProcess
;
private
static
Process
rmiServerProcess
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
startTestComponents
();
stopTestComponents
();
System
.
err
.
println
(
"Test completed OK "
);
}
static
void
startTestComponents
()
throws
Exception
{
startOrbd
();
Thread
.
sleep
(
FIVE_SECONDS
);
startRmiIiopServer
();
Thread
.
sleep
(
FIVE_SECONDS
);
executeRmiIiopClient
();
}
private
static
void
stopTestComponents
()
throws
Exception
{
stopRmiIiopServer
();
stopOrbd
();
if
(
exceptionInClient
)
{
throw
new
RuntimeException
(
clientException
);
}
else
if
(!
isResponseReceived
())
{
throw
new
RuntimeException
(
"Expected Response not received"
);
}
}
static
void
startOrbd
()
throws
Exception
{
System
.
out
.
println
(
"\nStarting orbd on port 1050 "
);
//orbd -ORBInitialHost localhost -ORBInitialPort 1050
orbdLauncher
.
addToolArg
(
"-ORBInitialHost"
).
addToolArg
(
"localhost"
)
.
addToolArg
(
"-ORBInitialPort"
).
addToolArg
(
"1050"
);
System
.
out
.
println
(
"ConcurrentHashMapTest: Executing: "
+
Arrays
.
asList
(
orbdLauncher
.
getCommand
()));
ProcessBuilder
pb
=
new
ProcessBuilder
(
orbdLauncher
.
getCommand
());
pb
.
redirectError
(
ProcessBuilder
.
Redirect
.
INHERIT
);
orbdProcess
=
pb
.
start
();
}
static
void
startRmiIiopServer
()
throws
Exception
{
System
.
out
.
println
(
"\nStarting RmiServer"
);
// java -cp .
// -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
// -Djava.naming.provider.url=iiop://localhost:1050 HelloServer
List
<
String
>
commands
=
new
ArrayList
<>();
commands
.
add
(
ConcurrentHashMapTest
.
JAVA
);
commands
.
add
(
"-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory"
);
commands
.
add
(
"-Djava.naming.provider.url=iiop://localhost:1050"
);
commands
.
add
(
"-cp"
);
commands
.
add
(
ConcurrentHashMapTest
.
CLASSPATH
);
commands
.
add
(
"HelloServer"
);
System
.
out
.
println
(
"ConcurrentHashMapTest: Executing: "
+
commands
);
ProcessBuilder
pb
=
new
ProcessBuilder
(
commands
);
pb
.
redirectError
(
ProcessBuilder
.
Redirect
.
INHERIT
);
rmiServerProcess
=
pb
.
start
();
}
static
boolean
isResponseReceived
()
{
return
HelloClient
.
isResponseReceived
();
}
static
void
stopRmiIiopServer
()
throws
Exception
{
rmiServerProcess
.
destroy
();
rmiServerProcess
.
waitFor
();
//rmiServerProcess.waitFor(30, TimeUnit.SECONDS);
System
.
out
.
println
(
"serverProcess exitCode:"
+
rmiServerProcess
.
exitValue
());
}
static
void
stopOrbd
()
throws
Exception
{
orbdProcess
.
destroy
();
orbdProcess
.
waitFor
();
//orbdProcess.waitFor(30, TimeUnit.SECONDS);
System
.
out
.
println
(
"orbd exitCode:"
+
orbdProcess
.
exitValue
());
}
static
void
executeRmiIiopClient
()
throws
Exception
{
try
{
HelloClient
.
executeRmiClientCall
();
}
catch
(
Exception
ex
)
{
clientException
=
ex
;
exceptionInClient
=
true
;
}
}
}
test/javax/rmi/PortableRemoteObject/HelloClient.java
0 → 100644
浏览文件 @
4ea64e75
import
java.rmi.RemoteException
;
import
java.net.InetAddress
;
import
java.net.MalformedURLException
;
import
java.rmi.NotBoundException
;
import
java.util.HashMap
;
import
java.util.Vector
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.locks.ReentrantLock
;
import
javax.naming.NamingException
;
import
javax.naming.InitialContext
;
import
javax.naming.Context
;
import
javax.naming.NameNotFoundException
;
import
javax.naming.NamingException
;
import
javax.rmi.PortableRemoteObject
;
import
org.omg.CORBA.Any
;
import
org.omg.CORBA.ORB
;
public
class
HelloClient
implements
Runnable
{
static
final
int
MAX_RETRY
=
10
;
static
final
int
ONE_SECOND
=
1000
;
private
static
boolean
responseReceived
;
public
static
void
main
(
String
args
[])
throws
Exception
{
executeRmiClientCall
();
}
@Override
public
void
run
()
{
try
{
executeRmiClientCall
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
e
);
}
}
public
static
boolean
isResponseReceived
()
{
return
responseReceived
;
}
public
static
void
executeRmiClientCall
()
throws
Exception
{
Context
ic
;
Object
objref
;
HelloInterface
helloSvc
;
String
response
;
int
retryCount
=
0
;
Test
test
=
new
Test
();
System
.
out
.
println
(
"HelloClient.main: enter ..."
);
while
(
retryCount
<
MAX_RETRY
)
{
try
{
ic
=
new
InitialContext
();
System
.
out
.
println
(
"HelloClient.main: HelloService lookup ..."
);
// STEP 1: Get the Object reference from the Name Service
// using JNDI call.
objref
=
ic
.
lookup
(
"HelloService"
);
System
.
out
.
println
(
"HelloClient: Obtained a ref. to Hello server."
);
// STEP 2: Narrow the object reference to the concrete type and
// invoke the method.
helloSvc
=
(
HelloInterface
)
PortableRemoteObject
.
narrow
(
objref
,
HelloInterface
.
class
);
System
.
out
.
println
(
"HelloClient: Invoking on remote server with ConcurrentHashMap parameter"
);
ConcurrentHashMap
<
String
,
String
>
testConcurrentHashMap
=
new
ConcurrentHashMap
<
String
,
String
>();
response
=
helloSvc
.
sayHelloWithHashMap
(
testConcurrentHashMap
);
System
.
out
.
println
(
"HelloClient: Server says: "
+
response
);
if
(!
response
.
contains
(
"Hello with hashMapSize =="
))
{
System
.
out
.
println
(
"HelloClient: expected response not received"
);
throw
new
RuntimeException
(
"Expected Response Hello with hashMapSize == 0 not received"
);
}
responseReceived
=
true
;
break
;
}
catch
(
NameNotFoundException
nnfEx
)
{
System
.
err
.
println
(
"NameNotFoundException Caught .... try again"
);
retryCount
++;
try
{
Thread
.
sleep
(
ONE_SECOND
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
continue
;
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
"Exception "
+
e
+
"Caught"
);
e
.
printStackTrace
();
throw
new
RuntimeException
(
e
);
}
}
System
.
err
.
println
(
"HelloClient terminating "
);
try
{
Thread
.
sleep
(
5000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
test/javax/rmi/PortableRemoteObject/HelloImpl.java
0 → 100644
浏览文件 @
4ea64e75
import
java.net.InetAddress
;
import
java.rmi.RemoteException
;
import
java.util.HashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.locks.ReentrantLock
;
import
javax.rmi.PortableRemoteObject
;
public
class
HelloImpl
extends
PortableRemoteObject
implements
HelloInterface
{
public
HelloImpl
()
throws
java
.
rmi
.
RemoteException
{
super
();
// invoke rmi linking and remote object initialization
}
public
String
sayHello
(
String
from
)
throws
java
.
rmi
.
RemoteException
{
System
.
out
.
println
(
"Hello from "
+
from
+
"!!"
);
System
.
out
.
flush
();
String
reply
=
"Hello from us to you "
+
from
;
return
reply
;
}
@Override
public
String
sayHelloToTest
(
Test
test
)
throws
RemoteException
{
return
"Test says Hello"
;
}
@Override
public
String
sayHelloWithInetAddress
(
InetAddress
ipAddr
)
throws
RemoteException
{
String
response
=
"Hello with InetAddress "
+
ipAddr
.
toString
();
return
response
;
}
@Override
public
String
sayHelloWithHashMap
(
ConcurrentHashMap
<
String
,
String
>
receivedHashMap
)
throws
RemoteException
{
int
hashMapSize
=
0
;
hashMapSize
=
receivedHashMap
.
size
();
String
response
=
"Hello with hashMapSize == "
+
hashMapSize
;
return
response
;
}
@Override
public
String
sayHelloWithHashMap2
(
HashMap
<
String
,
String
>
receivedHashMap
)
throws
RemoteException
{
int
hashMapSize
=
0
;
hashMapSize
=
receivedHashMap
.
size
();
String
response
=
"Hello with hashMapSize == "
+
hashMapSize
;
return
response
;
}
@Override
public
String
sayHelloWithReentrantLock
(
ReentrantLock
receivedLock
)
throws
RemoteException
{
String
response
=
"Hello with lock == "
+
receivedLock
.
isLocked
();
return
response
;
}
}
test/javax/rmi/PortableRemoteObject/HelloInterface.java
0 → 100644
浏览文件 @
4ea64e75
import
java.net.InetAddress
;
import
java.rmi.Remote
;
import
java.util.HashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.locks.ReentrantLock
;
public
interface
HelloInterface
extends
Remote
{
public
String
sayHello
(
String
from
)
throws
java
.
rmi
.
RemoteException
;
public
String
sayHelloToTest
(
Test
test
)
throws
java
.
rmi
.
RemoteException
;
public
String
sayHelloWithInetAddress
(
InetAddress
ipAddr
)
throws
java
.
rmi
.
RemoteException
;
public
String
sayHelloWithHashMap
(
ConcurrentHashMap
<
String
,
String
>
hashMap
)
throws
java
.
rmi
.
RemoteException
;
public
String
sayHelloWithHashMap2
(
HashMap
<
String
,
String
>
hashMap
)
throws
java
.
rmi
.
RemoteException
;
public
String
sayHelloWithReentrantLock
(
ReentrantLock
lock
)
throws
java
.
rmi
.
RemoteException
;
}
test/javax/rmi/PortableRemoteObject/HelloServer.java
0 → 100644
浏览文件 @
4ea64e75
import
javax.naming.InitialContext
;
import
javax.naming.Context
;
public
class
HelloServer
{
static
final
int
MAX_RETRY
=
10
;
static
final
int
ONE_SECOND
=
1000
;
public
static
void
main
(
String
[]
args
)
{
int
retryCount
=
0
;
while
(
retryCount
<
MAX_RETRY
)
{
try
{
//HelloServer.set("SETTING TEST ITL");
// Step 1: Instantiate the Hello servant
HelloImpl
helloRef
=
new
HelloImpl
();
// Step 2: Publish the reference in the Naming Service
// using JNDI API
Context
initialNamingContext
=
new
InitialContext
();
initialNamingContext
.
rebind
(
"HelloService"
,
helloRef
);
System
.
out
.
println
(
"Hello Server: Ready..."
);
break
;
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Server initialization problem: "
+
e
);
e
.
printStackTrace
();
retryCount
++;
try
{
Thread
.
sleep
(
ONE_SECOND
);
}
catch
(
InterruptedException
e1
)
{
e1
.
printStackTrace
();
}
}
}
}
}
test/javax/rmi/PortableRemoteObject/Test.java
0 → 100644
浏览文件 @
4ea64e75
import
java.io.Serializable
;
public
class
Test
implements
Serializable
{
}
test/javax/rmi/PortableRemoteObject/_HelloImpl_Tie.java
0 → 100644
浏览文件 @
4ea64e75
// Tie class generated by rmic, do not edit.
// Contents subject to change without notice.
import
java.io.Serializable
;
import
java.net.InetAddress
;
import
java.rmi.Remote
;
import
java.rmi.RemoteException
;
import
java.util.HashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.locks.ReentrantLock
;
import
javax.rmi.CORBA.Tie
;
import
javax.rmi.CORBA.Util
;
import
org.omg.CORBA.BAD_OPERATION
;
import
org.omg.CORBA.ORB
;
import
org.omg.CORBA.SystemException
;
import
org.omg.CORBA.portable.InputStream
;
import
org.omg.CORBA.portable.OutputStream
;
import
org.omg.CORBA.portable.ResponseHandler
;
import
org.omg.CORBA.portable.UnknownException
;
import
org.omg.CORBA_2_3.portable.ObjectImpl
;
public
class
_HelloImpl_Tie
extends
ObjectImpl
implements
Tie
{
private
HelloImpl
target
=
null
;
private
static
final
String
[]
_type_ids
=
{
"RMI:HelloInterface:0000000000000000"
};
public
void
setTarget
(
Remote
target
)
{
this
.
target
=
(
HelloImpl
)
target
;
}
public
Remote
getTarget
()
{
return
target
;
}
public
org
.
omg
.
CORBA
.
Object
thisObject
()
{
return
this
;
}
public
void
deactivate
()
{
_orb
().
disconnect
(
this
);
_set_delegate
(
null
);
target
=
null
;
}
public
ORB
orb
()
{
return
_orb
();
}
public
void
orb
(
ORB
orb
)
{
orb
.
connect
(
this
);
}
public
String
[]
_ids
()
{
return
(
String
[])
_type_ids
.
clone
();
}
public
OutputStream
_invoke
(
String
method
,
InputStream
_in
,
ResponseHandler
reply
)
throws
SystemException
{
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
_in
;
switch
(
method
.
length
())
{
case
8
:
if
(
method
.
equals
(
"sayHello"
))
{
String
arg0
=
(
String
)
in
.
read_value
(
String
.
class
);
String
result
=
target
.
sayHello
(
arg0
);
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
reply
.
createReply
();
out
.
write_value
(
result
,
String
.
class
);
return
out
;
}
case
14
:
if
(
method
.
equals
(
"sayHelloToTest"
))
{
Test
arg0
=
(
Test
)
in
.
read_value
(
Test
.
class
);
String
result
=
target
.
sayHelloToTest
(
arg0
);
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
reply
.
createReply
();
out
.
write_value
(
result
,
String
.
class
);
return
out
;
}
case
19
:
if
(
method
.
equals
(
"sayHelloWithHashMap"
))
{
ConcurrentHashMap
arg0
=
(
ConcurrentHashMap
)
in
.
read_value
(
ConcurrentHashMap
.
class
);
String
result
=
target
.
sayHelloWithHashMap
(
arg0
);
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
reply
.
createReply
();
out
.
write_value
(
result
,
String
.
class
);
return
out
;
}
case
20
:
if
(
method
.
equals
(
"sayHelloWithHashMap2"
))
{
HashMap
arg0
=
(
HashMap
)
in
.
read_value
(
HashMap
.
class
);
String
result
=
target
.
sayHelloWithHashMap2
(
arg0
);
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
reply
.
createReply
();
out
.
write_value
(
result
,
String
.
class
);
return
out
;
}
case
23
:
if
(
method
.
equals
(
"sayHelloWithInetAddress"
))
{
InetAddress
arg0
=
(
InetAddress
)
in
.
read_value
(
InetAddress
.
class
);
String
result
=
target
.
sayHelloWithInetAddress
(
arg0
);
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
reply
.
createReply
();
out
.
write_value
(
result
,
String
.
class
);
return
out
;
}
case
25
:
if
(
method
.
equals
(
"sayHelloWithReentrantLock"
))
{
ReentrantLock
arg0
=
(
ReentrantLock
)
in
.
read_value
(
ReentrantLock
.
class
);
String
result
=
target
.
sayHelloWithReentrantLock
(
arg0
);
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
reply
.
createReply
();
out
.
write_value
(
result
,
String
.
class
);
return
out
;
}
}
throw
new
BAD_OPERATION
();
}
catch
(
SystemException
ex
)
{
throw
ex
;
}
catch
(
Throwable
ex
)
{
throw
new
UnknownException
(
ex
);
}
}
}
test/javax/rmi/PortableRemoteObject/_HelloInterface_Stub.java
0 → 100644
浏览文件 @
4ea64e75
// Stub class generated by rmic, do not edit.
// Contents subject to change without notice.
import
java.io.Serializable
;
import
java.net.InetAddress
;
import
java.rmi.Remote
;
import
java.rmi.RemoteException
;
import
java.rmi.UnexpectedException
;
import
java.util.HashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.locks.ReentrantLock
;
import
javax.rmi.CORBA.Stub
;
import
javax.rmi.CORBA.Util
;
import
org.omg.CORBA.ORB
;
import
org.omg.CORBA.SystemException
;
import
org.omg.CORBA.portable.ApplicationException
;
import
org.omg.CORBA.portable.InputStream
;
import
org.omg.CORBA.portable.OutputStream
;
import
org.omg.CORBA.portable.RemarshalException
;
import
org.omg.CORBA.portable.ResponseHandler
;
import
org.omg.CORBA.portable.ServantObject
;
public
class
_HelloInterface_Stub
extends
Stub
implements
HelloInterface
{
private
static
final
String
[]
_type_ids
=
{
"RMI:HelloInterface:0000000000000000"
};
public
String
[]
_ids
()
{
return
(
String
[])
_type_ids
.
clone
();
}
public
String
sayHello
(
String
arg0
)
throws
java
.
rmi
.
RemoteException
{
if
(!
Util
.
isLocal
(
this
))
{
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
in
=
null
;
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
_request
(
"sayHello"
,
true
);
out
.
write_value
(
arg0
,
String
.
class
);
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
_invoke
(
out
);
return
(
String
)
in
.
read_value
(
String
.
class
);
}
catch
(
ApplicationException
ex
)
{
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
ex
.
getInputStream
();
String
$_id
=
in
.
read_string
();
throw
new
UnexpectedException
(
$_id
);
}
catch
(
RemarshalException
ex
)
{
return
sayHello
(
arg0
);
}
finally
{
_releaseReply
(
in
);
}
}
catch
(
SystemException
ex
)
{
throw
Util
.
mapSystemException
(
ex
);
}
}
else
{
ServantObject
so
=
_servant_preinvoke
(
"sayHello"
,
HelloInterface
.
class
);
if
(
so
==
null
)
{
return
sayHello
(
arg0
);
}
try
{
return
((
HelloInterface
)
so
.
servant
).
sayHello
(
arg0
);
}
catch
(
Throwable
ex
)
{
Throwable
exCopy
=
(
Throwable
)
Util
.
copyObject
(
ex
,
_orb
());
throw
Util
.
wrapException
(
exCopy
);
}
finally
{
_servant_postinvoke
(
so
);
}
}
}
public
String
sayHelloToTest
(
Test
arg0
)
throws
java
.
rmi
.
RemoteException
{
if
(!
Util
.
isLocal
(
this
))
{
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
in
=
null
;
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
_request
(
"sayHelloToTest"
,
true
);
out
.
write_value
(
arg0
,
Test
.
class
);
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
_invoke
(
out
);
return
(
String
)
in
.
read_value
(
String
.
class
);
}
catch
(
ApplicationException
ex
)
{
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
ex
.
getInputStream
();
String
$_id
=
in
.
read_string
();
throw
new
UnexpectedException
(
$_id
);
}
catch
(
RemarshalException
ex
)
{
return
sayHelloToTest
(
arg0
);
}
finally
{
_releaseReply
(
in
);
}
}
catch
(
SystemException
ex
)
{
throw
Util
.
mapSystemException
(
ex
);
}
}
else
{
ServantObject
so
=
_servant_preinvoke
(
"sayHelloToTest"
,
HelloInterface
.
class
);
if
(
so
==
null
)
{
return
sayHelloToTest
(
arg0
);
}
try
{
Test
arg0Copy
=
(
Test
)
Util
.
copyObject
(
arg0
,
_orb
());
return
((
HelloInterface
)
so
.
servant
).
sayHelloToTest
(
arg0Copy
);
}
catch
(
Throwable
ex
)
{
Throwable
exCopy
=
(
Throwable
)
Util
.
copyObject
(
ex
,
_orb
());
throw
Util
.
wrapException
(
exCopy
);
}
finally
{
_servant_postinvoke
(
so
);
}
}
}
public
String
sayHelloWithInetAddress
(
InetAddress
arg0
)
throws
java
.
rmi
.
RemoteException
{
if
(!
Util
.
isLocal
(
this
))
{
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
in
=
null
;
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
_request
(
"sayHelloWithInetAddress"
,
true
);
out
.
write_value
(
arg0
,
InetAddress
.
class
);
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
_invoke
(
out
);
return
(
String
)
in
.
read_value
(
String
.
class
);
}
catch
(
ApplicationException
ex
)
{
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
ex
.
getInputStream
();
String
$_id
=
in
.
read_string
();
throw
new
UnexpectedException
(
$_id
);
}
catch
(
RemarshalException
ex
)
{
return
sayHelloWithInetAddress
(
arg0
);
}
finally
{
_releaseReply
(
in
);
}
}
catch
(
SystemException
ex
)
{
throw
Util
.
mapSystemException
(
ex
);
}
}
else
{
ServantObject
so
=
_servant_preinvoke
(
"sayHelloWithInetAddress"
,
HelloInterface
.
class
);
if
(
so
==
null
)
{
return
sayHelloWithInetAddress
(
arg0
);
}
try
{
InetAddress
arg0Copy
=
(
InetAddress
)
Util
.
copyObject
(
arg0
,
_orb
());
return
((
HelloInterface
)
so
.
servant
).
sayHelloWithInetAddress
(
arg0Copy
);
}
catch
(
Throwable
ex
)
{
Throwable
exCopy
=
(
Throwable
)
Util
.
copyObject
(
ex
,
_orb
());
throw
Util
.
wrapException
(
exCopy
);
}
finally
{
_servant_postinvoke
(
so
);
}
}
}
public
String
sayHelloWithHashMap
(
ConcurrentHashMap
arg0
)
throws
java
.
rmi
.
RemoteException
{
if
(!
Util
.
isLocal
(
this
))
{
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
in
=
null
;
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
_request
(
"sayHelloWithHashMap"
,
true
);
out
.
write_value
(
arg0
,
ConcurrentHashMap
.
class
);
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
_invoke
(
out
);
return
(
String
)
in
.
read_value
(
String
.
class
);
}
catch
(
ApplicationException
ex
)
{
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
ex
.
getInputStream
();
String
$_id
=
in
.
read_string
();
throw
new
UnexpectedException
(
$_id
);
}
catch
(
RemarshalException
ex
)
{
return
sayHelloWithHashMap
(
arg0
);
}
finally
{
_releaseReply
(
in
);
}
}
catch
(
SystemException
ex
)
{
throw
Util
.
mapSystemException
(
ex
);
}
}
else
{
ServantObject
so
=
_servant_preinvoke
(
"sayHelloWithHashMap"
,
HelloInterface
.
class
);
if
(
so
==
null
)
{
return
sayHelloWithHashMap
(
arg0
);
}
try
{
ConcurrentHashMap
arg0Copy
=
(
ConcurrentHashMap
)
Util
.
copyObject
(
arg0
,
_orb
());
return
((
HelloInterface
)
so
.
servant
).
sayHelloWithHashMap
(
arg0Copy
);
}
catch
(
Throwable
ex
)
{
Throwable
exCopy
=
(
Throwable
)
Util
.
copyObject
(
ex
,
_orb
());
throw
Util
.
wrapException
(
exCopy
);
}
finally
{
_servant_postinvoke
(
so
);
}
}
}
public
String
sayHelloWithHashMap2
(
HashMap
arg0
)
throws
java
.
rmi
.
RemoteException
{
if
(!
Util
.
isLocal
(
this
))
{
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
in
=
null
;
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
_request
(
"sayHelloWithHashMap2"
,
true
);
out
.
write_value
(
arg0
,
HashMap
.
class
);
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
_invoke
(
out
);
return
(
String
)
in
.
read_value
(
String
.
class
);
}
catch
(
ApplicationException
ex
)
{
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
ex
.
getInputStream
();
String
$_id
=
in
.
read_string
();
throw
new
UnexpectedException
(
$_id
);
}
catch
(
RemarshalException
ex
)
{
return
sayHelloWithHashMap2
(
arg0
);
}
finally
{
_releaseReply
(
in
);
}
}
catch
(
SystemException
ex
)
{
throw
Util
.
mapSystemException
(
ex
);
}
}
else
{
ServantObject
so
=
_servant_preinvoke
(
"sayHelloWithHashMap2"
,
HelloInterface
.
class
);
if
(
so
==
null
)
{
return
sayHelloWithHashMap2
(
arg0
);
}
try
{
HashMap
arg0Copy
=
(
HashMap
)
Util
.
copyObject
(
arg0
,
_orb
());
return
((
HelloInterface
)
so
.
servant
).
sayHelloWithHashMap2
(
arg0Copy
);
}
catch
(
Throwable
ex
)
{
Throwable
exCopy
=
(
Throwable
)
Util
.
copyObject
(
ex
,
_orb
());
throw
Util
.
wrapException
(
exCopy
);
}
finally
{
_servant_postinvoke
(
so
);
}
}
}
public
String
sayHelloWithReentrantLock
(
ReentrantLock
arg0
)
throws
java
.
rmi
.
RemoteException
{
if
(!
Util
.
isLocal
(
this
))
{
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
in
=
null
;
try
{
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
)
_request
(
"sayHelloWithReentrantLock"
,
true
);
out
.
write_value
(
arg0
,
ReentrantLock
.
class
);
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
_invoke
(
out
);
return
(
String
)
in
.
read_value
(
String
.
class
);
}
catch
(
ApplicationException
ex
)
{
in
=
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
)
ex
.
getInputStream
();
String
$_id
=
in
.
read_string
();
throw
new
UnexpectedException
(
$_id
);
}
catch
(
RemarshalException
ex
)
{
return
sayHelloWithReentrantLock
(
arg0
);
}
finally
{
_releaseReply
(
in
);
}
}
catch
(
SystemException
ex
)
{
throw
Util
.
mapSystemException
(
ex
);
}
}
else
{
ServantObject
so
=
_servant_preinvoke
(
"sayHelloWithReentrantLock"
,
HelloInterface
.
class
);
if
(
so
==
null
)
{
return
sayHelloWithReentrantLock
(
arg0
);
}
try
{
ReentrantLock
arg0Copy
=
(
ReentrantLock
)
Util
.
copyObject
(
arg0
,
_orb
());
return
((
HelloInterface
)
so
.
servant
).
sayHelloWithReentrantLock
(
arg0Copy
);
}
catch
(
Throwable
ex
)
{
Throwable
exCopy
=
(
Throwable
)
Util
.
copyObject
(
ex
,
_orb
());
throw
Util
.
wrapException
(
exCopy
);
}
finally
{
_servant_postinvoke
(
so
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录