SwfToPDFTransactionCallback.java
4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.native2pdf.bmc.ConverterAgent
* com.adobe.native2pdf.bmc.ConverterAgentHelper
* com.adobe.native2pdf.bmc.ResultStruct
* com.adobe.pdfg.common.AESProperties
* com.adobe.pdfg.common.Utils
* com.adobe.pdfg.logging.PDFGLogger
* com.adobe.service.ConnectionFactory
*/
package com.adobe.pdfg.callbacks;
import com.adobe.native2pdf.bmc.ConverterAgent;
import com.adobe.native2pdf.bmc.ConverterAgentHelper;
import com.adobe.native2pdf.bmc.ResultStruct;
import com.adobe.pdfg.common.AESProperties;
import com.adobe.pdfg.common.Utils;
import com.adobe.pdfg.logging.PDFGLogger;
import com.adobe.pdfg.transaction.TransactionCallback;
import com.adobe.service.ConnectionFactory;
import org.omg.CORBA.Object;
public class SwfToPDFTransactionCallback
implements TransactionCallback {
private ConnectionFactory swfToPdfFactory;
private static final int MAX_RETRY_COUNT = 5;
private static final long WAIT_TIME = 60000;
String m_strSourcePath = null;
String m_strDestinationPath = null;
int m_iTimeoutSeconds = 270;
int m_dpi = 110;
private static PDFGLogger pdfgLogger = PDFGLogger.getPDFGLogger(SwfToPDFTransactionCallback.class);
public SwfToPDFTransactionCallback(ConnectionFactory swfToPdfFactory) {
this.swfToPdfFactory = swfToPdfFactory;
this.swfToPdfFactory.setServiceTimeout((long)AESProperties.getGlobalTimeout());
}
/*
* WARNING - Removed try catching itself - possible behaviour change.
*/
public java.lang.Object doInTransaction() {
boolean debugMsgsLogged;
StringBuilder debugMsgs;
ResultStruct resultStruct;
block8 : {
ConverterAgent agent = null;
String jobIdentityId = (String)Utils.threadLocalValue.get();
debugMsgs = new StringBuilder();
debugMsgsLogged = false;
debugMsgs.append("\nInside SwfToPDFTransactionCallback.doInTransaction for job=" + jobIdentityId);
try {
debugMsgs.append("\nbefore obtaining a CORBA connection for job=" + jobIdentityId);
Object connection = (Object)this.swfToPdfFactory.getConnection();
debugMsgs.append("\nbefore narrowing the CORBA connection for job=" + jobIdentityId);
agent = ConverterAgentHelper.narrow((Object)connection);
debugMsgs.append("\nbefore agent.convertSwfToPdf for job=" + jobIdentityId);
pdfgLogger.debug(debugMsgs.toString());
debugMsgsLogged = true;
resultStruct = agent.convertSwfToPdf(this.m_strSourcePath, this.m_strDestinationPath, this.m_dpi, this.m_iTimeoutSeconds, jobIdentityId);
java.lang.Object var8_7 = null;
if (agent == null) break block8;
}
catch (Throwable var7_11) {
java.lang.Object var8_8 = null;
if (agent != null) {
try {
agent.cleanUp();
}
catch (Exception t) {
pdfgLogger.trace(t.getMessage(), null, (Throwable)t);
}
}
if (!debugMsgsLogged) {
pdfgLogger.debug(debugMsgs.toString());
}
throw var7_11;
}
try {
agent.cleanUp();
}
catch (Exception t) {
pdfgLogger.trace(t.getMessage(), null, (Throwable)t);
}
}
if (!debugMsgsLogged) {
pdfgLogger.debug(debugMsgs.toString());
}
return resultStruct;
}
public void setTimeoutSeconds(int timeoutSeconds) {
this.m_iTimeoutSeconds = timeoutSeconds;
}
public void setDestinationPath(String destinationPath) {
this.m_strDestinationPath = destinationPath;
}
public void setSourcePath(String sourcePath) {
this.m_strSourcePath = sourcePath;
}
public int getDpi() {
return this.m_dpi;
}
public void setDpi(int m_dpi) {
this.m_dpi = m_dpi;
}
public void setSwfToPdfFactory(ConnectionFactory swfToPdfFactory) {
this.swfToPdfFactory = swfToPdfFactory;
}
}