* wan profile enhancement
This commit is contained in:
parent
026f99e87a
commit
ce53ae3338
|
@ -150,13 +150,16 @@ public class CConnection implements Serializable
|
||||||
}
|
}
|
||||||
} // CConnection
|
} // CConnection
|
||||||
|
|
||||||
|
/** Default jboss port **/
|
||||||
|
private final static int DEFAULT_APP_SERVER_PORT = 1099;
|
||||||
|
|
||||||
/** Name of Connection */
|
/** Name of Connection */
|
||||||
private String m_name = "Standard";
|
private String m_name = "Standard";
|
||||||
|
|
||||||
/** Application Host */
|
/** Application Host */
|
||||||
private String m_apps_host = "MyAppsServer";
|
private String m_apps_host = "MyAppsServer";
|
||||||
/** Application Port */
|
/** Application Port */
|
||||||
private int m_apps_port = 1099;
|
private int m_apps_port = DEFAULT_APP_SERVER_PORT;
|
||||||
|
|
||||||
/** Database Type */
|
/** Database Type */
|
||||||
private String m_type = "";
|
private String m_type = "";
|
||||||
|
@ -548,10 +551,17 @@ public class CConnection implements Serializable
|
||||||
{
|
{
|
||||||
log.config(m_connectionProfile + " -> " + connectionProfile);
|
log.config(m_connectionProfile + " -> " + connectionProfile);
|
||||||
m_connectionProfile = connectionProfile;
|
m_connectionProfile = connectionProfile;
|
||||||
|
if (PROFILE_WAN.equals(m_connectionProfile))
|
||||||
|
setAppsPort(80);
|
||||||
|
else
|
||||||
|
setAppsPort(DEFAULT_APP_SERVER_PORT);
|
||||||
Ini.setProperty(Ini.P_CONNECTION, toStringLong());
|
Ini.setProperty(Ini.P_CONNECTION, toStringLong());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_connectionProfile = connectionProfile;
|
m_connectionProfile = connectionProfile;
|
||||||
|
|
||||||
|
//reset initial context to null
|
||||||
|
m_iContext = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log.warning("Invalid: " + connectionProfile);
|
log.warning("Invalid: " + connectionProfile);
|
||||||
|
@ -1542,7 +1552,7 @@ public class CConnection implements Serializable
|
||||||
}
|
}
|
||||||
catch (CommunicationException ce) // not a "real" error
|
catch (CommunicationException ce) // not a "real" error
|
||||||
{
|
{
|
||||||
// m_appsException = ce;
|
m_appsException = ce;
|
||||||
String connect = (String)m_env.get(Context.PROVIDER_URL);
|
String connect = (String)m_env.get(Context.PROVIDER_URL);
|
||||||
log.warning (connect
|
log.warning (connect
|
||||||
+ "\n - " + ce.toString ()
|
+ "\n - " + ce.toString ()
|
||||||
|
|
|
@ -20,6 +20,8 @@ import java.sql.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
|
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
import org.compiere.model.*;
|
import org.compiere.model.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -188,7 +190,7 @@ public class CLogErrorBuffer extends Handler
|
||||||
String loggerName = record.getLoggerName(); // class name
|
String loggerName = record.getLoggerName(); // class name
|
||||||
String className = record.getSourceClassName(); // physical class
|
String className = record.getSourceClassName(); // physical class
|
||||||
String methodName = record.getSourceMethodName(); //
|
String methodName = record.getSourceMethodName(); //
|
||||||
if (DB.isConnected()
|
if (DB.isConnected(false)
|
||||||
&& !methodName.equals("saveError")
|
&& !methodName.equals("saveError")
|
||||||
&& !methodName.equals("get_Value")
|
&& !methodName.equals("get_Value")
|
||||||
&& !methodName.equals("dataSave")
|
&& !methodName.equals("dataSave")
|
||||||
|
@ -200,6 +202,25 @@ public class CLogErrorBuffer extends Handler
|
||||||
MIssue.create(record);
|
MIssue.create(record);
|
||||||
m_issueError = true;
|
m_issueError = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//display to user if database connection not available
|
||||||
|
if (!methodName.equals("saveError")
|
||||||
|
&& !methodName.equals("get_Value")
|
||||||
|
&& !methodName.equals("dataSave")
|
||||||
|
&& loggerName.indexOf("Issue") == -1
|
||||||
|
&& loggerName.indexOf("CConnection") == -1)
|
||||||
|
{
|
||||||
|
if(Ini.isClient())
|
||||||
|
{
|
||||||
|
JOptionPane.showMessageDialog(null, getFormatter().format(record), "Error", JOptionPane.ERROR_MESSAGE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
System.err.println(getFormatter().format(record));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // publish
|
} // publish
|
||||||
|
|
Loading…
Reference in New Issue