001: /*
002: * $Id: GW.java,v 1.9 2005/11/30 11:27:03 ss150821 Exp $
003: * $Source: /m/portal/ps/srap/src/com/sun/portal/netlet/eproxy/GW.java,v $
004: * $Log: GW.java,v $
005: * Revision 1.9 2005/11/30 11:27:03 ss150821
006: * 6356996 - Srap Code base needs to save files in the unix file format and not windows
007: *
008: * Revision 1.8 2005/02/25 09:49:19 ss150821
009: * RFE 6223490 - SRA Should use JDK based logging, changed to start throwing the full stacktrace for the exception in the logs
010: *
011: * Revision 1.7 2005/02/23 05:44:08 ss150821
012: * RFE 6223490 - SRA Should use JDK based logging
013: *
014: * Revision 1.6 2004/05/25 17:17:21 rc135440
015: * CRT22: ps63_linux_branch sync to trunk
016: *
017: * Revision 1.5.46.2 2004/04/27 18:50:33 rc135440
018: * #5037634: setting SRAP_CONFIG_DIR env var. using it instead of conf.dir
019: *
020: * Revision 1.5.46.1 2004/04/27 12:02:27 bs126381
021: * PS6.4 CRT#10
022: *
023: * Revision 1.5 2003/05/29 14:14:00 as133206
024: * Class field was hidden by local field!
025: *
026: * Revision 1.4 2003/03/27 11:39:51 bs126381
027: * Netlet on SSL, SunRay
028: *
029: * Revision 1.3 2003/03/07 10:39:58 bv131302
030: * win2k changes
031: *
032: * Revision 1.2 2003/01/23 10:10:08 bv131302
033: * id60 changes merged
034: *
035: * Revision 1.1.20.1 2003/01/02 08:36:24 bv131302
036: * mas changes from the tip brougt over to ease folding
037: *
038: * Revision 1.1 2002/06/14 09:31:00 rt130506
039: * SRAP rebranding
040: *
041: * Revision 1.4 2002/06/11 16:02:07 bv131302
042: * new branded
043: *
044: * Revision 1.3 2002/03/04 09:21:43 mm132998
045: * Bug ID : 4646277 CRT: 442 Desc : Lihue PRD 4.5
046: *
047: *
048: */
049: // Copyright 10/18/00 Sun Microsystems, Inc. All Rights Reserved.
050: package com.sun.portal.netlet.eproxy;
051:
052: public class GW {
053:
054: private static GW instance = null;
055:
056: private static boolean isWin;
057:
058: static {
059: isWin = (System.getProperty("os.name").toLowerCase().indexOf(
060: "windows") != -1);
061: if (!isWin)
062: System.loadLibrary("MakeMe");
063: instance = new GW();
064: }
065:
066: public native void MakeMe(String confDir, String confSuffix);
067:
068: public native void MeMake();
069:
070: // Lihue PRD - 4.5
071: private static int numberOfInstances = 0;
072:
073: private static int currentNumber = 0;
074:
075: private GW() {
076: }
077:
078: private void runActualGW() {
079: String confDir = System.getProperty("SRAP_CONFIG_DIR", "");
080: String confSuffix = System.getProperty("conf.suffix", "");
081:
082: if (!isWin)
083: MakeMe(confDir, confSuffix);
084: }
085:
086: // public void run_GW() {
087: public static synchronized void run_GW() {
088: // String confSuffix = System.getProperty("conf.suffix", "");
089: // MakeMe(confSuffix);
090: currentNumber++;
091: if (currentNumber >= numberOfInstances) {
092: instance.runActualGW();
093: }
094: }
095:
096: private void actualUnrunGW() {
097: if (!isWin)
098: MeMake();
099: }
100:
101: // public void unrun_GW() {
102: public static synchronized void unrun_GW() {
103: instance.actualUnrunGW();
104: }
105:
106: public static void setNumberOfInstances(int number) {
107: numberOfInstances = number;
108: }
109:
110: // EOC :: Lihue PRD - 4.5
111:
112: private static final String sccsID = "@(#)GW.java 1.1 00/10/18 Sun Microsystems, Inc.";
113: }
|