/** * EndConfiguration stub. */ public void endConfiguration() { try { Context ctx = new InitialContext(); try { _extendedTransaction = ctx.lookup("java:comp/websphere/ExtendedJTATransaction"); } finally { ctx.close(); } Class extendedJTATransaction = Class.forName( "com.ibm.websphere.jtaextensions.ExtendedJTATransaction"); Class synchronizationCallback = Class.forName( "com.ibm.websphere.jtaextensions.SynchronizationCallback"); _registerSync = extendedJTATransaction.getMethod( "registerSynchronizationCallbackForCurrentTran", new Class[] { synchronizationCallback }); _getGlobalId = extendedJTATransaction. getMethod("getGlobalId", null); } catch (Exception e) { throw new InvalidStateException(_loc .get("was-reflection-exception"), e).setFatal(true); } }
/** * EndConfiguration stub. */ public void endConfiguration() { try { Context ctx = new InitialContext(); try { _extendedTransaction = ctx.lookup("java:comp/websphere/ExtendedJTATransaction"); } finally { ctx.close(); } Class extendedJTATransaction = Class.forName( "com.ibm.websphere.jtaextensions.ExtendedJTATransaction"); Class synchronizationCallback = Class.forName( "com.ibm.websphere.jtaextensions.SynchronizationCallback"); _registerSync = extendedJTATransaction.getMethod( "registerSynchronizationCallbackForCurrentTran", new Class[] { synchronizationCallback }); _getGlobalId = extendedJTATransaction. getMethod("getGlobalId", null); } catch (Exception e) { throw new InvalidStateException(_loc .get("was-reflection-exception"), e).setFatal(true); } }
/** * EndConfiguration stub. */ public void endConfiguration() { try { Context ctx = new InitialContext(); try { _extendedTransaction = ctx.lookup("java:comp/websphere/ExtendedJTATransaction"); } finally { ctx.close(); } Class extendedJTATransaction = Class.forName( "com.ibm.websphere.jtaextensions.ExtendedJTATransaction"); Class synchronizationCallback = Class.forName( "com.ibm.websphere.jtaextensions.SynchronizationCallback"); _registerSync = extendedJTATransaction.getMethod( "registerSynchronizationCallbackForCurrentTran", new Class[] { synchronizationCallback }); _getGlobalId = extendedJTATransaction. getMethod("getGlobalId", null); } catch (Exception e) { throw new InvalidStateException(_loc .get("was-reflection-exception"), e).setFatal(true); } }
/** * EndConfiguration stub. */ public void endConfiguration() { try { Context ctx = new InitialContext(); try { _extendedTransaction = ctx.lookup("java:comp/websphere/ExtendedJTATransaction"); } finally { ctx.close(); } Class extendedJTATransaction = Class.forName( "com.ibm.websphere.jtaextensions.ExtendedJTATransaction"); Class synchronizationCallback = Class.forName( "com.ibm.websphere.jtaextensions.SynchronizationCallback"); _registerSync = extendedJTATransaction.getMethod( "registerSynchronizationCallbackForCurrentTran", new Class[] { synchronizationCallback }); _getGlobalId = extendedJTATransaction. getMethod("getGlobalId", null); } catch (Exception e) { throw new InvalidStateException(_loc .get("was-reflection-exception"), e).setFatal(true); } }
/** * EndConfiguration stub. */ public void endConfiguration() { try { Context ctx = new InitialContext(); try { _extendedTransaction = ctx.lookup("java:comp/websphere/ExtendedJTATransaction"); } finally { ctx.close(); } Class extendedJTATransaction = Class.forName( "com.ibm.websphere.jtaextensions.ExtendedJTATransaction"); Class synchronizationCallback = Class.forName( "com.ibm.websphere.jtaextensions.SynchronizationCallback"); _registerSync = extendedJTATransaction.getMethod( "registerSynchronizationCallbackForCurrentTran", new Class[] { synchronizationCallback }); _getGlobalId = extendedJTATransaction. getMethod("getGlobalId", null); } catch (Exception e) { throw new InvalidStateException(_loc .get("was-reflection-exception"), e).setFatal(true); } }
/** * Throw an exception if the context is closed. The exact message and * content of the exception varies whether TRACE is enabled or not. */ public void assertOpen() { if (_closed) { if (_closedException == null) // TRACE not enabled throw new InvalidStateException(_loc.get("closed-notrace")) .setFatal(true); else { OpenJPAException e = new InvalidStateException( _loc.get("closed"), _closedException).setFatal(true); e.setCause(_closedException); throw e; } } }
/** * Throw an exception if the context is closed. The exact message and * content of the exception varies whether TRACE is enabled or not. */ public void assertOpen() { if (_closed) { if (_closedException == null) // TRACE not enabled throw new InvalidStateException(_loc.get("closed-notrace")) .setFatal(true); else { OpenJPAException e = new InvalidStateException( _loc.get("closed"), _closedException).setFatal(true); e.setCause(_closedException); throw e; } } }
/** * Throw an exception if the context is closed. The exact message and * content of the exception varies whether TRACE is enabled or not. */ public void assertOpen() { if (_closed) { if (_closedException == null) // TRACE not enabled throw new InvalidStateException(_loc.get("closed-notrace")) .setFatal(true); else { OpenJPAException e = new InvalidStateException( _loc.get("closed"), _closedException).setFatal(true); e.setCause(_closedException); throw e; } } }
/** * Throw an exception if the context is closed. The exact message and * content of the exception varies whether TRACE is enabled or not. */ public void assertOpen() { if (_closed) { if (_closedException == null) // TRACE not enabled throw new InvalidStateException(_loc.get("closed-notrace")) .setFatal(true); else { OpenJPAException e = new InvalidStateException( _loc.get("closed"), _closedException).setFatal(true); e.setCause(_closedException); throw e; } } }
/** * Throw an exception if the context is closed. The exact message and * content of the exception varies whether TRACE is enabled or not. */ public void assertOpen() { if (_closed) { if (_closedException == null) // TRACE not enabled throw new InvalidStateException(_loc.get("closed-notrace")) .setFatal(true); else { OpenJPAException e = new InvalidStateException( _loc.get("closed"), _closedException).setFatal(true); e.setCause(_closedException); throw e; } } }
protected void setObject(Column col, Object val, int metaType, boolean overrideDefault) throws SQLException { // make sure we're not setting two different values Object prev = getSet(col); if (prev != null) { if (prev == NULL) prev = null; if (!rowValueEquals(prev, val)) { throw new InvalidStateException(_loc.get("diff-values", new Object[]{ col.getFullName(), (prev == null) ? null : prev.getClass(), prev, (val == null) ? null : val.getClass(), val })). setFatal(true); } } super.setObject(col, val, metaType, overrideDefault); }
/** * Tell the metadata factory to load object id classes even if they don't * exist. */ private static void loadObjectIds(MetaDataRepository repos, boolean fatal) { MetaDataFactory mdf = repos.getMetaDataFactory(); if (mdf instanceof DelegatingMetaDataFactory) mdf = ((DelegatingMetaDataFactory) mdf).getInnermostDelegate(); if (mdf instanceof ObjectIdLoader) ((ObjectIdLoader) mdf).setLoadObjectIds(); else if (fatal) throw new InvalidStateException(_loc.get("factory-not-oidloader")). setFatal(true); }
/** * Tell the metadata factory to load object id classes even if they don't * exist. */ private static void loadObjectIds(MetaDataRepository repos, boolean fatal) { MetaDataFactory mdf = repos.getMetaDataFactory(); if (mdf instanceof DelegatingMetaDataFactory) mdf = ((DelegatingMetaDataFactory) mdf).getInnermostDelegate(); if (mdf instanceof ObjectIdLoader) ((ObjectIdLoader) mdf).setLoadObjectIds(); else if (fatal) throw new InvalidStateException(_loc.get("factory-not-oidloader")). setFatal(true); }
/** * Tell the metadata factory to load object id classes even if they don't * exist. */ private static void loadObjectIds(MetaDataRepository repos, boolean fatal) { MetaDataFactory mdf = repos.getMetaDataFactory(); if (mdf instanceof DelegatingMetaDataFactory) mdf = ((DelegatingMetaDataFactory) mdf).getInnermostDelegate(); if (mdf instanceof ObjectIdLoader) ((ObjectIdLoader) mdf).setLoadObjectIds(); else if (fatal) throw new InvalidStateException(_loc.get("factory-not-oidloader")). setFatal(true); }
/** * Tell the metadata factory to load object id classes even if they don't * exist. */ private static void loadObjectIds(MetaDataRepository repos, boolean fatal) { MetaDataFactory mdf = repos.getMetaDataFactory(); if (mdf instanceof DelegatingMetaDataFactory) mdf = ((DelegatingMetaDataFactory) mdf).getInnermostDelegate(); if (mdf instanceof ObjectIdLoader) ((ObjectIdLoader) mdf).setLoadObjectIds(); else if (fatal) throw new InvalidStateException(_loc.get("factory-not-oidloader")). setFatal(true); }
public void run() { if (_log.isTraceEnabled()) _log.trace(_loc.get("scheduler-interval", _interval + "")); Date lastRun = new Date(); DateFormat fom = new SimpleDateFormat("E HH:mm:ss"); while (!isStopped()) { try { Thread.sleep(_interval * 60 * 1000); Date now = new Date(); for(Entry<Clearable, Schedule> entry : _clearables.entrySet()){ Clearable clearable = entry.getKey(); Schedule schedule = entry.getValue(); if (schedule.matches(lastRun, now)) { if (_log.isTraceEnabled()) _log.trace(_loc.get("scheduler-clear", clearable, fom.format(now))); evict(clearable); } } lastRun = now; } catch (Exception e) { throw new InvalidStateException(_loc.get("scheduler-fail"), e). setFatal(true); } } _log.info(_loc.get("scheduler-stop")); synchronized (this) { if (isStopped()) _thread = null; // be sure to deref the thread so it can restart } }
public void run() { if (_log.isTraceEnabled()) _log.trace(_loc.get("scheduler-interval", _interval + "")); Date lastRun = new Date(); DateFormat fom = new SimpleDateFormat("E HH:mm:ss"); while (!isStopped()) { try { Thread.sleep(_interval * 60 * 1000); Date now = new Date(); for(Entry<Clearable, Schedule> entry : _clearables.entrySet()){ Clearable clearable = entry.getKey(); Schedule schedule = entry.getValue(); if (schedule.matches(lastRun, now)) { if (_log.isTraceEnabled()) _log.trace(_loc.get("scheduler-clear", clearable, fom.format(now))); evict(clearable); } } lastRun = now; } catch (Exception e) { throw new InvalidStateException(_loc.get("scheduler-fail"), e). setFatal(true); } } _log.info(_loc.get("scheduler-stop")); synchronized (this) { if (isStopped()) _thread = null; // be sure to deref the thread so it can restart } }
/** * Tell the metadata factory to load object id classes even if they don't * exist. */ private static void loadObjectIds(MetaDataRepository repos, boolean fatal) { MetaDataFactory mdf = repos.getMetaDataFactory(); if (mdf instanceof DelegatingMetaDataFactory) mdf = ((DelegatingMetaDataFactory) mdf).getInnermostDelegate(); if (mdf instanceof ObjectIdLoader) ((ObjectIdLoader) mdf).setLoadObjectIds(); else if (fatal) throw new InvalidStateException(_loc.get("factory-not-oidloader")). setFatal(true); }
protected void setObject(Column col, Object val, int metaType, boolean overrideDefault) throws SQLException { // make sure we're not setting two different values // unless the given column is an implicit relationship and value // changes from logical default to non-default Object prev = getSet(col); if (prev != null) { if (prev == NULL) prev = null; if (!rowValueEquals(prev, val)) { if (isDefaultValue(prev) || allowsUpdate(col, prev, val)) { super.setObject(col, val, metaType, overrideDefault); return; } else if (!isDefaultValue(val)) { throw new InvalidStateException(_loc.get("diff-values", new Object[]{ col.getFullDBIdentifier().getName(), (prev == null) ? null : prev.getClass(), prev, (val == null) ? null : val.getClass(), val })). setFatal(true); } else { // since not allow to update and the new value is 0 or null, // just return. return; } } } super.setObject(col, val, metaType, overrideDefault); }
protected void setObject(Column col, Object val, int metaType, boolean overrideDefault) throws SQLException { // make sure we're not setting two different values // unless the given column is an implicit relationship and value // changes from logical default to non-default Object prev = getSet(col); if (prev != null) { if (prev == NULL) prev = null; if (!rowValueEquals(prev, val)) { if (isDefaultValue(prev) || allowsUpdate(col, prev, val)) { super.setObject(col, val, metaType, overrideDefault); return; } else if (!isDefaultValue(val)) { throw new InvalidStateException(_loc.get("diff-values", new Object[]{ col.getFullDBIdentifier().getName(), (prev == null) ? null : prev.getClass(), prev, (val == null) ? null : val.getClass(), val })). setFatal(true); } else { // since not allow to update and the new value is 0 or null, // just return. return; } } } super.setObject(col, val, metaType, overrideDefault); }