Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8b0109ca
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
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看板
提交
8b0109ca
编写于
6月 03, 2019
作者:
Z
zgu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8055705: Rename UnixPrintServiceLookup and Win32PrintServiceLookup as a platform neutral class name
Reviewed-by: andrew
上级
11007a14
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
54 addition
and
56 deletion
+54
-56
make/CopyIntoClasses.gmk
make/CopyIntoClasses.gmk
+2
-2
src/share/classes/sun/print/services/javax.print.PrintServiceLookup
...classes/sun/print/services/javax.print.PrintServiceLookup
+2
-0
src/share/classes/sun/print/services/javax.print.StreamPrintServiceFactory
.../sun/print/services/javax.print.StreamPrintServiceFactory
+0
-0
src/solaris/classes/sun/print/CUPSPrinter.java
src/solaris/classes/sun/print/CUPSPrinter.java
+2
-2
src/solaris/classes/sun/print/IPPPrintService.java
src/solaris/classes/sun/print/IPPPrintService.java
+2
-2
src/solaris/classes/sun/print/PrintServiceLookupProvider.java
...solaris/classes/sun/print/PrintServiceLookupProvider.java
+3
-3
src/solaris/classes/sun/print/UnixPrintJob.java
src/solaris/classes/sun/print/UnixPrintJob.java
+2
-2
src/solaris/classes/sun/print/UnixPrintService.java
src/solaris/classes/sun/print/UnixPrintService.java
+29
-29
src/solaris/classes/sun/print/services/javax.print.PrintServiceLookup
...classes/sun/print/services/javax.print.PrintServiceLookup
+0
-2
src/windows/classes/sun/awt/windows/WPrinterJob.java
src/windows/classes/sun/awt/windows/WPrinterJob.java
+3
-3
src/windows/classes/sun/print/PrintServiceLookupProvider.java
...windows/classes/sun/print/PrintServiceLookupProvider.java
+4
-4
src/windows/classes/sun/print/services/javax.print.StreamPrintServiceFactory
.../sun/print/services/javax.print.StreamPrintServiceFactory
+0
-2
src/windows/native/sun/windows/WPrinterJob.cpp
src/windows/native/sun/windows/WPrinterJob.cpp
+5
-5
未找到文件。
make/CopyIntoClasses.gmk
浏览文件 @
8b0109ca
...
...
@@ -195,9 +195,9 @@ OUT_SERVICES_FILES := $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
$(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g'))
OUT_SERVICES_FILES_COLON := $(addsuffix :, $(OUT_SERVICES_FILES))
# Exception handling for print services with no META-INF directory
SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/
$(OPENJDK_TARGET_OS_API_DIR)
/classes/sun/print/services/*)
SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/
share
/classes/sun/print/services/*)
OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
$(patsubst $(JDK_TOPDIR)/src/
$(OPENJDK_TARGET_OS_API_DIR)
/classes/sun/print/services/%, %, \
$(patsubst $(JDK_TOPDIR)/src/
share
/classes/sun/print/services/%, %, \
$(SRC_SERVICES_FILES_PRINT)))
OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :, $(OUT_SERVICES_FILES_PRINT))
RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON), $(SRC_SERVICES_FILES_PRINT))
...
...
src/
windows
/classes/sun/print/services/javax.print.PrintServiceLookup
→
src/
share
/classes/sun/print/services/javax.print.PrintServiceLookup
浏览文件 @
8b0109ca
# Provider for Java Print Service
sun.print.
Win32PrintServiceLookup
sun.print.
PrintServiceLookupProvider
src/s
olaris
/classes/sun/print/services/javax.print.StreamPrintServiceFactory
→
src/s
hare
/classes/sun/print/services/javax.print.StreamPrintServiceFactory
浏览文件 @
8b0109ca
文件已移动
src/solaris/classes/sun/print/CUPSPrinter.java
浏览文件 @
8b0109ca
...
...
@@ -318,8 +318,8 @@ public class CUPSPrinter {
* reported, exec lpstat -d which has all the Apple
* special behaviour for this built in.
*/
if
(
UnixPrintServiceLookup
.
isMac
())
{
printerInfo
[
0
]
=
UnixPrintServiceLookup
.
if
(
PrintServiceLookupProvider
.
isMac
())
{
printerInfo
[
0
]
=
PrintServiceLookupProvider
.
getDefaultPrinterNameSysV
();
printerInfo
[
1
]
=
null
;
return
(
String
[])
printerInfo
.
clone
();
...
...
src/solaris/classes/sun/print/IPPPrintService.java
浏览文件 @
8b0109ca
...
...
@@ -1042,7 +1042,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
setting like collation. Therefore, we temporarily exclude
Linux.
*/
if
(!
UnixPrintServiceLookup
.
isLinux
())
{
if
(!
PrintServiceLookupProvider
.
isLinux
())
{
catList
.
add
(
SheetCollate
.
class
);
}
}
...
...
@@ -1586,7 +1586,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
* Mac is using printer-info IPP attribute for its human-readable printer
* name and is also the identifier used in NSPrintInfo:setPrinter.
*/
if
(
UnixPrintServiceLookup
.
isMac
())
{
if
(
PrintServiceLookupProvider
.
isMac
())
{
PrintServiceAttributeSet
psaSet
=
this
.
getAttributes
();
if
(
psaSet
!=
null
)
{
PrinterInfo
pName
=
(
PrinterInfo
)
psaSet
.
get
(
PrinterInfo
.
class
);
...
...
src/solaris/classes/sun/print/
UnixPrintServiceLookup
.java
→
src/solaris/classes/sun/print/
PrintServiceLookupProvider
.java
浏览文件 @
8b0109ca
...
...
@@ -58,7 +58,7 @@ import java.nio.file.Files;
* Remind: This class uses solaris commands. We also need a linux
* version
*/
public
class
UnixPrintServiceLookup
extends
PrintServiceLookup
public
class
PrintServiceLookupProvider
extends
PrintServiceLookup
implements
BackgroundServiceLookup
,
Runnable
{
/* Remind: the current implementation is static, as its assumed
...
...
@@ -70,7 +70,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
private
PrintService
defaultPrintService
;
private
PrintService
[]
printServices
;
/* includes the default printer */
private
Vector
lookupListeners
=
null
;
private
static
String
debugPrefix
=
"
UnixPrintServiceLookup
>> "
;
private
static
String
debugPrefix
=
"
PrintServiceLookupProvider
>> "
;
private
static
boolean
pollServices
=
true
;
private
static
final
int
DEFAULT_MINREFRESH
=
120
;
// 2 minutes
private
static
int
minRefreshTime
=
DEFAULT_MINREFRESH
;
...
...
@@ -208,7 +208,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
}
public
UnixPrintServiceLookup
()
{
public
PrintServiceLookupProvider
()
{
// start the printer listener thread
if
(
pollServices
)
{
PrinterChangeListener
thr
=
new
PrinterChangeListener
();
...
...
src/solaris/classes/sun/print/UnixPrintJob.java
浏览文件 @
8b0109ca
...
...
@@ -122,7 +122,7 @@ public class UnixPrintJob implements CancelablePrintJob {
UnixPrintJob
(
PrintService
service
)
{
this
.
service
=
service
;
mDestination
=
service
.
getName
();
if
(
UnixPrintServiceLookup
.
isMac
())
{
if
(
PrintServiceLookupProvider
.
isMac
())
{
mDestination
=
((
IPPPrintService
)
service
).
getDest
();
}
mDestType
=
UnixPrintJob
.
DESTPRINTER
;
...
...
@@ -873,7 +873,7 @@ public class UnixPrintJob implements CancelablePrintJob {
pFlags
|=
NOSHEET
;
ncomps
+=
1
;
}
if
(
UnixPrintServiceLookup
.
osname
.
equals
(
"SunOS"
))
{
if
(
PrintServiceLookupProvider
.
osname
.
equals
(
"SunOS"
))
{
ncomps
+=
1
;
// lp uses 1 more arg than lpr (make a copy)
execCmd
=
new
String
[
ncomps
];
execCmd
[
n
++]
=
"/usr/bin/lp"
;
...
...
src/solaris/classes/sun/print/UnixPrintService.java
浏览文件 @
8b0109ca
...
...
@@ -220,7 +220,7 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
private
PrinterIsAcceptingJobs
getPrinterIsAcceptingJobsSysV
()
{
String
command
=
"/usr/bin/lpstat -a "
+
printer
;
String
results
[]=
UnixPrintServiceLookup
.
execCmd
(
command
);
String
results
[]=
PrintServiceLookupProvider
.
execCmd
(
command
);
if
(
results
!=
null
&&
results
.
length
>
0
)
{
if
(
results
[
0
].
startsWith
(
printer
+
" accepting requests"
))
{
...
...
@@ -244,20 +244,20 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
}
private
PrinterIsAcceptingJobs
getPrinterIsAcceptingJobsBSD
()
{
if
(
UnixPrintServiceLookup
.
cmdIndex
==
UnixPrintServiceLookup
.
UNINITIALIZED
)
{
if
(
PrintServiceLookupProvider
.
cmdIndex
==
PrintServiceLookupProvider
.
UNINITIALIZED
)
{
UnixPrintServiceLookup
.
cmdIndex
=
UnixPrintServiceLookup
.
getBSDCommandIndex
();
PrintServiceLookupProvider
.
cmdIndex
=
PrintServiceLookupProvider
.
getBSDCommandIndex
();
}
String
command
=
"/usr/sbin/lpc status "
+
printer
+
lpcStatusCom
[
UnixPrintServiceLookup
.
cmdIndex
];
String
results
[]=
UnixPrintServiceLookup
.
execCmd
(
command
);
+
lpcStatusCom
[
PrintServiceLookupProvider
.
cmdIndex
];
String
results
[]=
PrintServiceLookupProvider
.
execCmd
(
command
);
if
(
results
!=
null
&&
results
.
length
>
0
)
{
if
(
UnixPrintServiceLookup
.
cmdIndex
==
UnixPrintServiceLookup
.
BSD_LPD_NG
)
{
if
(
PrintServiceLookupProvider
.
cmdIndex
==
PrintServiceLookupProvider
.
BSD_LPD_NG
)
{
if
(
results
[
0
].
startsWith
(
"enabled enabled"
))
{
return
PrinterIsAcceptingJobs
.
ACCEPTING_JOBS
;
}
...
...
@@ -276,7 +276,7 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
// Filter the list of possible AIX Printers and remove header lines
// and extra lines which have been added for remote printers.
// 'protected' because this method is also used from
UnixPrintServiceLookup
.
// 'protected' because this method is also used from
PrintServiceLookupProvider
.
protected
static
String
[]
filterPrinterNamesAIX
(
String
[]
posPrinters
)
{
ArrayList
printers
=
new
ArrayList
();
String
[]
splitPart
;
...
...
@@ -301,7 +301,7 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
private
PrinterIsAcceptingJobs
getPrinterIsAcceptingJobsAIX
()
{
// On AIX there should not be a blank after '-a'.
String
command
=
"/usr/bin/lpstat -a"
+
printer
;
String
results
[]=
UnixPrintServiceLookup
.
execCmd
(
command
);
String
results
[]=
PrintServiceLookupProvider
.
execCmd
(
command
);
// Remove headers and bogus entries added by remote printers.
results
=
filterPrinterNamesAIX
(
results
);
...
...
@@ -320,11 +320,11 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
}
private
PrinterIsAcceptingJobs
getPrinterIsAcceptingJobs
()
{
if
(
UnixPrintServiceLookup
.
isSysV
())
{
if
(
PrintServiceLookupProvider
.
isSysV
())
{
return
getPrinterIsAcceptingJobsSysV
();
}
else
if
(
UnixPrintServiceLookup
.
isBSD
())
{
}
else
if
(
PrintServiceLookupProvider
.
isBSD
())
{
return
getPrinterIsAcceptingJobsBSD
();
}
else
if
(
UnixPrintServiceLookup
.
isAIX
())
{
}
else
if
(
PrintServiceLookupProvider
.
isAIX
())
{
return
getPrinterIsAcceptingJobsAIX
();
}
else
{
return
PrinterIsAcceptingJobs
.
ACCEPTING_JOBS
;
...
...
@@ -351,29 +351,29 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
private
QueuedJobCount
getQueuedJobCountSysV
()
{
String
command
=
"/usr/bin/lpstat -R "
+
printer
;
String
results
[]=
UnixPrintServiceLookup
.
execCmd
(
command
);
String
results
[]=
PrintServiceLookupProvider
.
execCmd
(
command
);
int
qlen
=
(
results
==
null
)
?
0
:
results
.
length
;
return
new
QueuedJobCount
(
qlen
);
}
private
QueuedJobCount
getQueuedJobCountBSD
()
{
if
(
UnixPrintServiceLookup
.
cmdIndex
==
UnixPrintServiceLookup
.
UNINITIALIZED
)
{
if
(
PrintServiceLookupProvider
.
cmdIndex
==
PrintServiceLookupProvider
.
UNINITIALIZED
)
{
UnixPrintServiceLookup
.
cmdIndex
=
UnixPrintServiceLookup
.
getBSDCommandIndex
();
PrintServiceLookupProvider
.
cmdIndex
=
PrintServiceLookupProvider
.
getBSDCommandIndex
();
}
int
qlen
=
0
;
String
command
=
"/usr/sbin/lpc status "
+
printer
+
lpcQueueCom
[
UnixPrintServiceLookup
.
cmdIndex
];
String
results
[]
=
UnixPrintServiceLookup
.
execCmd
(
command
);
+
lpcQueueCom
[
PrintServiceLookupProvider
.
cmdIndex
];
String
results
[]
=
PrintServiceLookupProvider
.
execCmd
(
command
);
if
(
results
!=
null
&&
results
.
length
>
0
)
{
String
queued
;
if
(
UnixPrintServiceLookup
.
cmdIndex
==
UnixPrintServiceLookup
.
BSD_LPD_NG
)
{
if
(
PrintServiceLookupProvider
.
cmdIndex
==
PrintServiceLookupProvider
.
BSD_LPD_NG
)
{
queued
=
results
[
0
];
}
else
{
queued
=
results
[
3
].
trim
();
...
...
@@ -396,7 +396,7 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
private
QueuedJobCount
getQueuedJobCountAIX
()
{
// On AIX there should not be a blank after '-a'.
String
command
=
"/usr/bin/lpstat -a"
+
printer
;
String
results
[]=
UnixPrintServiceLookup
.
execCmd
(
command
);
String
results
[]=
PrintServiceLookupProvider
.
execCmd
(
command
);
// Remove headers and bogus entries added by remote printers.
results
=
filterPrinterNamesAIX
(
results
);
...
...
@@ -413,11 +413,11 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
}
private
QueuedJobCount
getQueuedJobCount
()
{
if
(
UnixPrintServiceLookup
.
isSysV
())
{
if
(
PrintServiceLookupProvider
.
isSysV
())
{
return
getQueuedJobCountSysV
();
}
else
if
(
UnixPrintServiceLookup
.
isBSD
())
{
}
else
if
(
PrintServiceLookupProvider
.
isBSD
())
{
return
getQueuedJobCountBSD
();
}
else
if
(
UnixPrintServiceLookup
.
isAIX
())
{
}
else
if
(
PrintServiceLookupProvider
.
isAIX
())
{
return
getQueuedJobCountAIX
();
}
else
{
return
new
QueuedJobCount
(
0
);
...
...
@@ -468,9 +468,9 @@ public class UnixPrintService implements PrintService, AttributeUpdater,
}
private
PrintServiceAttributeSet
getDynamicAttributes
()
{
if
(
UnixPrintServiceLookup
.
isSysV
())
{
if
(
PrintServiceLookupProvider
.
isSysV
())
{
return
getSysVServiceAttributes
();
}
else
if
(
UnixPrintServiceLookup
.
isAIX
())
{
}
else
if
(
PrintServiceLookupProvider
.
isAIX
())
{
return
getAIXServiceAttributes
();
}
else
{
return
getBSDServiceAttributes
();
...
...
src/solaris/classes/sun/print/services/javax.print.PrintServiceLookup
已删除
100644 → 0
浏览文件 @
11007a14
# Provider for Java Print Service
sun.print.UnixPrintServiceLookup
src/windows/classes/sun/awt/windows/WPrinterJob.java
浏览文件 @
8b0109ca
...
...
@@ -93,7 +93,7 @@ import sun.print.SunAlternateMedia;
import
sun.print.SunPageSelection
;
import
sun.print.Win32MediaTray
;
import
sun.print.Win32PrintService
;
import
sun.print.
Win32PrintServiceLookup
;
import
sun.print.
PrintServiceLookupProvider
;
import
sun.print.ServiceDialog
;
import
sun.print.DialogOwner
;
...
...
@@ -454,7 +454,7 @@ public final class WPrinterJob extends RasterPrinterJob
// native printer is different !
// we update the current PrintService
try
{
setPrintService
(
Win32PrintServiceLookup
.
setPrintService
(
PrintServiceLookupProvider
.
getWin32PrintLUS
().
getPrintServiceByName
(
printerName
));
}
catch
(
PrinterException
e
)
{
...
...
@@ -628,7 +628,7 @@ public final class WPrinterJob extends RasterPrinterJob
String
printerName
=
getNativePrintService
();
if
(
printerName
!=
null
)
{
myService
=
Win32PrintServiceLookup
.
getWin32PrintLUS
().
myService
=
PrintServiceLookupProvider
.
getWin32PrintLUS
().
getPrintServiceByName
(
printerName
);
// no need to call setNativePrintService as this name is
// currently set in native
...
...
src/windows/classes/sun/print/
Win32PrintServiceLookup
.java
→
src/windows/classes/sun/print/
PrintServiceLookupProvider
.java
浏览文件 @
8b0109ca
...
...
@@ -47,7 +47,7 @@ import javax.print.attribute.PrintServiceAttribute;
import
javax.print.attribute.PrintServiceAttributeSet
;
import
javax.print.attribute.standard.PrinterName
;
public
class
Win32PrintServiceLookup
extends
PrintServiceLookup
{
public
class
PrintServiceLookupProvider
extends
PrintServiceLookup
{
private
String
defaultPrinter
;
private
PrintService
defaultPrintService
;
...
...
@@ -70,10 +70,10 @@ public class Win32PrintServiceLookup extends PrintServiceLookup {
* javax.print.PrintServiceLookup.defaultPrintService() so that the
* same instance is stored there.
*/
private
static
Win32PrintServiceLookup
win32PrintLUS
;
private
static
PrintServiceLookupProvider
win32PrintLUS
;
/* Think carefully before calling this. Preferably don't call it. */
public
static
Win32PrintServiceLookup
getWin32PrintLUS
()
{
public
static
PrintServiceLookupProvider
getWin32PrintLUS
()
{
if
(
win32PrintLUS
==
null
)
{
/* This call is internally synchronized.
* When it returns an instance of this class will have
...
...
@@ -84,7 +84,7 @@ public class Win32PrintServiceLookup extends PrintServiceLookup {
return
win32PrintLUS
;
}
public
Win32PrintServiceLookup
()
{
public
PrintServiceLookupProvider
()
{
if
(
win32PrintLUS
==
null
)
{
win32PrintLUS
=
this
;
...
...
src/windows/classes/sun/print/services/javax.print.StreamPrintServiceFactory
已删除
100644 → 0
浏览文件 @
11007a14
# Providers for Java 2D/JPS Stream print services.
sun.print.PSStreamPrinterFactory
src/windows/native/sun/windows/WPrinterJob.cpp
浏览文件 @
8b0109ca
...
...
@@ -68,7 +68,7 @@ static BOOL IsSupportedLevel(HANDLE hPrinter, DWORD dwLevel) {
extern
"C"
{
JNIEXPORT
jstring
JNICALL
Java_sun_print_
Win32PrintServiceLookup
_getDefaultPrinterName
(
JNIEnv
*
env
,
Java_sun_print_
PrintServiceLookupProvider
_getDefaultPrinterName
(
JNIEnv
*
env
,
jobject
peer
)
{
TRY
;
...
...
@@ -119,7 +119,7 @@ Java_sun_print_Win32PrintServiceLookup_getDefaultPrinterName(JNIEnv *env,
JNIEXPORT
jobjectArray
JNICALL
Java_sun_print_
Win32PrintServiceLookup
_getAllPrinterNames
(
JNIEnv
*
env
,
Java_sun_print_
PrintServiceLookupProvider
_getAllPrinterNames
(
JNIEnv
*
env
,
jobject
peer
)
{
TRY
;
...
...
@@ -176,7 +176,7 @@ Java_sun_print_Win32PrintServiceLookup_getAllPrinterNames(JNIEnv *env,
JNIEXPORT
jlong
JNICALL
Java_sun_print_
Win32PrintServiceLookup
_notifyFirstPrinterChange
(
JNIEnv
*
env
,
Java_sun_print_
PrintServiceLookupProvider
_notifyFirstPrinterChange
(
JNIEnv
*
env
,
jobject
peer
,
jstring
printer
)
{
HANDLE
hPrinter
;
...
...
@@ -210,7 +210,7 @@ Java_sun_print_Win32PrintServiceLookup_notifyFirstPrinterChange(JNIEnv *env,
JNIEXPORT
void
JNICALL
Java_sun_print_
Win32PrintServiceLookup
_notifyClosePrinterChange
(
JNIEnv
*
env
,
Java_sun_print_
PrintServiceLookupProvider
_notifyClosePrinterChange
(
JNIEnv
*
env
,
jobject
peer
,
jlong
chgObject
)
{
FindClosePrinterChangeNotification
((
HANDLE
)
chgObject
);
...
...
@@ -218,7 +218,7 @@ Java_sun_print_Win32PrintServiceLookup_notifyClosePrinterChange(JNIEnv *env,
JNIEXPORT
jint
JNICALL
Java_sun_print_
Win32PrintServiceLookup
_notifyPrinterChange
(
JNIEnv
*
env
,
Java_sun_print_
PrintServiceLookupProvider
_notifyPrinterChange
(
JNIEnv
*
env
,
jobject
peer
,
jlong
chgObject
)
{
DWORD
dwChange
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录