Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_corba
提交
18cc65d5
D
dragonwell8_corba
项目概览
openanolis
/
dragonwell8_corba
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_corba
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
18cc65d5
编写于
10月 30, 2012
作者:
C
coffeys
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8000631: Restrict access to class constructor
Reviewed-by: alanb, ahgross
上级
cfaf0824
变更
23
展开全部
隐藏空白更改
内联
并排
Showing
23 changed file
with
123 addition
and
3344 deletion
+123
-3344
make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk
.../com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk
+1
-13
src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java
src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java
+3
-3
src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java
...es/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java
+5
-56
src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java
...s/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java
+5
-15
src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java
...are/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java
+4
-4
src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java
...re/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java
+21
-64
src/share/classes/com/sun/corba/se/impl/io/ValueUtility.java
src/share/classes/com/sun/corba/se/impl/io/ValueUtility.java
+9
-1
src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java
...e/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java
+5
-1
src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java
src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java
+1
-1
src/share/classes/com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java
...es/com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java
+0
-57
src/share/classes/com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java
...s/com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java
+0
-68
src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java
...are/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java
+3
-35
src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java
...ses/com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java
+0
-177
src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java
...s/com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java
+0
-177
src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java
.../com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java
+0
-108
src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java
...om/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java
+0
-102
src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java
...es/com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java
+1
-52
src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java
...asses/com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java
+0
-990
src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java
...ses/com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java
+0
-1065
src/share/classes/com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java
...s/com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java
+0
-251
src/share/classes/com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java
...com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java
+0
-77
src/share/classes/sun/corba/JavaCorbaAccess.java
src/share/classes/sun/corba/JavaCorbaAccess.java
+5
-27
src/share/classes/sun/corba/SharedSecrets.java
src/share/classes/sun/corba/SharedSecrets.java
+60
-0
未找到文件。
make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk
浏览文件 @
18cc65d5
#
# Copyright (c) 2000, 20
09
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 20
12
, 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
...
...
@@ -29,10 +29,6 @@ com_sun_corba_se_impl_orbutil_java = \
com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java \
com/sun/corba/se/impl/orbutil/GetPropertyAction.java \
com/sun/corba/se/impl/orbutil/HexOutputStream.java \
com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java \
com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3_1.java \
com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java \
com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3_1.java \
com/sun/corba/se/impl/orbutil/LegacyHookGetFields.java \
com/sun/corba/se/impl/orbutil/LegacyHookPutFields.java \
com/sun/corba/se/impl/orbutil/LogKeywords.java \
...
...
@@ -45,19 +41,11 @@ com_sun_corba_se_impl_orbutil_java = \
com/sun/corba/se/impl/orbutil/ORBUtility.java \
com/sun/corba/se/impl/orbutil/ORBClassLoader.java \
com/sun/corba/se/impl/orbutil/RepIdDelegator.java \
com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java \
com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java \
com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java \
com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java \
com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java \
com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java \
com/sun/corba/se/impl/orbutil/RepositoryIdUtility.java \
com/sun/corba/se/impl/orbutil/RepositoryIdInterface.java \
com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java \
com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java \
com/sun/corba/se/impl/orbutil/StackImpl.java \
com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java \
com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java \
com/sun/corba/se/impl/orbutil/closure/Future.java \
com/sun/corba/se/impl/orbutil/closure/Constant.java \
com/sun/corba/se/impl/orbutil/concurrent/Sync.java \
...
...
src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java
浏览文件 @
18cc65d5
/*
* Copyright (c) 1997, 20
04
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
12
, 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
...
...
@@ -1218,7 +1218,7 @@ public class AnyImpl extends Any
// See bug 4391648 for more info about the tcORB in this
// case.
RepositoryIdStrings
repStrs
=
RepositoryIdFactory
.
getRepIdStringsFactory
(
tcORB
);
=
RepositoryIdFactory
.
getRepIdStringsFactory
();
// Assertion: c instanceof Serializable?
...
...
@@ -1251,7 +1251,7 @@ public class AnyImpl extends Any
// Anything else
// We know that this is a TypeCodeImpl since it is our ORB
classTC
=
(
TypeCodeImpl
)
ValueUtility
.
createTypeCodeForClass
(
tcORB
,
c
,
ORBUtility
.
createValueHandler
(
tcORB
));
tcORB
,
c
,
ORBUtility
.
createValueHandler
());
// Intruct classTC to store its buffer
classTC
.
setCaching
(
true
);
// Update the cache
...
...
src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java
浏览文件 @
18cc65d5
/*
* Copyright (c) 1997, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
2
, 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
...
...
@@ -269,8 +269,8 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
private
final
void
createRepositoryIdHandlers
()
{
repIdUtil
=
RepositoryIdFactory
.
getRepIdUtility
(
orb
);
repIdStrs
=
RepositoryIdFactory
.
getRepIdStringsFactory
(
orb
);
repIdUtil
=
RepositoryIdFactory
.
getRepIdUtility
();
repIdStrs
=
RepositoryIdFactory
.
getRepIdStringsFactory
();
}
public
GIOPVersion
getGIOPVersion
()
{
...
...
@@ -564,10 +564,7 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
checkForNegativeLength
(
len
);
if
(
orb
!=
null
&&
ORBUtility
.
isLegacyORB
((
ORB
)
orb
))
return
legacyReadString
(
len
);
else
return
internalReadString
(
len
);
return
internalReadString
(
len
);
}
private
final
String
internalReadString
(
int
len
)
{
...
...
@@ -588,54 +585,6 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
return
new
String
(
result
,
0
,
getCharConverter
().
getNumChars
());
}
private
final
String
legacyReadString
(
int
len
)
{
//
// Workaround for ORBs which send string lengths of
// zero to mean empty string.
//
//
// IMPORTANT: Do not replace 'new String("")' with "", it may result
// in a Serialization bug (See serialization.zerolengthstring) and
// bug id: 4728756 for details
if
(
len
==
0
)
return
new
String
(
""
);
len
--;
char
[]
c
=
new
char
[
len
];
int
n
=
0
;
while
(
n
<
len
)
{
int
avail
;
int
bytes
;
int
wanted
;
avail
=
bbwi
.
buflen
-
bbwi
.
position
();
if
(
avail
<=
0
)
{
grow
(
1
,
1
);
avail
=
bbwi
.
buflen
-
bbwi
.
position
();
}
wanted
=
len
-
n
;
bytes
=
(
wanted
<
avail
)
?
wanted
:
avail
;
// Microbenchmarks are showing a loop of ByteBuffer.get(int) being
// faster than ByteBuffer.get(byte[], int, int).
for
(
int
i
=
0
;
i
<
bytes
;
i
++)
{
c
[
n
+
i
]
=
(
char
)
(
bbwi
.
byteBuffer
.
get
(
bbwi
.
position
()+
i
)
&
0xFF
);
}
bbwi
.
position
(
bbwi
.
position
()
+
bytes
);
n
+=
bytes
;
}
//
// Skip past terminating null byte
//
if
(
bbwi
.
position
()
+
1
>
bbwi
.
buflen
)
alignAndCheck
(
1
,
1
);
bbwi
.
position
(
bbwi
.
position
()
+
1
);
return
new
String
(
c
);
}
public
final
String
read_string
()
{
return
readStringOrIndirection
(
false
);
}
...
...
@@ -1045,7 +994,7 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
try
{
if
(
valueHandler
==
null
)
valueHandler
=
ORBUtility
.
createValueHandler
(
orb
);
valueHandler
=
ORBUtility
.
createValueHandler
();
value
=
valueHandler
.
readValue
(
parent
,
indirection
,
...
...
src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java
浏览文件 @
18cc65d5
/*
* Copyright (c) 1997, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
2
, 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
...
...
@@ -189,18 +189,8 @@ public class CDROutputStream_1_0 extends CDROutputStreamBase
private
final
void
createRepositoryIdHandlers
()
{
if
(
orb
!=
null
)
{
// Get the appropriate versions based on the ORB version. The
// ORB versioning info is only in the core ORB.
repIdUtil
=
RepositoryIdFactory
.
getRepIdUtility
(
orb
);
repIdStrs
=
RepositoryIdFactory
.
getRepIdStringsFactory
(
orb
);
}
else
{
// Get the latest versions
repIdUtil
=
RepositoryIdFactory
.
getRepIdUtility
();
repIdStrs
=
RepositoryIdFactory
.
getRepIdStringsFactory
();
}
repIdUtil
=
RepositoryIdFactory
.
getRepIdUtility
();
repIdStrs
=
RepositoryIdFactory
.
getRepIdStringsFactory
();
}
public
BufferManagerWrite
getBufferManager
()
...
...
@@ -705,7 +695,7 @@ public class CDROutputStream_1_0 extends CDROutputStreamBase
private
void
writeArray
(
Serializable
array
,
Class
clazz
)
{
if
(
valueHandler
==
null
)
valueHandler
=
ORBUtility
.
createValueHandler
(
orb
);
//d11638
valueHandler
=
ORBUtility
.
createValueHandler
();
//d11638
// Write value_tag
int
indirection
=
writeValueTag
(
mustChunk
,
true
,
...
...
@@ -768,7 +758,7 @@ public class CDROutputStream_1_0 extends CDROutputStreamBase
private
void
writeRMIIIOPValueType
(
Serializable
object
,
Class
clazz
)
{
if
(
valueHandler
==
null
)
valueHandler
=
ORBUtility
.
createValueHandler
(
orb
);
//d11638
valueHandler
=
ORBUtility
.
createValueHandler
();
//d11638
Serializable
key
=
object
;
...
...
src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java
浏览文件 @
18cc65d5
/*
* Copyright (c) 1999, 20
03
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 20
11
, 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
...
...
@@ -86,7 +86,7 @@ public class FVDCodeBaseImpl extends _CodeBaseImplBase
// default to using the current ORB version in case the
// vhandler is not set
if
(
vhandler
==
null
)
{
vhandler
=
new
ValueHandlerImpl
(
false
);
vhandler
=
ValueHandlerImpl
.
getInstance
(
false
);
}
// Util.getCodebase may return null which would
...
...
@@ -120,7 +120,7 @@ public class FVDCodeBaseImpl extends _CodeBaseImplBase
// default to using the current ORB version in case the
// vhandler is not set
if
(
vhandler
==
null
)
{
vhandler
=
new
ValueHandlerImpl
(
false
);
vhandler
=
ValueHandlerImpl
.
getInstance
(
false
);
}
try
{
...
...
@@ -161,7 +161,7 @@ public class FVDCodeBaseImpl extends _CodeBaseImplBase
// default to using the current ORB version in case the
// vhandler is not set
if
(
vhandler
==
null
)
{
vhandler
=
new
ValueHandlerImpl
(
false
);
vhandler
=
ValueHandlerImpl
.
getInstance
(
false
);
}
Stack
repIds
=
new
Stack
();
...
...
src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java
浏览文件 @
18cc65d5
/*
* Copyright (c) 1998, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
2
, 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
...
...
@@ -53,7 +53,7 @@ import com.sun.corba.se.spi.logging.CORBALogDomains;
import
com.sun.corba.se.impl.logging.OMGSystemException
;
import
com.sun.corba.se.impl.logging.UtilSystemException
;
public
class
ValueHandlerImpl
implements
javax
.
rmi
.
CORBA
.
ValueHandlerMultiFormat
{
public
final
class
ValueHandlerImpl
implements
javax
.
rmi
.
CORBA
.
ValueHandlerMultiFormat
{
// Property to override our maximum stream format version
public
static
final
String
FORMAT_VERSION_PROPERTY
...
...
@@ -150,14 +150,22 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
writeValueWithVersion
(
out
,
value
,
streamFormatVersion
);
}
p
ublic
ValueHandlerImpl
(){}
p
rivate
ValueHandlerImpl
(){}
p
ublic
ValueHandlerImpl
(
boolean
isInputStream
)
{
p
rivate
ValueHandlerImpl
(
boolean
isInputStream
)
{
this
();
useHashtables
=
false
;
this
.
isInputStream
=
isInputStream
;
}
static
ValueHandlerImpl
getInstance
()
{
return
new
ValueHandlerImpl
();
}
static
ValueHandlerImpl
getInstance
(
boolean
isInputStream
)
{
return
new
ValueHandlerImpl
(
isInputStream
);
}
/**
* Writes the value to the stream using java semantics.
* @param out The stream to write the value to
...
...
@@ -458,12 +466,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
return
ObjectStreamClass
.
lookup
(
value
.
getClass
()).
writeReplace
(
value
);
}
/**
* Encapsulates writing of Java char arrays so that the 1.3 subclass
* can override it without exposing internals across packages. This
* is a fix for bug 4367783.
*/
protected
void
writeCharArray
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
,
private
void
writeCharArray
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
,
char
[]
array
,
int
offset
,
int
length
)
...
...
@@ -576,12 +579,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
}
}
/**
* Encapsulates reading of Java char arrays so that the 1.3 subclass
* can override it without exposing internals across packages. This
* is a fix for bug 4367783.
*/
protected
void
readCharArray
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
in
,
private
void
readCharArray
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
in
,
char
[]
array
,
int
offset
,
int
length
)
...
...
@@ -795,7 +793,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
return
RepositoryId
.
cache
.
getId
(
repId
).
isSequence
();
}
pr
otected
String
getOutputStreamClassName
()
{
pr
ivate
String
getOutputStreamClassName
()
{
return
"com.sun.corba.se.impl.io.IIOPOutputStream"
;
}
...
...
@@ -843,29 +841,11 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
private
IIOPOutputStream
createOutputStreamBuiltInNoPriv
(
final
String
name
)
throws
IOException
{
return
name
.
equals
(
IIOPOutputStream
.
class
.
getName
()
)
?
new
IIOPOutputStream
()
:
name
.
equals
(
com
.
sun
.
corba
.
se
.
impl
.
orbutil
.
IIOPOutputStream_1_3
.
class
.
getName
()
)
?
new
com
.
sun
.
corba
.
se
.
impl
.
orbutil
.
IIOPOutputStream_1_3
()
:
name
.
equals
(
com
.
sun
.
corba
.
se
.
impl
.
orbutil
.
IIOPOutputStream_1_3_1
.
class
.
getName
()
)
?
new
com
.
sun
.
corba
.
se
.
impl
.
orbutil
.
IIOPOutputStream_1_3_1
()
:
null
;
return
name
.
equals
(
IIOPOutputStream
.
class
.
getName
())
?
new
IIOPOutputStream
()
:
null
;
}
pr
otected
String
getInputStreamClassName
()
{
pr
ivate
String
getInputStreamClassName
()
{
return
"com.sun.corba.se.impl.io.IIOPInputStream"
;
}
...
...
@@ -913,26 +893,8 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
private
IIOPInputStream
createInputStreamBuiltInNoPriv
(
final
String
name
)
throws
IOException
{
return
name
.
equals
(
IIOPInputStream
.
class
.
getName
()
)
?
new
IIOPInputStream
()
:
name
.
equals
(
com
.
sun
.
corba
.
se
.
impl
.
orbutil
.
IIOPInputStream_1_3
.
class
.
getName
()
)
?
new
com
.
sun
.
corba
.
se
.
impl
.
orbutil
.
IIOPInputStream_1_3
()
:
name
.
equals
(
com
.
sun
.
corba
.
se
.
impl
.
orbutil
.
IIOPInputStream_1_3_1
.
class
.
getName
()
)
?
new
com
.
sun
.
corba
.
se
.
impl
.
orbutil
.
IIOPInputStream_1_3_1
()
:
null
;
return
name
.
equals
(
IIOPInputStream
.
class
.
getName
())
?
new
IIOPInputStream
()
:
null
;
}
/**
...
...
@@ -958,12 +920,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
}
/**
* Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this.
* The correct behavior is for a Java char to map to a CORBA wchar,
* but our older code mapped it to a CORBA char.
*/
protected
TCKind
getJavaCharTCKind
()
{
TCKind
getJavaCharTCKind
()
{
return
TCKind
.
tk_wchar
;
}
}
src/share/classes/com/sun/corba/se/impl/io/ValueUtility.java
浏览文件 @
18cc65d5
/*
* Copyright (c) 1999, 20
0
2, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 20
1
2, 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
...
...
@@ -93,6 +93,14 @@ public class ValueUtility {
null
,
// tk_abstract_interface 32
};
static
{
sun
.
corba
.
SharedSecrets
.
setJavaCorbaAccess
(
new
sun
.
corba
.
JavaCorbaAccess
()
{
public
ValueHandlerImpl
newValueHandlerImpl
()
{
return
ValueHandlerImpl
.
getInstance
();
}
});
}
public
static
String
getSignature
(
ValueMember
member
)
throws
ClassNotFoundException
{
...
...
src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java
浏览文件 @
18cc65d5
...
...
@@ -112,6 +112,9 @@ import com.sun.corba.se.impl.util.JDKBridge;
import
com.sun.corba.se.impl.orbutil.ORBClassLoader
;
import
com.sun.corba.se.impl.logging.UtilSystemException
;
import
com.sun.corba.se.spi.logging.CORBALogDomains
;
import
sun.corba.SharedSecrets
;
import
sun.corba.JavaCorbaAccess
;
/**
* Provides utility methods that can be used by stubs and ties to
...
...
@@ -125,7 +128,8 @@ public class Util implements javax.rmi.CORBA.UtilDelegate
// Maps targets to ties.
private
static
IdentityHashtable
exportedServants
=
new
IdentityHashtable
();
private
static
ValueHandlerImpl
valueHandlerSingleton
=
new
ValueHandlerImpl
();
private
static
final
ValueHandlerImpl
valueHandlerSingleton
=
SharedSecrets
.
getJavaCorbaAccess
().
newValueHandlerImpl
();
private
UtilSystemException
utilWrapper
=
UtilSystemException
.
get
(
CORBALogDomains
.
RPC_ENCODING
);
...
...
src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java
浏览文件 @
18cc65d5
...
...
@@ -840,7 +840,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
// backward compatability 4365188
CodeBase
cb
;
ValueHandler
vh
=
ORBUtility
.
createValueHandler
(
this
);
ValueHandler
vh
=
ORBUtility
.
createValueHandler
();
cb
=
(
CodeBase
)
vh
.
getRunTimeCodeBase
();
return
ORBUtility
.
connectAndGetIOR
(
this
,
cb
)
;
...
...
src/share/classes/com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java
已删除
100644 → 0
浏览文件 @
cfaf0824
/*
* Copyright (c) 2000, 2002, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package
com.sun.corba.se.impl.orbutil
;
import
java.io.*
;
import
java.util.Hashtable
;
/**
* Implements legacy behavior from before Ladybird to maintain
* backwards compatibility.
*/
public
class
IIOPInputStream_1_3
extends
com
.
sun
.
corba
.
se
.
impl
.
io
.
IIOPInputStream
{
// The newer version in the io package correctly reads a wstring instead.
// This concerns bug 4379597.
protected
String
internalReadUTF
(
org
.
omg
.
CORBA
.
portable
.
InputStream
stream
)
{
return
stream
.
read_string
();
}
/**
* Before JDK 1.3.1_01, the PutField/GetField implementation
* actually sent a Hashtable.
*/
public
ObjectInputStream
.
GetField
readFields
()
throws
IOException
,
ClassNotFoundException
,
NotActiveException
{
Hashtable
fields
=
(
Hashtable
)
readObject
();
return
new
LegacyHookGetFields
(
fields
);
}
public
IIOPInputStream_1_3
()
throws
java
.
io
.
IOException
{
super
();
}
}
src/share/classes/com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java
已删除
100644 → 0
浏览文件 @
cfaf0824
/*
* Copyright (c) 2000, 2002, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package
com.sun.corba.se.impl.orbutil
;
import
java.io.*
;
/**
* Implements legacy behavior from before Ladybird to maintain
* backwards compatibility.
*/
public
class
IIOPOutputStream_1_3
extends
com
.
sun
.
corba
.
se
.
impl
.
io
.
IIOPOutputStream
{
// We can't assume that the superclass's putFields
// member will be non-private. We must allow
// the RI to run on JDK 1.3.1 FCS as well as
// the JDK 1.3.1_01 patch.
private
ObjectOutputStream
.
PutField
putFields_1_3
;
// The newer version in the io package correctly writes a wstring instead.
// This concerns bug 4379597.
protected
void
internalWriteUTF
(
org
.
omg
.
CORBA
.
portable
.
OutputStream
stream
,
String
data
)
{
stream
.
write_string
(
data
);
}
public
IIOPOutputStream_1_3
()
throws
java
.
io
.
IOException
{
super
();
}
/**
* Before JDK 1.3.1_01, the PutField/GetField implementation
* actually sent a Hashtable.
*/
public
ObjectOutputStream
.
PutField
putFields
()
throws
IOException
{
putFields_1_3
=
new
LegacyHookPutFields
();
return
putFields_1_3
;
}
public
void
writeFields
()
throws
IOException
{
putFields_1_3
.
write
(
this
);
}
}
src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java
浏览文件 @
18cc65d5
/*
* Copyright (c) 2000, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 20
12
, 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
...
...
@@ -160,44 +160,12 @@ public final class ORBUtility {
}
/**
* Creates the correct ValueHandler for the given ORB,
* querying ORBVersion information. If the ORB or
* ORBVersion is null, gets the ValueHandler from
* Util.createValueHandler.
* Return default ValueHandler
*/
public
static
ValueHandler
createValueHandler
(
ORB
orb
)
{
if
(
orb
==
null
)
return
Util
.
createValueHandler
();
ORBVersion
version
=
orb
.
getORBVersion
();
if
(
version
==
null
)
return
Util
.
createValueHandler
();
if
(
version
.
equals
(
ORBVersionFactory
.
getOLD
()))
return
new
ValueHandlerImpl_1_3
();
if
(
version
.
equals
(
ORBVersionFactory
.
getNEW
()))
return
new
ValueHandlerImpl_1_3_1
();
public
static
ValueHandler
createValueHandler
()
{
return
Util
.
createValueHandler
();
}
/**
* Returns true if the given ORB could accurately be determined to be a
* Kestrel or earlier ORB. Note: If passed the ORBSingleton, this will return
* false.
*/
public
static
boolean
isLegacyORB
(
ORB
orb
)
{
try
{
ORBVersion
currentORB
=
orb
.
getORBVersion
();
return
currentORB
.
equals
(
ORBVersionFactory
.
getOLD
()
)
;
}
catch
(
SecurityException
se
)
{
return
false
;
}
}
/**
* Returns true if it was accurately determined that the remote ORB is
* a foreign (non-JavaSoft) ORB. Note: If passed the ORBSingleton, this
...
...
src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java
已删除
100644 → 0
浏览文件 @
cfaf0824
/*
* Copyright (c) 2000, 2004, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package
com.sun.corba.se.impl.orbutil
;
import
org.omg.CORBA.ORB
;
import
java.io.Serializable
;
import
java.util.Hashtable
;
import
java.net.MalformedURLException
;
import
com.sun.corba.se.impl.io.TypeMismatchException
;
import
com.sun.corba.se.impl.util.RepositoryId
;
/**
* Delegates to the RepositoryId_1_3 implementation in
* com.sun.corba.se.impl.orbutil. This is necessary to
* overcome the fact that many of RepositoryId's methods
* are static.
*/
public
final
class
RepIdDelegator_1_3
implements
RepositoryIdStrings
,
RepositoryIdUtility
,
RepositoryIdInterface
{
// RepositoryIdFactory methods
public
String
createForAnyType
(
Class
type
)
{
return
RepositoryId_1_3
.
createForAnyType
(
type
);
}
public
String
createForJavaType
(
Serializable
ser
)
throws
TypeMismatchException
{
return
RepositoryId_1_3
.
createForJavaType
(
ser
);
}
public
String
createForJavaType
(
Class
clz
)
throws
TypeMismatchException
{
return
RepositoryId_1_3
.
createForJavaType
(
clz
);
}
public
String
createSequenceRepID
(
java
.
lang
.
Object
ser
)
{
return
RepositoryId_1_3
.
createSequenceRepID
(
ser
);
}
public
String
createSequenceRepID
(
Class
clazz
)
{
return
RepositoryId_1_3
.
createSequenceRepID
(
clazz
);
}
public
RepositoryIdInterface
getFromString
(
String
repIdString
)
{
return
new
RepIdDelegator_1_3
(
RepositoryId_1_3
.
cache
.
getId
(
repIdString
));
}
// RepositoryIdUtility methods
public
boolean
isChunkedEncoding
(
int
valueTag
)
{
return
RepositoryId
.
isChunkedEncoding
(
valueTag
);
}
public
boolean
isCodeBasePresent
(
int
valueTag
)
{
return
RepositoryId
.
isCodeBasePresent
(
valueTag
);
}
public
String
getClassDescValueRepId
()
{
return
RepositoryId_1_3
.
kClassDescValueRepID
;
}
public
String
getWStringValueRepId
()
{
return
RepositoryId_1_3
.
kWStringValueRepID
;
}
public
int
getTypeInfo
(
int
valueTag
)
{
return
RepositoryId
.
getTypeInfo
(
valueTag
);
}
public
int
getStandardRMIChunkedNoRepStrId
()
{
return
RepositoryId
.
kPreComputed_StandardRMIChunked_NoRep
;
}
public
int
getCodeBaseRMIChunkedNoRepStrId
()
{
return
RepositoryId
.
kPreComputed_CodeBaseRMIChunked_NoRep
;
}
public
int
getStandardRMIChunkedId
()
{
return
RepositoryId
.
kPreComputed_StandardRMIChunked
;
}
public
int
getCodeBaseRMIChunkedId
()
{
return
RepositoryId
.
kPreComputed_CodeBaseRMIChunked
;
}
public
int
getStandardRMIUnchunkedId
()
{
return
RepositoryId
.
kPreComputed_StandardRMIUnchunked
;
}
public
int
getCodeBaseRMIUnchunkedId
()
{
return
RepositoryId
.
kPreComputed_CodeBaseRMIUnchunked
;
}
public
int
getStandardRMIUnchunkedNoRepStrId
()
{
return
RepositoryId
.
kPreComputed_StandardRMIUnchunked_NoRep
;
}
public
int
getCodeBaseRMIUnchunkedNoRepStrId
()
{
return
RepositoryId
.
kPreComputed_CodeBaseRMIUnchunked_NoRep
;
}
// RepositoryIdInterface methods
public
Class
getClassFromType
()
throws
ClassNotFoundException
{
return
delegate
.
getClassFromType
();
}
public
Class
getClassFromType
(
String
codebaseURL
)
throws
ClassNotFoundException
,
MalformedURLException
{
return
delegate
.
getClassFromType
(
codebaseURL
);
}
public
Class
getClassFromType
(
Class
expectedType
,
String
codebaseURL
)
throws
ClassNotFoundException
,
MalformedURLException
{
return
delegate
.
getClassFromType
(
expectedType
,
codebaseURL
);
}
public
String
getClassName
()
{
return
delegate
.
getClassName
();
}
// Constructor used for factory/utility cases
public
RepIdDelegator_1_3
()
{}
// Constructor used by getIdFromString. All non-static
// RepositoryId methods will use the provided delegate.
private
RepIdDelegator_1_3
(
RepositoryId_1_3
_delegate
)
{
this
.
delegate
=
_delegate
;
}
private
RepositoryId_1_3
delegate
=
null
;
public
String
toString
()
{
if
(
delegate
!=
null
)
return
delegate
.
toString
();
else
return
this
.
getClass
().
getName
();
}
public
boolean
equals
(
Object
obj
)
{
if
(
delegate
!=
null
)
return
delegate
.
equals
(
obj
);
else
return
super
.
equals
(
obj
);
}
}
src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java
已删除
100644 → 0
浏览文件 @
cfaf0824
/*
* Copyright (c) 2001, 2004, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package
com.sun.corba.se.impl.orbutil
;
import
org.omg.CORBA.ORB
;
import
java.io.Serializable
;
import
java.util.Hashtable
;
import
java.net.MalformedURLException
;
import
com.sun.corba.se.impl.io.TypeMismatchException
;
import
com.sun.corba.se.impl.util.RepositoryId
;
/**
* Delegates to the RepositoryId_1_3_1 implementation in
* com.sun.corba.se.impl.orbutil. This is necessary to
* overcome the fact that many of RepositoryId's methods
* are static.
*/
public
final
class
RepIdDelegator_1_3_1
implements
RepositoryIdStrings
,
RepositoryIdUtility
,
RepositoryIdInterface
{
// RepositoryIdFactory methods
public
String
createForAnyType
(
Class
type
)
{
return
RepositoryId_1_3_1
.
createForAnyType
(
type
);
}
public
String
createForJavaType
(
Serializable
ser
)
throws
TypeMismatchException
{
return
RepositoryId_1_3_1
.
createForJavaType
(
ser
);
}
public
String
createForJavaType
(
Class
clz
)
throws
TypeMismatchException
{
return
RepositoryId_1_3_1
.
createForJavaType
(
clz
);
}
public
String
createSequenceRepID
(
java
.
lang
.
Object
ser
)
{
return
RepositoryId_1_3_1
.
createSequenceRepID
(
ser
);
}
public
String
createSequenceRepID
(
Class
clazz
)
{
return
RepositoryId_1_3_1
.
createSequenceRepID
(
clazz
);
}
public
RepositoryIdInterface
getFromString
(
String
repIdString
)
{
return
new
RepIdDelegator_1_3_1
(
RepositoryId_1_3_1
.
cache
.
getId
(
repIdString
));
}
// RepositoryIdUtility methods
public
boolean
isChunkedEncoding
(
int
valueTag
)
{
return
RepositoryId
.
isChunkedEncoding
(
valueTag
);
}
public
boolean
isCodeBasePresent
(
int
valueTag
)
{
return
RepositoryId
.
isCodeBasePresent
(
valueTag
);
}
public
String
getClassDescValueRepId
()
{
return
RepositoryId_1_3_1
.
kClassDescValueRepID
;
}
public
String
getWStringValueRepId
()
{
return
RepositoryId_1_3_1
.
kWStringValueRepID
;
}
public
int
getTypeInfo
(
int
valueTag
)
{
return
RepositoryId
.
getTypeInfo
(
valueTag
);
}
public
int
getStandardRMIChunkedNoRepStrId
()
{
return
RepositoryId
.
kPreComputed_StandardRMIChunked_NoRep
;
}
public
int
getCodeBaseRMIChunkedNoRepStrId
()
{
return
RepositoryId
.
kPreComputed_CodeBaseRMIChunked_NoRep
;
}
public
int
getStandardRMIChunkedId
()
{
return
RepositoryId
.
kPreComputed_StandardRMIChunked
;
}
public
int
getCodeBaseRMIChunkedId
()
{
return
RepositoryId
.
kPreComputed_CodeBaseRMIChunked
;
}
public
int
getStandardRMIUnchunkedId
()
{
return
RepositoryId
.
kPreComputed_StandardRMIUnchunked
;
}
public
int
getCodeBaseRMIUnchunkedId
()
{
return
RepositoryId
.
kPreComputed_CodeBaseRMIUnchunked
;
}
public
int
getStandardRMIUnchunkedNoRepStrId
()
{
return
RepositoryId
.
kPreComputed_StandardRMIUnchunked_NoRep
;
}
public
int
getCodeBaseRMIUnchunkedNoRepStrId
()
{
return
RepositoryId
.
kPreComputed_CodeBaseRMIUnchunked_NoRep
;
}
// RepositoryIdInterface methods
public
Class
getClassFromType
()
throws
ClassNotFoundException
{
return
delegate
.
getClassFromType
();
}
public
Class
getClassFromType
(
String
codebaseURL
)
throws
ClassNotFoundException
,
MalformedURLException
{
return
delegate
.
getClassFromType
(
codebaseURL
);
}
public
Class
getClassFromType
(
Class
expectedType
,
String
codebaseURL
)
throws
ClassNotFoundException
,
MalformedURLException
{
return
delegate
.
getClassFromType
(
expectedType
,
codebaseURL
);
}
public
String
getClassName
()
{
return
delegate
.
getClassName
();
}
// Constructor used for factory/utility cases
public
RepIdDelegator_1_3_1
()
{}
// Constructor used by getIdFromString. All non-static
// RepositoryId methods will use the provided delegate.
private
RepIdDelegator_1_3_1
(
RepositoryId_1_3_1
_delegate
)
{
this
.
delegate
=
_delegate
;
}
private
RepositoryId_1_3_1
delegate
=
null
;
public
String
toString
()
{
if
(
delegate
!=
null
)
return
delegate
.
toString
();
else
return
this
.
getClass
().
getName
();
}
public
boolean
equals
(
Object
obj
)
{
if
(
delegate
!=
null
)
return
delegate
.
equals
(
obj
);
else
return
super
.
equals
(
obj
);
}
}
src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java
已删除
100644 → 0
浏览文件 @
cfaf0824
/*
* Copyright (c) 2000, 2002, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
/*
* Licensed Materials - Property of IBM
* RMI-IIOP v1.0
* Copyright IBM Corp. 1998 1999 All Rights Reserved
*
*/
package
com.sun.corba.se.impl.orbutil
;
import
java.util.Stack
;
import
java.util.Hashtable
;
import
java.util.EmptyStackException
;
import
java.util.Enumeration
;
// Really limited pool - in this case just creating several at a time...
class
RepositoryIdPool_1_3
extends
Stack
{
private
static
int
MAX_CACHE_SIZE
=
4
;
private
RepositoryIdCache_1_3
cache
;
public
final
synchronized
RepositoryId_1_3
popId
()
{
try
{
return
(
RepositoryId_1_3
)
super
.
pop
();
}
catch
(
EmptyStackException
e
)
{
increasePool
(
5
);
return
(
RepositoryId_1_3
)
super
.
pop
();
}
}
// Pool management
final
void
increasePool
(
int
size
)
{
//if (cache.size() <= MAX_CACHE_SIZE)
for
(
int
i
=
size
;
i
>
0
;
i
--)
push
(
new
RepositoryId_1_3
());
/*
// _REVISIT_ This will not work w/out either thread tracing or weak references. I am
// betting that thread tracing almost completely negates benefit of reuse. Until either
// 1.2 only inclusion or proof to the contrary, I'll leave it this way...
else {
int numToReclaim = cache.size() / 2;
Enumeration keys = cache.keys();
Enumeration elements = cache.elements();
for (int i = numToReclaim; i > 0; i--) {
Object key = keys.nextElement();
Object element = elements.nextElement();
push(element);
cache.remove(key);
}
}
*/
}
final
void
setCaches
(
RepositoryIdCache_1_3
cache
)
{
this
.
cache
=
cache
;
}
}
public
class
RepositoryIdCache_1_3
extends
Hashtable
{
private
RepositoryIdPool_1_3
pool
=
new
RepositoryIdPool_1_3
();
public
RepositoryIdCache_1_3
()
{
pool
.
setCaches
(
this
);
}
public
final
synchronized
RepositoryId_1_3
getId
(
String
key
)
{
RepositoryId_1_3
repId
=
(
RepositoryId_1_3
)
super
.
get
(
key
);
if
(
repId
!=
null
)
return
repId
;
else
{
//repId = pool.popId().init(key);
repId
=
new
RepositoryId_1_3
(
key
);
put
(
key
,
repId
);
return
repId
;
}
}
}
src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java
已删除
100644 → 0
浏览文件 @
cfaf0824
/*
* Copyright (c) 2001, 2002, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package
com.sun.corba.se.impl.orbutil
;
import
java.util.Stack
;
import
java.util.Hashtable
;
import
java.util.EmptyStackException
;
import
java.util.Enumeration
;
// Really limited pool - in this case just creating several at a time...
class
RepositoryIdPool_1_3_1
extends
Stack
{
private
static
int
MAX_CACHE_SIZE
=
4
;
private
RepositoryIdCache_1_3_1
cache
;
public
final
synchronized
RepositoryId_1_3_1
popId
()
{
try
{
return
(
RepositoryId_1_3_1
)
super
.
pop
();
}
catch
(
EmptyStackException
e
)
{
increasePool
(
5
);
return
(
RepositoryId_1_3_1
)
super
.
pop
();
}
}
// Pool management
final
void
increasePool
(
int
size
)
{
//if (cache.size() <= MAX_CACHE_SIZE)
for
(
int
i
=
size
;
i
>
0
;
i
--)
push
(
new
RepositoryId_1_3_1
());
/*
// _REVISIT_ This will not work w/out either thread tracing or weak references. I am
// betting that thread tracing almost completely negates benefit of reuse. Until either
// 1.2 only inclusion or proof to the contrary, I'll leave it this way...
else {
int numToReclaim = cache.size() / 2;
Enumeration keys = cache.keys();
Enumeration elements = cache.elements();
for (int i = numToReclaim; i > 0; i--) {
Object key = keys.nextElement();
Object element = elements.nextElement();
push(element);
cache.remove(key);
}
}
*/
}
final
void
setCaches
(
RepositoryIdCache_1_3_1
cache
)
{
this
.
cache
=
cache
;
}
}
public
class
RepositoryIdCache_1_3_1
extends
Hashtable
{
private
RepositoryIdPool_1_3_1
pool
=
new
RepositoryIdPool_1_3_1
();
public
RepositoryIdCache_1_3_1
()
{
pool
.
setCaches
(
this
);
}
public
final
synchronized
RepositoryId_1_3_1
getId
(
String
key
)
{
RepositoryId_1_3_1
repId
=
(
RepositoryId_1_3_1
)
super
.
get
(
key
);
if
(
repId
!=
null
)
return
repId
;
else
{
//repId = pool.popId().init(key);
repId
=
new
RepositoryId_1_3_1
(
key
);
put
(
key
,
repId
);
return
repId
;
}
}
}
src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java
浏览文件 @
18cc65d5
/*
* Copyright (c) 2000, 20
03
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 20
12
, 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
...
...
@@ -30,12 +30,6 @@ import com.sun.corba.se.spi.orb.ORB;
public
abstract
class
RepositoryIdFactory
{
private
static
final
RepIdDelegator_1_3
legacyDelegator
=
new
RepIdDelegator_1_3
();
private
static
final
RepIdDelegator_1_3_1
ladybirdDelegator
=
new
RepIdDelegator_1_3_1
();
private
static
final
RepIdDelegator
currentDelegator
=
new
RepIdDelegator
();
...
...
@@ -47,29 +41,6 @@ public abstract class RepositoryIdFactory
return
currentDelegator
;
}
/**
* Checks the version of the ORB and returns the appropriate
* RepositoryIdStrings instance.
*/
public
static
RepositoryIdStrings
getRepIdStringsFactory
(
ORB
orb
)
{
if
(
orb
!=
null
)
{
switch
(
orb
.
getORBVersion
().
getORBType
())
{
case
ORBVersion
.
NEWER
:
case
ORBVersion
.
FOREIGN
:
case
ORBVersion
.
JDK1_3_1_01
:
return
currentDelegator
;
case
ORBVersion
.
OLD
:
return
legacyDelegator
;
case
ORBVersion
.
NEW
:
return
ladybirdDelegator
;
default
:
return
currentDelegator
;
}
}
else
return
currentDelegator
;
}
/**
* Returns the latest version RepositoryIdUtility instance
*/
...
...
@@ -78,26 +49,4 @@ public abstract class RepositoryIdFactory
return
currentDelegator
;
}
/**
* Checks the version of the ORB and returns the appropriate
* RepositoryIdUtility instance.
*/
public
static
RepositoryIdUtility
getRepIdUtility
(
ORB
orb
)
{
if
(
orb
!=
null
)
{
switch
(
orb
.
getORBVersion
().
getORBType
())
{
case
ORBVersion
.
NEWER
:
case
ORBVersion
.
FOREIGN
:
case
ORBVersion
.
JDK1_3_1_01
:
return
currentDelegator
;
case
ORBVersion
.
OLD
:
return
legacyDelegator
;
case
ORBVersion
.
NEW
:
return
ladybirdDelegator
;
default
:
return
currentDelegator
;
}
}
else
return
currentDelegator
;
}
}
src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java
已删除
100644 → 0
浏览文件 @
cfaf0824
此差异已折叠。
点击以展开。
src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java
已删除
100644 → 0
浏览文件 @
cfaf0824
此差异已折叠。
点击以展开。
src/share/classes/com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java
已删除
100644 → 0
浏览文件 @
cfaf0824
/*
* Copyright (c) 2000, 2003, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
/*
* Licensed Materials - Property of IBM
* RMI-IIOP v1.0
* Copyright IBM Corp. 1998 1999 All Rights Reserved
*
*/
package
com.sun.corba.se.impl.orbutil
;
import
javax.rmi.CORBA.Util
;
import
javax.rmi.PortableRemoteObject
;
import
java.util.Hashtable
;
import
java.util.Stack
;
import
java.io.IOException
;
import
java.util.EmptyStackException
;
import
com.sun.corba.se.impl.util.Utility
;
import
com.sun.corba.se.impl.io.IIOPInputStream
;
import
com.sun.corba.se.impl.io.IIOPOutputStream
;
import
com.sun.corba.se.impl.util.RepositoryId
;
import
com.sun.corba.se.impl.util.Utility
;
import
org.omg.CORBA.TCKind
;
import
org.omg.CORBA.MARSHAL
;
import
org.omg.CORBA.CompletionStatus
;
import
org.omg.CORBA.portable.IndirectionException
;
import
com.sun.org.omg.SendingContext.CodeBase
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
/**
* This class overrides behavior of our current ValueHandlerImpl to
* provide backwards compatibility with JDK 1.3.0.
*/
public
class
ValueHandlerImpl_1_3
extends
com
.
sun
.
corba
.
se
.
impl
.
io
.
ValueHandlerImpl
{
public
ValueHandlerImpl_1_3
(){
super
();
}
public
ValueHandlerImpl_1_3
(
boolean
isInputStream
)
{
super
(
isInputStream
);
}
/**
* Writes the value to the stream using java semantics.
* @param out The stream to write the value to
* @param value The value to be written to the stream
**/
public
void
writeValue
(
org
.
omg
.
CORBA
.
portable
.
OutputStream
_out
,
java
.
io
.
Serializable
value
)
{
super
.
writeValue
(
_out
,
value
);
}
/**
* Reads a value from the stream using java semantics.
* @param in The stream to read the value from
* @param clazz The type of the value to be read in
* @param sender The sending context runtime
**/
public
java
.
io
.
Serializable
readValue
(
org
.
omg
.
CORBA
.
portable
.
InputStream
_in
,
int
offset
,
java
.
lang
.
Class
clazz
,
String
repositoryID
,
org
.
omg
.
SendingContext
.
RunTime
_sender
)
{
return
super
.
readValue
(
_in
,
offset
,
clazz
,
repositoryID
,
_sender
);
}
/**
* Returns the repository ID for the given RMI value Class.
* @param clz The class to return a repository ID for.
* @return the repository ID of the Class.
**/
public
java
.
lang
.
String
getRMIRepositoryID
(
java
.
lang
.
Class
clz
)
{
return
RepositoryId_1_3
.
createForJavaType
(
clz
);
}
/**
* Indicates whether the given Class performs custom or
* default marshaling.
* @param clz The class to test for custom marshaling.
* @return True if the class performs custom marshaling, false
* if it does not.
**/
public
boolean
isCustomMarshaled
(
java
.
lang
.
Class
clz
)
{
return
super
.
isCustomMarshaled
(
clz
);
}
/**
* Returns the CodeBase for this ValueHandler. This is used by
* the ORB runtime. The server sends the service context containing
* the IOR for this CodeBase on the first GIOP reply. The clients
* do the same on the first GIOP request.
* @return the SendingContext.CodeBase of this ValueHandler.
**/
public
org
.
omg
.
SendingContext
.
RunTime
getRunTimeCodeBase
()
{
return
super
.
getRunTimeCodeBase
();
}
/**
* If the value contains a writeReplace method then the result
* is returned. Otherwise, the value itself is returned.
* @return the true value to marshal on the wire.
**/
public
java
.
io
.
Serializable
writeReplace
(
java
.
io
.
Serializable
value
)
{
return
super
.
writeReplace
(
value
);
}
// methods supported for backward compatability so that the appropriate
// Rep-id calculations take place based on the ORB version
/**
* Returns a boolean of whether or not RepositoryId indicates
* FullValueDescriptor.
* used for backward compatability
*/
public
boolean
useFullValueDescription
(
Class
clazz
,
String
repositoryID
)
throws
IOException
{
return
RepositoryId_1_3
.
useFullValueDescription
(
clazz
,
repositoryID
);
}
public
String
getClassName
(
String
id
)
{
RepositoryId_1_3
repID
=
RepositoryId_1_3
.
cache
.
getId
(
id
);
return
repID
.
getClassName
();
}
public
Class
getClassFromType
(
String
id
)
throws
ClassNotFoundException
{
RepositoryId_1_3
repId
=
RepositoryId_1_3
.
cache
.
getId
(
id
);
return
repId
.
getClassFromType
();
}
public
Class
getAnyClassFromType
(
String
id
)
throws
ClassNotFoundException
{
RepositoryId_1_3
repId
=
RepositoryId_1_3
.
cache
.
getId
(
id
);
return
repId
.
getAnyClassFromType
();
}
public
String
createForAnyType
(
Class
cl
)
{
return
RepositoryId_1_3
.
createForAnyType
(
cl
);
}
public
String
getDefinedInId
(
String
id
)
{
RepositoryId_1_3
repId
=
RepositoryId_1_3
.
cache
.
getId
(
id
);
return
repId
.
getDefinedInId
();
}
public
String
getUnqualifiedName
(
String
id
)
{
RepositoryId_1_3
repId
=
RepositoryId_1_3
.
cache
.
getId
(
id
);
return
repId
.
getUnqualifiedName
();
}
public
String
getSerialVersionUID
(
String
id
)
{
RepositoryId_1_3
repId
=
RepositoryId_1_3
.
cache
.
getId
(
id
);
return
repId
.
getSerialVersionUID
();
}
public
boolean
isAbstractBase
(
Class
clazz
)
{
return
RepositoryId_1_3
.
isAbstractBase
(
clazz
);
}
public
boolean
isSequence
(
String
id
)
{
RepositoryId_1_3
repId
=
RepositoryId_1_3
.
cache
.
getId
(
id
);
return
repId
.
isSequence
();
}
/**
* Preserves the incorrect 1.3 behavior which truncates Java chars in
* arrays to 8-bit CORBA chars. Bug 4367783. This enables us to
* continue interoperating with our legacy ORBs. If this goes into
* Ladybird, then Ladybird and Kestrel will interoperate as long as
* people don't use chars greater than 8-bits.
*/
protected
void
writeCharArray
(
org
.
omg
.
CORBA_2_3
.
portable
.
OutputStream
out
,
char
[]
array
,
int
offset
,
int
length
)
{
out
.
write_char_array
(
array
,
offset
,
length
);
}
/**
* Preserves the incorrect 1.3 behavior which truncates Java chars in
* arrays to 8-bit CORBA chars. Bug 4367783. This enables us to
* continue interoperating with our legacy ORBs. If this goes into
* Ladybird, then Ladybird and Kestrel will interoperate as long as
* people don't use chars greater than 8-bits.
*/
protected
void
readCharArray
(
org
.
omg
.
CORBA_2_3
.
portable
.
InputStream
in
,
char
[]
array
,
int
offset
,
int
length
)
{
in
.
read_char_array
(
array
,
offset
,
length
);
}
protected
final
String
getOutputStreamClassName
()
{
return
"com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3"
;
}
protected
final
String
getInputStreamClassName
()
{
return
"com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3"
;
}
/**
* Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this.
* The correct behavior is for a Java char to map to a CORBA wchar,
* but our older code mapped it to a CORBA char.
*/
protected
TCKind
getJavaCharTCKind
()
{
return
TCKind
.
tk_char
;
}
}
src/share/classes/com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java
已删除
100644 → 0
浏览文件 @
cfaf0824
/*
* Copyright (c) 2001, 2002, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package
com.sun.corba.se.impl.orbutil
;
import
org.omg.CORBA.TCKind
;
/**
* This class overrides behavior of our current ValueHandlerImpl to
* provide backwards compatibility with JDK 1.3.1.
*/
public
class
ValueHandlerImpl_1_3_1
extends
com
.
sun
.
corba
.
se
.
impl
.
io
.
ValueHandlerImpl
{
public
ValueHandlerImpl_1_3_1
()
{}
public
ValueHandlerImpl_1_3_1
(
boolean
isInputStream
)
{
super
(
isInputStream
);
}
/**
* Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this.
* The correct behavior is for a Java char to map to a CORBA wchar,
* but our older code mapped it to a CORBA char.
*/
protected
TCKind
getJavaCharTCKind
()
{
return
TCKind
.
tk_char
;
}
/**
* RepositoryId_1_3_1 performs an incorrect repId calculation
* when using serialPersistentFields and one of the fields no longer
* exists on the class itself.
*/
public
boolean
useFullValueDescription
(
Class
clazz
,
String
repositoryID
)
throws
java
.
io
.
IOException
{
return
RepositoryId_1_3_1
.
useFullValueDescription
(
clazz
,
repositoryID
);
}
/**
* Installs the legacy IIOPOutputStream_1_3_1 which does
* PutFields/GetFields incorrectly. Bug 4407244.
*/
protected
final
String
getOutputStreamClassName
()
{
return
"com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3_1"
;
}
/**
* Installs the legacy IIOPInputStream_1_3_1 which does
* PutFields/GetFields incorrectly. Bug 4407244.
*/
protected
final
String
getInputStreamClassName
()
{
return
"com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3_1"
;
}
}
src/share/classes/
com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3_1
.java
→
src/share/classes/
sun/corba/JavaCorbaAccess
.java
浏览文件 @
18cc65d5
/*
* Copyright (c) 20
01, 200
2, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 20
1
2, 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
...
...
@@ -23,32 +23,10 @@
* questions.
*/
/*
*/
package
com.sun.corba.se.impl.orbutil
;
import
java.io.*
;
import
java.util.Hashtable
;
/**
* Implements legacy behavior from Ladybird to maintain
* backwards compatibility.
*/
public
class
IIOPInputStream_1_3_1
extends
com
.
sun
.
corba
.
se
.
impl
.
io
.
IIOPInputStream
{
public
IIOPInputStream_1_3_1
()
throws
java
.
io
.
IOException
{
super
();
}
package
sun.corba
;
/**
* Before JDK 1.3.1_01, the PutField/GetField implementation
* actually sent a Hashtable.
*/
public
ObjectInputStream
.
GetField
readFields
()
throws
IOException
,
ClassNotFoundException
,
NotActiveException
{
import
com.sun.corba.se.impl.io.ValueHandlerImpl
;
Hashtable
fields
=
(
Hashtable
)
readObject
();
return
new
LegacyHookGetFields
(
fields
);
}
public
interface
JavaCorbaAccess
{
public
ValueHandlerImpl
newValueHandlerImpl
();
}
src/share/classes/
com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3_1
.java
→
src/share/classes/
sun/corba/SharedSecrets
.java
浏览文件 @
18cc65d5
/*
* Copyright (c) 20
01, 200
2, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 20
1
2, 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
...
...
@@ -23,44 +23,38 @@
* questions.
*/
/*
*/
package
com.sun.corba.se.impl.orbutil
;
import
java.io.*
;
import
java.util.Hashtable
;
/**
* Implements legacy behavior from Ladybird to maintain
* backwards compatibility.
*/
public
class
IIOPOutputStream_1_3_1
extends
com
.
sun
.
corba
.
se
.
impl
.
io
.
IIOPOutputStream
{
// We can't assume that the superclass's putFields
// member will be non-private. We must allow
// the RI to run on JDK 1.3.1 FCS as well as
// the JDK 1.3.1_01 patch.
private
ObjectOutputStream
.
PutField
putFields_1_3_1
;
public
IIOPOutputStream_1_3_1
()
throws
java
.
io
.
IOException
{
super
();
package
sun.corba
;
import
com.sun.corba.se.impl.io.ValueUtility
;
import
sun.misc.Unsafe
;
import
java.security.AccessController
;
/** A repository of "shared secrets", which are a mechanism for
calling implementation-private methods in another package without
using reflection. A package-private class implements a public
interface and provides the ability to call package-private methods
within that package; the object implementing that interface is
provided through a third package to which access is restricted.
This framework avoids the primary disadvantage of using reflection
for this purpose, namely the loss of compile-time checking. */
// SharedSecrets cloned in corba repo to avoid build issues
public
class
SharedSecrets
{
private
static
final
Unsafe
unsafe
=
Unsafe
.
getUnsafe
();
private
static
JavaCorbaAccess
javaCorbaAccess
;
public
static
JavaCorbaAccess
getJavaCorbaAccess
()
{
if
(
javaCorbaAccess
==
null
)
{
// Ensure ValueUtility is initialized; we know that that class
// provides the shared secret
unsafe
.
ensureClassInitialized
(
ValueUtility
.
class
);
}
return
javaCorbaAccess
;
}
/**
* Before JDK 1.3.1_01, the PutField/GetField implementation
* actually sent a Hashtable.
*/
public
ObjectOutputStream
.
PutField
putFields
()
throws
IOException
{
putFields_1_3_1
=
new
LegacyHookPutFields
();
return
putFields_1_3_1
;
public
static
void
setJavaCorbaAccess
(
JavaCorbaAccess
access
)
{
javaCorbaAccess
=
access
;
}
public
void
writeFields
()
throws
IOException
{
putFields_1_3_1
.
write
(
this
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录