| 1 |
// |
| 2 |
// ======================================================================== |
| 3 |
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others. |
| 4 |
// |
| 5 |
// This program and the accompanying materials are made available under the |
| 6 |
// terms of the Eclipse Public License v. 2.0 which is available at |
| 7 |
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 |
| 8 |
// which is available at https://www.apache.org/licenses/LICENSE-2.0. |
| 9 |
// |
| 10 |
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 |
| 11 |
// ======================================================================== |
| 12 |
// |
| 13 |
|
| 14 |
package org.example; |
| 15 |
|
| 16 |
import java.util.Hashtable; |
| 17 |
import javax.naming.Context; |
| 18 |
import javax.naming.Name; |
| 19 |
import javax.naming.spi.ObjectFactory; |
| 20 |
|
| 21 |
public class MockUserTransactionFactory implements ObjectFactory |
| 22 |
{ |
| 23 |
/** |
| 24 |
* @param obj The possibly null object containing location or reference |
| 25 |
* information that can be used in creating an object. |
| 26 |
* @param name The name of this object relative to {@code nameCtx}, |
| 27 |
* or null if no name is specified. |
| 28 |
* @param nameCtx The context relative to which the {@code name} |
| 29 |
* parameter is specified, or null if {@code name} is |
| 30 |
* relative to the default initial context. |
| 31 |
* @param environment The possibly null environment that is used in |
| 32 |
* creating the object. |
| 33 |
* @return |
| 34 |
* @throws Exception |
| 35 |
*/ |
| 36 |
@Override |
| 37 |
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception |
| 38 |
{ |
| 39 |
return new MockUserTransaction(); |
| 40 |
} |
| 41 |
} |