public synchronized void activate() throws LifecycleException { if (!active) { CheckUtil.checkState(packageLoader, "packageLoader"); //$NON-NLS-1$ active = true; } }
protected final void checkNull(Object handle, String msg) throws NullPointerException { CheckUtil.checkNull(handle, msg); }
public ID(int value) { CheckUtil.checkArg(value != INFO_FOLLOWS, "value"); this.value = value; }
public CDOLockStateImpl(Object lockedObject) { CheckUtil.checkArg(lockedObject, "lockedObject"); CheckUtil.checkState(lockedObject instanceof CDOID || lockedObject instanceof CDOIDAndBranch, "lockedObject is of wrong type"); this.lockedObject = lockedObject; }
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 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()); }
@Override protected InternalCDOLockState createUpdatedLockStateForNewObject(CDOObject object, LockType lockType, boolean on) CheckUtil.checkState(FSMUtil.isNew(object), "Object is not in NEW state"); CheckUtil.checkArg(lockType, "lockType"); CheckUtil.checkArg(on == true, "on != true"); Object lockTarget = getLockTarget(object); lockState = (InternalCDOLockState)CDOLockUtil.createLockState(lockTarget);
protected final void checkArg(Object handle, String handleName) throws IllegalArgumentException { CheckUtil.checkState(handle, handleName); }
@Override protected InternalCDOLockState createUpdatedLockStateForNewObject(CDOObject object, LockType lockType, boolean on) CheckUtil.checkState(FSMUtil.isNew(object), "Object is not in NEW state"); CheckUtil.checkArg(lockType, "lockType"); CheckUtil.checkArg(on == true, "on != true"); Object lockTarget = getLockTarget(object); lockState = (InternalCDOLockState)CDOLockUtil.createLockState(lockTarget);
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); }
protected final void checkState(Object handle, String handleName) throws IllegalStateException { CheckUtil.checkState(handle, handleName); }
public StaleRevisionLockException(CDORevisionKey[] staleRevisions) { CheckUtil.checkArg(staleRevisions, "staleRevisions"); this.staleRevisions = staleRevisions; }
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); }
protected final void checkState(boolean expr, String msg) throws IllegalStateException { CheckUtil.checkState(expr, msg); }
public AbstractCDOIDByteArray(byte[] value) { CheckUtil.checkArg(value != null && value.length == 16, "Illegal UUID value"); this.value = value; }
@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) {
/** * @ADDED */ @Override protected void validateDefinition() { CheckUtil.checkState(eIsSet(CDODefsPackage.EDYNAMIC_PACKAGE_DEF__RESOURCE_URI), "resource uri not set!"); }
/** * @since 4.2 */ public DefaultCDOMerger(ResolutionPreference resolutionPreference) { CheckUtil.checkArg(resolutionPreference, "resolutionPreference"); this.resolutionPreference = resolutionPreference; }
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); }