protected final void checkNull(Object handle, String msg) throws NullPointerException { CheckUtil.checkNull(handle, msg); }
private void checkFormerContainerIncluded(CDOObject detachedObject) throws CommitIntegrityException { InternalCDORevision rev = transaction.getCleanRevisions().get(detachedObject); CheckUtil.checkNull(rev, "Could not obtain clean revision for detached object " + detachedObject); CDOID id = getContainerOrResourceID(rev); checkIncluded(id, "former container (or resource) of detached", detachedObject); }
private void checkFormerContainerIncluded(CDOObject detachedObject) throws CommitIntegrityException { InternalCDORevision rev = transaction.getCleanRevisions().get(detachedObject); CheckUtil.checkNull(rev, "Could not obtain clean revision for detached object " + detachedObject); CDOID id = getContainerOrResourceID(rev); checkIncluded(id, "former container (or resource) of detached", detachedObject); }
@Override public <T> T body(Class<T> type, final ClassLoader classLoader) { CheckUtil.checkNull(body, "Body should not be null."); if (body instanceof ExtendedDataInputStream) { synchronized (this) {
public static InternalView openViewWithLockArea(InternalSession session, InternalLockManager lockManager, CDOBranch viewedBranch, String lockAreaID) { LockArea lockArea; InternalView view; try { lockArea = lockManager.getLockArea(lockAreaID); // If we get here, the lockArea already exists. view = (InternalView)lockManager.openView(session, InternalSession.TEMP_VIEW_ID, true, lockAreaID); } catch (LockAreaNotFoundException e) { // If we get here, the lockArea does not yet exist, so we open // a view without a lockArea first, then create a lockArea with the given ID, // and associate it with the view. view = session.openView(InternalSession.TEMP_VIEW_ID, viewedBranch.getHead()); lockArea = lockManager.createLockArea(view, lockAreaID); view.setDurableLockingID(lockAreaID); } CheckUtil.checkNull(lockAreaID, "lockAreaID"); CheckUtil.checkNull(lockArea, "lockArea"); CheckUtil.checkState(lockAreaID.equals(lockArea.getDurableLockingID()), "lockAreaID has incorrect value"); return view; } }
public static CDOLockOwner createLockOwner(CDOCommonView view) { CDOCommonSession session = view.getSession(); String durableLockingID = view.getDurableLockingID(); if (session != null) { int sessionID = session.getSessionID(); int viewID = view.getViewID(); return new CDOLockOwnerImpl(sessionID, viewID, durableLockingID, false); } CheckUtil.checkNull(durableLockingID, "durableLockingID"); return new CDOLockOwnerImpl(DURABLE_SESSION_ID, DURABLE_VIEW_ID, durableLockingID, true); }
public void updateLockArea(LockArea lockArea) { String durableLockingID = lockArea.getDurableLockingID(); DurableLocking2 accessor = getDurableLocking2(); if (lockArea.isMissing()) { LockArea localLockArea = getLockAreaNoEx(durableLockingID); if (localLockArea != null && localLockArea.getLocks().size() > 0) { accessor.deleteLockArea(durableLockingID); DurableView deletedView = durableViews.remove(durableLockingID); CheckUtil.checkNull(deletedView, "deletedView"); } } else { accessor.updateLockArea(lockArea); new DurableLockLoader().handleLockArea(lockArea); } } }
private void applyLocksOnNewObjects() throws InterruptedException { final CDOLockOwner owner = CDOLockUtil.createLockOwner(transaction); for (CDOLockState lockState : locksOnNewObjects) { Object target = lockState.getLockedObject(); if (transaction.getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE) { CDOIDAndBranch idAndBranch = target instanceof CDOIDAndBranch ? (CDOIDAndBranch)target : null; CDOID id = idAndBranch != null ? ((CDOIDAndBranch)target).getID() : (CDOID)target; CDOID newID = idMappings.get(id); CheckUtil.checkNull(newID, "newID"); target = idAndBranch != null ? CDOIDUtil.createIDAndBranch(newID, idAndBranch.getBranch()) : newID; } for (LockType type : LockType.values()) { if (lockState.isLocked(type, owner, false)) { lockManager.lock2(type, transaction, Collections.singleton(target), 0); } } } }
public static void writeMessage(ExtendedDataOutputStream out, IMessage message) throws IOException { CheckUtil.checkNull(message, "Message should not be null"); CheckUtil.checkArg(message.body() instanceof Serializable, String.format("Message body type should be subtype of Serializable on address: %s, but was %s", message.address(), message.body())); out.writeString(message.address()); final String replyAddress = message.replyAddress() == null ? "" : message.replyAddress(); out.writeString(replyAddress); out.writeBoolean(message.isSend()); out.writeBoolean(message.isSucceeded()); final ByteArrayOutputStream stream = new ByteArrayOutputStream(); ExtendedDataOutputStream wrap = ExtendedDataOutputStream.wrap(stream); ExtendedIOUtil.writeObject(wrap, message.body()); ExtendedIOUtil.writeByteArray(out, stream.toByteArray()); }
CheckUtil.checkNull(cleanRev, "Could not obtain clean revision for dirty object " + dirtyObject);
CheckUtil.checkNull(cleanRev, "Could not obtain clean revision for dirty object " + dirtyObject);