01: package org.obe.client.api.rmi;
02:
03: import javax.naming.Context;
04: import javax.naming.NamingException;
05: import org.obe.client.api.base.AbstractJAASClient;
06: import org.wfmc.wapi.WMConnectException;
07: import org.wfmc.wapi.WMConnectInfo;
08:
09: /**
10: * Abstract base class for J2EE client implementations.
11: *
12: * @author Adrian Price
13: */
14: public abstract class AbstractJ2EEClient extends AbstractJAASClient {
15: protected AbstractJ2EEClient() {
16: }
17:
18: protected final Context _connect(WMConnectInfo connectInfo)
19: throws WMConnectException {
20:
21: super .connect(connectInfo);
22: try {
23: return connectInfo != null ? JNDIHelper.getInitialContext(
24: connectInfo.getEngineName(), connectInfo
25: .getUserIdentification(), connectInfo
26: .getPassword()) : JNDIHelper
27: .getInitialContext();
28: } catch (NamingException e) {
29: throw new WMConnectException(e);
30: }
31: }
32:
33: protected void pushCallerPrincipal() {
34: // This is a no-op, because J2EEServerBean pushes J2EE caller principal.
35: }
36:
37: protected void popCallerPrincipal() {
38: // This is a no-op, because J2EEServerBean pushes J2EE caller principal.
39: }
40: }
|