/** * Return the log filename. This returns the fully qualified path of the log file when * EclipseLink DefaultSessionLog instance is used. Null is returned otherwise. * * @return String logFilename */ public String getLogFilename() { // returns String or null. if ( session.getSessionLog() instanceof DefaultSessionLog) { return ((DefaultSessionLog)session.getSessionLog()).getWriterFilename(); } else { return null; } }
/** * Return the log filename. This returns the fully qualified path of the log file when * EclipseLink DefaultSessionLog instance is used. Null is returned otherwise. * * @return String logFilename */ public String getLogFilename() { // returns String or null. if ( session.getSessionLog() instanceof DefaultSessionLog) { return ((DefaultSessionLog)session.getSessionLog()).getWriterFilename(); } else { return null; } }
protected void logServere(final Session session, final String message, final Object... args) { session.getSessionLog().log(SessionLog.SEVERE, message, args, false); }
protected void logInfo(final Session session, final String message, final Object... args) { session.getSessionLog().log(SessionLog.INFO, message, args, false); }
protected void logWarning(final Session session, final String message, final Object... args) { session.getSessionLog().log(SessionLog.WARNING, message, args, false); }
protected void logFinest(final Session session, final String message, final Object... args) { session.getSessionLog().log(SessionLog.FINEST, message, args, false); }
protected void logFiner(final Session session, final String message, final Object... args) { session.getSessionLog().log(SessionLog.FINER, message, args, false); }
public static void logFine(final Session session, final String message, final Object... args) { session.getSessionLog().log(SessionLog.FINE, message, args, false); }
protected void logAll(final Session session, final String message, final Object... args) { session.getSessionLog().log(SessionLog.ALL, message, args, false); }
/** * Return the log filename. This returns the fully qualified path of the log file when * EclipseLink logging is enabled. Null is returned otherwise. * * @return String logFilename */ public String getLogFilename() { // returns String or null. if (this.getLogType().equals(EclipseLink_Product_Name) && session.getSessionLog() instanceof DefaultSessionLog) { // We are running on an application server here return ((DefaultSessionLog)session.getSessionLog()).getWriterFilename(); } else { return null; } }
/** * INTERNAL: * Define the deployment time data associated with logging and profiling * */ protected void updateDeploymentTimeData() { this.deployedSessionLog = (SessionLog)((AbstractSessionLog)session.getSessionLog()).clone(); if (session.getProfiler() == null) { this.deployedSessionProfileWeight = -1;//there is no profiler } else { this.deployedSessionProfileWeight = session.getProfiler().getProfileWeight(); } }
/** * INTERNAL: * Clears customization from connection. * Called only if connection is customized (isActive()==true). * If the method fails due to SQLException it should "eat" it * (just like DatasourceAccessor.closeConnection method). * isActive method called after this method should always return false. */ public void clear() { try { clearConnectionCache(); if (this.session.shouldLog(SessionLog.FINEST, SessionLog.CONNECTION)) { Properties logProperties = proxyProperties; if(proxyProperties.containsKey(OracleConnection.PROXY_USER_PASSWORD)) { logProperties = (Properties)proxyProperties.clone(); logProperties.setProperty(OracleConnection.PROXY_USER_PASSWORD, "******"); } Object[] args = new Object[]{ oracleConnection, logProperties }; ((AbstractSession)this.session).log(SessionLog.FINEST, SessionLog.CONNECTION, "proxy_connection_customizer_closing_proxy_session", args); } oracleConnection.close(OracleConnection.PROXY_SESSION); } catch (SQLException exception) { // Ignore this.session.getSessionLog().logThrowable(SessionLog.WARNING, SessionLog.CONNECTION, exception); } finally { oracleConnection = null; } }
/** * INTERNAL: * Clears customization from connection. * Called only if connection is customized (isActive()==true). * If the method fails due to SQLException it should "eat" it * (just like DatasourceAccessor.closeConnection method). * isActive method called after this method should always return false. */ public void clear() { try { clearConnectionCache(); if (this.session.shouldLog(SessionLog.FINEST, SessionLog.CONNECTION)) { Properties logProperties = proxyProperties; if(proxyProperties.containsKey(OracleConnection.PROXY_USER_PASSWORD)) { logProperties = (Properties)proxyProperties.clone(); logProperties.setProperty(OracleConnection.PROXY_USER_PASSWORD, "******"); } Object[] args = new Object[]{ oracleConnection, logProperties }; ((AbstractSession)this.session).log(SessionLog.FINEST, SessionLog.CONNECTION, "proxy_connection_customizer_closing_proxy_session", args); } oracleConnection.close(OracleConnection.PROXY_SESSION); } catch (SQLException exception) { // Ignore this.session.getSessionLog().logThrowable(SessionLog.WARNING, SessionLog.CONNECTION, exception); } finally { oracleConnection = null; } }
/** * INTERNAL: * Define the deployment time data associated with logging and profiling * */ protected void updateDeploymentTimeData() { this.deployedSessionLog = (SessionLog)((AbstractSessionLog)session.getSessionLog()).clone(); if (session.getProfiler() == null) { this.deployedSessionProfileWeight = -1;//there is no profiler } else { this.deployedSessionProfileWeight = session.getProfiler().getProfileWeight(); } }
/** * INTERNAL: * Define the deployment time data associated with logging and profiling * */ protected void updateDeploymentTimeData() { this.deployedSessionLog = (SessionLog)((AbstractSessionLog)session.getSessionLog()).clone(); if (session.getProfiler() == null) { this.deployedSessionProfileWeight = -1;//there is no profiler } else { this.deployedSessionProfileWeight = session.getProfiler().getProfileWeight(); } }
session.getSessionLog().log( SessionLog.FINE, SessionLog.DBWS, "dbws_oxm_metadata_read_error", jaxbex.getLocalizedMessage()); return null;
/** * Register with WLS through reflection. */ public static synchronized void register(Session session) { if (isRegistered) { return; } try { Class dataSourceManager = PrivilegedAccessHelper.getClassForName("weblogic.jdbc.common.internal.DataSourceManager"); Method getInstance = PrivilegedAccessHelper.getMethod(dataSourceManager, "getInstance", null, false); Object instance = PrivilegedAccessHelper.invokeMethod(getInstance, null, null); Method getDataSourceService = PrivilegedAccessHelper.getMethod(instance.getClass(), "getDataSourceService", null, false); Object service = PrivilegedAccessHelper.invokeMethod(getDataSourceService, instance, null); Class[] argumentTypes = new Class[] {DataBasedConnectionAffinityCallback.class}; Method registerDataAffinityCallback = PrivilegedAccessHelper.getMethod(service.getClass(), "registerDataAffinityCallback", argumentTypes, false); Object[] arguments = new Object[] {new GridLinkDataPartitioningCallback()}; PrivilegedAccessHelper.invokeMethod(registerDataAffinityCallback, service, arguments); isRegistered = true; } catch (Exception exception) { session.getSessionLog().logThrowable(SessionLog.WARNING, SessionLog.CONNECTION, exception); } }
/** * Register with WLS through reflection. */ public static synchronized void register(Session session) { if (isRegistered) { return; } try { Class dataSourceManager = PrivilegedAccessHelper.getClassForName("weblogic.jdbc.common.internal.DataSourceManager"); Method getInstance = PrivilegedAccessHelper.getMethod(dataSourceManager, "getInstance", null, false); Object instance = PrivilegedAccessHelper.invokeMethod(getInstance, null, null); Method getDataSourceService = PrivilegedAccessHelper.getMethod(instance.getClass(), "getDataSourceService", null, false); Object service = PrivilegedAccessHelper.invokeMethod(getDataSourceService, instance, null); Class[] argumentTypes = new Class[] {DataBasedConnectionAffinityCallback.class}; Method registerDataAffinityCallback = PrivilegedAccessHelper.getMethod(service.getClass(), "registerDataAffinityCallback", argumentTypes, false); Object[] arguments = new Object[] {new GridLinkDataPartitioningCallback()}; PrivilegedAccessHelper.invokeMethod(registerDataAffinityCallback, service, arguments); isRegistered = true; } catch (Exception exception) { session.getSessionLog().logThrowable(SessionLog.WARNING, SessionLog.CONNECTION, exception); } }
} catch (SQLException exception) { this.session.getSessionLog().logThrowable(SessionLog.WARNING, SessionLog.CONNECTION, exception);
} catch (SQLException exception) { this.session.getSessionLog().logThrowable(SessionLog.WARNING, SessionLog.CONNECTION, exception);