01: package com.sun.portal.rproxy.server;
02:
03: public class GatewayContextFactory {
04: public static final int DSAME_INSTANCE = 1;
05:
06: public static final int DEFAULT_INSTANCE = 2;
07:
08: private static GatewayContext context;
09:
10: public static void init(int instanceToBeUsed) {
11: if (instanceToBeUsed == DSAME_INSTANCE) {
12: context = new DSAMEGatewayContext();
13: } else if (instanceToBeUsed == DEFAULT_INSTANCE) {
14: context = new DefaultGatewayContext();
15: }
16: }
17:
18: public static GatewayContext getGatewayContext() {
19: if (context == null) {
20: new RuntimeException(
21: "Gateway Context is not properly initialized");
22: }
23: return context;
24: }
25:
26: }
|