View | Details | Raw Unified | Return to bug 407279 | Differences between
and this patch

Collapse All | Expand All

(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/config/TargetServer.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
2
 * Copyright (c) 1998, 2014 Oracle, IBM Corporation and/or its affiliates. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
5
 * which accompanies this distribution. 
Lines 9-14 Link Here
9
 *
9
 *
10
 * Contributors:
10
 * Contributors:
11
 *     Oracle - initial API and implementation from Oracle TopLink
11
 *     Oracle - initial API and implementation from Oracle TopLink
12
 *     Rick Curtis - Add WebSphere Liberty target server.
12
 ******************************************************************************/  
13
 ******************************************************************************/  
13
package org.eclipse.persistence.config;
14
package org.eclipse.persistence.config;
14
15
Lines 32-37 public class TargetServer { Link Here
32
    public static final String  WebSphere = "WebSphere";
33
    public static final String  WebSphere = "WebSphere";
33
    public static final String  WebSphere_6_1 = "WebSphere_6_1";
34
    public static final String  WebSphere_6_1 = "WebSphere_6_1";
34
    public static final String  WebSphere_7 = "WebSphere_7";
35
    public static final String  WebSphere_7 = "WebSphere_7";
36
    public static final String  WebSphere_Liberty = "WebSphere_Liberty";
35
    public static final String  WebLogic = "WebLogic";
37
    public static final String  WebLogic = "WebLogic";
36
    public static final String  WebLogic_9 = "WebLogic_9";
38
    public static final String  WebLogic_9 = "WebLogic_9";
37
    public static final String  WebLogic_10 = "WebLogic_10";
39
    public static final String  WebLogic_10 = "WebLogic_10";
(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/PropertiesHandler.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
2
 * Copyright (c) 1998, 2014 Oracle, IBM Corporation and/or its affiliates. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
5
 * which accompanies this distribution. 
Lines 11-16 Link Here
11
 *     Oracle - initial API and implementation from Oracle TopLink
11
 *     Oracle - initial API and implementation from Oracle TopLink
12
 *      Gordon Yorke - VM managed entity detachment
12
 *      Gordon Yorke - VM managed entity detachment
13
 *     Eduard Bartsch, SAP - Fix for Bug 351186 - ConcurrentModificationException Exception in PropertiesHandler 
13
 *     Eduard Bartsch, SAP - Fix for Bug 351186 - ConcurrentModificationException Exception in PropertiesHandler 
14
 *     Rick Curtis - Add support for WebSphere Liberty platform.
14
 ******************************************************************************/  
15
 ******************************************************************************/  
15
package org.eclipse.persistence.internal.sessions;
16
package org.eclipse.persistence.internal.sessions;
16
17
Lines 557-562 public class PropertiesHandler { Link Here
557
                {TargetServer.WebSphere, pcg + "was.WebSpherePlatform"},
558
                {TargetServer.WebSphere, pcg + "was.WebSpherePlatform"},
558
                {TargetServer.WebSphere_6_1, pcg + "was.WebSphere_6_1_Platform"},
559
                {TargetServer.WebSphere_6_1, pcg + "was.WebSphere_6_1_Platform"},
559
                {TargetServer.WebSphere_7, pcg + "was.WebSphere_7_Platform"},
560
                {TargetServer.WebSphere_7, pcg + "was.WebSphere_7_Platform"},
561
                {TargetServer.WebSphere_Liberty, pcg + "was.WebSphere_Liberty_Platform"},
560
                {TargetServer.WebLogic, pcg + "wls.WebLogicPlatform"},
562
                {TargetServer.WebLogic, pcg + "wls.WebLogicPlatform"},
561
                {TargetServer.WebLogic_9, pcg + "wls.WebLogic_9_Platform"},
563
                {TargetServer.WebLogic_9, pcg + "wls.WebLogic_9_Platform"},
562
                {TargetServer.WebLogic_10, pcg + "wls.WebLogic_10_Platform"},
564
                {TargetServer.WebLogic_10, pcg + "wls.WebLogic_10_Platform"},
(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/factories/XMLSessionConfigProject_11_1_1.java (-2 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
2
 * Copyright (c) 1998, 2014 Oracle, IBM Corporation and/or its affiliates. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
5
 * which accompanies this distribution. 
Lines 9-14 Link Here
9
 *
9
 *
10
 * Contributors:
10
 * Contributors:
11
 *     Oracle - initial API and implementation from Oracle TopLink
11
 *     Oracle - initial API and implementation from Oracle TopLink
12
 *     Rick Curtis - Add support for WebSphere Liberty
12
 ******************************************************************************/  
13
 ******************************************************************************/  
13
package org.eclipse.persistence.internal.sessions.factories;
14
package org.eclipse.persistence.internal.sessions.factories;
14
15
Lines 39-44 import org.eclipse.persistence.internal.sessions.factories.model.platform.WebLog Link Here
39
import org.eclipse.persistence.internal.sessions.factories.model.platform.WebLogic_9_PlatformConfig;
40
import org.eclipse.persistence.internal.sessions.factories.model.platform.WebLogic_9_PlatformConfig;
40
import org.eclipse.persistence.internal.sessions.factories.model.platform.WebSphere_6_1_PlatformConfig;
41
import org.eclipse.persistence.internal.sessions.factories.model.platform.WebSphere_6_1_PlatformConfig;
41
import org.eclipse.persistence.internal.sessions.factories.model.platform.WebSphere_7_0_PlatformConfig;
42
import org.eclipse.persistence.internal.sessions.factories.model.platform.WebSphere_7_0_PlatformConfig;
43
import org.eclipse.persistence.internal.sessions.factories.model.platform.WebSphere_Liberty_Platform_Config;
42
import org.eclipse.persistence.internal.sessions.factories.model.transport.Oc4jJGroupsTransportManagerConfig;
44
import org.eclipse.persistence.internal.sessions.factories.model.transport.Oc4jJGroupsTransportManagerConfig;
43
import org.eclipse.persistence.internal.sessions.factories.model.transport.TransportManagerConfig;
45
import org.eclipse.persistence.internal.sessions.factories.model.transport.TransportManagerConfig;
44
46
Lines 62-67 public class XMLSessionConfigProject_11_1_1 extends XMLSessionConfigProject { Link Here
62
        addDescriptor(buildServerPlatformConfigDescriptorFor(WebLogic_10_PlatformConfig.class));
64
        addDescriptor(buildServerPlatformConfigDescriptorFor(WebLogic_10_PlatformConfig.class));
63
        addDescriptor(buildServerPlatformConfigDescriptorFor(WebSphere_6_1_PlatformConfig.class));
65
        addDescriptor(buildServerPlatformConfigDescriptorFor(WebSphere_6_1_PlatformConfig.class));
64
        addDescriptor(buildServerPlatformConfigDescriptorFor(WebSphere_7_0_PlatformConfig.class));
66
        addDescriptor(buildServerPlatformConfigDescriptorFor(WebSphere_7_0_PlatformConfig.class));
67
        addDescriptor(buildServerPlatformConfigDescriptorFor(WebSphere_Liberty_Platform_Config.class));
65
        
68
        
66
        // 242452 -- add metadata support for XMLLogin's DocumentPreservationPolicy
69
        // 242452 -- add metadata support for XMLLogin's DocumentPreservationPolicy
67
        addDescriptor(buildDocumentPreservationPolicyConfigDescriptor());
70
        addDescriptor(buildDocumentPreservationPolicyConfigDescriptor());
Lines 170-176 public class XMLSessionConfigProject_11_1_1 extends XMLSessionConfigProject { Link Here
170
        descriptor.getInheritancePolicy().addClassIndicator(WebLogic_9_PlatformConfig.class, "weblogic-9-platform");
173
        descriptor.getInheritancePolicy().addClassIndicator(WebLogic_9_PlatformConfig.class, "weblogic-9-platform");
171
        descriptor.getInheritancePolicy().addClassIndicator(WebLogic_10_PlatformConfig.class, "weblogic-10-platform");
174
        descriptor.getInheritancePolicy().addClassIndicator(WebLogic_10_PlatformConfig.class, "weblogic-10-platform");
172
        descriptor.getInheritancePolicy().addClassIndicator(WebSphere_6_1_PlatformConfig.class, "websphere-61-platform");
175
        descriptor.getInheritancePolicy().addClassIndicator(WebSphere_6_1_PlatformConfig.class, "websphere-61-platform");
173
        descriptor.getInheritancePolicy().addClassIndicator(WebSphere_7_0_PlatformConfig.class, "websphere-7-platform");	
176
        descriptor.getInheritancePolicy().addClassIndicator(WebSphere_7_0_PlatformConfig.class, "websphere-7-platform");
177
        descriptor.getInheritancePolicy().addClassIndicator(WebSphere_Liberty_Platform_Config.class, "websphere-liberty-platform");
174
        return descriptor;
178
        return descriptor;
175
    }
179
    }
176
180
(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/factories/model/platform/WebSphere_Liberty_Platform_Config.java (+19 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2014 IBM Corporation. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Rick Curtis - Add support for WebSphere Liberty.
12
 ******************************************************************************/
13
package org.eclipse.persistence.internal.sessions.factories.model.platform;
14
15
public class WebSphere_Liberty_Platform_Config extends ServerPlatformConfig {
16
    public WebSphere_Liberty_Platform_Config() {
17
        super("org.eclipse.persistence.platform.server.was.WebSphere_Liberty_Platform");
18
    }
19
}
(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/platform/server/was/WebSphere_Liberty_Platform.java (+70 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2014 IBM Corporation. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Rick Curtis - Add support for WebSphere Liberty.       
12
 ******************************************************************************/
13
package org.eclipse.persistence.platform.server.was;
14
15
import java.sql.Connection;
16
17
import org.eclipse.persistence.logging.SessionLog;
18
import org.eclipse.persistence.sessions.DatabaseSession;
19
import org.eclipse.persistence.transaction.was.WebSphereLibertyTransactionController;
20
21
/**
22
 * PUBLIC:
23
 * 
24
 * This is the concrete subclass responsible for representing WebSphere-specific server behavior.
25
 * 
26
 * This platform has:
27
 * <ul>
28
 * <li>WebSphereLibertyTransactionController (JTA integration).
29
 * </ul>
30
 */
31
public class WebSphere_Liberty_Platform extends WebSphere_7_Platform {
32
    /**
33
     * INTERNAL: Default Constructor: All behavior for the default constructor is inherited
34
     */
35
    public WebSphere_Liberty_Platform(DatabaseSession newDatabaseSession) {
36
        super(newDatabaseSession);
37
    }
38
39
    /**
40
     * INTERNAL: getExternalTransactionControllerClass(): Answer the class of external transaction
41
     * controller to use for WebSphere Liberty. This is read-only.
42
     * 
43
     * @return Class externalTransactionControllerClass
44
     * 
45
     * @see org.eclipse.persistence.transaction.JTATransactionController
46
     * @see ServerPlatformBase.isJTAEnabled()
47
     * @see ServerPlatformBase.disableJTA()
48
     * @see ServerPlatformBase.initializeExternalTransactionController()
49
     */
50
    public Class getExternalTransactionControllerClass() {
51
        if (externalTransactionControllerClass == null) {
52
            externalTransactionControllerClass = WebSphereLibertyTransactionController.class;
53
        }
54
        return externalTransactionControllerClass;
55
    }
56
57
    /**
58
     * This method overrides functionality exposed in the base WebSpherePlatform as Liberty doesn't
59
     * provide the same support.
60
     */
61
    @Override
62
    public Connection unwrapConnection(Connection connection) {
63
        try {
64
            return connection.getMetaData().getConnection();
65
        } catch (java.sql.SQLException e) {
66
            getAbstractSession().log(SessionLog.WARNING, SessionLog.CONNECTION, "cannot_unwrap_connection", e);
67
            return connection;
68
        }
69
    }
70
}
(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/transaction/was/WebSphereLibertyTransactionController.java (+27 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2014 IBM Corporation. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Rick Curtis - Initial implementation.
12
 ******************************************************************************/
13
package org.eclipse.persistence.transaction.was;
14
15
public class WebSphereLibertyTransactionController extends WebSphereTransactionController {
16
    // Class and method to execute to obtain the TransactionManager
17
    protected final static String TX_MANAGER_FACTORY_CLASS = "com.ibm.tx.jta.TransactionManagerFactory";
18
    protected final static String TX_MANAGER_FACTORY_METHOD = "getTransactionManager";
19
20
    protected String getTxManagerFactoryClass() {
21
        return this.TX_MANAGER_FACTORY_CLASS;
22
    }
23
24
    protected String getTxManagerFactoryMethod() {
25
        return TX_MANAGER_FACTORY_METHOD;
26
    }
27
}
(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/transaction/was/WebSphereTransactionController.java (-6 / +14 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
2
 * Copyright (c) 1998, 2014 Oracle, IBM Corporation and/or its affiliates. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
5
 * which accompanies this distribution. 
Lines 9-14 Link Here
9
 *
9
 *
10
 * Contributors:
10
 * Contributors:
11
 *     Oracle - initial API and implementation from Oracle TopLink
11
 *     Oracle - initial API and implementation from Oracle TopLink
12
 *     Rick Curtis -- Refactor to facilitate adding WebSphereLibertyTransactionController.
12
 ******************************************************************************/  
13
 ******************************************************************************/  
13
package org.eclipse.persistence.transaction.was;
14
package org.eclipse.persistence.transaction.was;
14
15
Lines 43-48 public class WebSphereTransactionController extends JTATransactionController { Link Here
43
        super();
44
        super();
44
    }
45
    }
45
46
47
    protected String getTxManagerFactoryClass() {
48
        return TX_MANAGER_FACTORY_CLASS;
49
    }
50
51
    protected String getTxManagerFactoryMethod() {
52
        return TX_MANAGER_FACTORY_METHOD;
53
    }
54
        
46
    /**
55
    /**
47
     * INTERNAL:
56
     * INTERNAL:
48
     * Obtain and return the JTA TransactionManager on this platform.
57
     * Obtain and return the JTA TransactionManager on this platform.
Lines 51-58 public class WebSphereTransactionController extends JTATransactionController { Link Here
51
    protected TransactionManager acquireTransactionManager() throws Exception {
60
    protected TransactionManager acquireTransactionManager() throws Exception {
52
        if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
61
        if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
53
            try{
62
            try{
54
                Class clazz = (Class) AccessController.doPrivileged(new PrivilegedClassForName(TX_MANAGER_FACTORY_CLASS));
63
                Class clazz = (Class) AccessController.doPrivileged(new PrivilegedClassForName(getTxManagerFactoryClass()));
55
                Method method = AccessController.doPrivileged(new PrivilegedGetMethod(clazz, TX_MANAGER_FACTORY_METHOD, null, false));
64
                Method method = AccessController.doPrivileged(new PrivilegedGetMethod(clazz, getTxManagerFactoryMethod(), null, false));
56
                return (TransactionManager) AccessController.doPrivileged(new PrivilegedMethodInvoker(method, null, null));
65
                return (TransactionManager) AccessController.doPrivileged(new PrivilegedMethodInvoker(method, null, null));
57
            }catch (PrivilegedActionException ex){
66
            }catch (PrivilegedActionException ex){
58
                if (ex.getCause() instanceof ClassNotFoundException){
67
                if (ex.getCause() instanceof ClassNotFoundException){
Lines 70-77 public class WebSphereTransactionController extends JTATransactionController { Link Here
70
                throw (RuntimeException) ex.getCause();
79
                throw (RuntimeException) ex.getCause();
71
            }
80
            }
72
        }else{
81
        }else{
73
            Class clazz = PrivilegedAccessHelper.getClassForName(TX_MANAGER_FACTORY_CLASS);
82
            Class clazz = PrivilegedAccessHelper.getClassForName(getTxManagerFactoryClass());
74
            Method method = PrivilegedAccessHelper.getMethod(clazz, TX_MANAGER_FACTORY_METHOD, null, false);
83
            Method method = PrivilegedAccessHelper.getMethod(clazz, getTxManagerFactoryMethod(), null, false);
75
            return (TransactionManager)PrivilegedAccessHelper.invokeMethod(method, null, null);
84
            return (TransactionManager)PrivilegedAccessHelper.invokeMethod(method, null, null);
76
        }
85
        }
77
    }
86
    }
78
- 

Return to bug 407279