PlatformPeerImpl.java
4.21 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
119
120
121
122
123
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.transaction.HeuristicMixedException
* javax.transaction.HeuristicRollbackException
* javax.transaction.NotSupportedException
* javax.transaction.RollbackException
* javax.transaction.SystemException
* javax.transaction.TransactionManager
* org.apache.commons.io.FilenameUtils
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.service.impl;
import com.adobe.aemds.bedrock.CoreConfigService;
import com.adobe.aemds.bedrock.internal.OSGiUtils;
import com.adobe.aemds.bedrock.internal.Utilities;
import com.adobe.service.ConnectionFactory;
import com.adobe.service.impl.Platform;
import java.io.File;
import java.util.Properties;
import javax.naming.NameNotFoundException;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.SystemException;
import javax.transaction.TransactionManager;
import org.apache.commons.io.FilenameUtils;
import org.omg.CORBA.Object;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
class PlatformPeerImpl
extends Platform {
private static final Logger logger = LoggerFactory.getLogger(PlatformPeerImpl.class);
PlatformPeerImpl() {
}
public Object lookup(String resourceType) throws NameNotFoundException {
ConnectionFactory svcDataSource = Utilities.serviceLookup(resourceType);
return (Object)svcDataSource.getConnection();
}
public TransactionManager getTransactionManager() {
return OSGiUtils.getTransactionManager();
}
public void beginTransaction() {
try {
TransactionManager tman = this.getTransactionManager();
tman.begin();
}
catch (NotSupportedException e) {
logger.warn("Error beginning transaction", (Throwable)e);
throw new IllegalStateException("Transactions not supported " + (java.lang.Object)e);
}
catch (SystemException e) {
logger.warn("Error beginning transaction", (Throwable)e);
throw new IllegalStateException("System exception from TransactionManager.begin() " + (java.lang.Object)e);
}
}
public void commitTransaction() {
try {
TransactionManager tman = this.getTransactionManager();
tman.commit();
}
catch (RollbackException e) {
logger.warn("Error committing transaction", (Throwable)e);
throw new IllegalStateException("Commit failure - rollbackException " + (java.lang.Object)e);
}
catch (HeuristicMixedException e) {
logger.warn("Error committing transaction", (Throwable)e);
throw new IllegalStateException("Commit failure - HeuristicMixedException " + (java.lang.Object)e);
}
catch (HeuristicRollbackException e) {
logger.warn("Error committing transaction", (Throwable)e);
throw new IllegalStateException("Commit failure - HeuristicRollbackException " + (java.lang.Object)e);
}
catch (SystemException e) {
logger.warn("Error committing transaction", (Throwable)e);
throw new IllegalStateException("Commit failure - SystemException " + (java.lang.Object)e);
}
}
public Properties getEnvironmentVariables() {
return Utilities.getEnvironment();
}
public File getCommonNativeDir() {
String dirPath = FilenameUtils.concat((String)this.getCoreConfigService().getServerNativeDir(), (String)"CommonNatives/lib");
return new File(dirPath);
}
public File getLegacyCommonNativeDir() {
return this.getCommonNativeDir();
}
public File getSSLNativeDir() {
return this.getCommonNativeDir();
}
public File getSSLCertDir() {
return new File(this.getCoreConfigService().getServerDataDir());
}
public String getSystemTempDirectory() {
return this.getCoreConfigService().getServerTempDir();
}
private CoreConfigService getCoreConfigService() {
return OSGiUtils.getCoreConfigService();
}
public String getAppServer() {
return "Adobe-OSGi";
}
}