code: @Override
      public final boolean lockItemIfAvailable(long lockID) throws SevereMessageStoreException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(this, tc, "lockItemIfAvailable", Long.valueOf(lockID));
  
          boolean locked = false;
          if (AbstractItem.NO_LOCK_ID == lockID)
          {
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  SibTr.exit(this, tc, "lockItemIfAvailable");
              throw new SevereMessageStoreException("invalid lockID - clashes with internal constant NO_LOCK_ID");
          }
          boolean hasBecomeNonReleasable = false;
          synchronized (this)
          {
              if (!isExpired() && isAvailable())
              {
                  if (ItemLinkState.STATE_AVAILABLE == _itemLinkState)
                  {
                      ListStatistics stats = getParentStatistics();
                      synchronized (stats)
                      {
                          stats.incrementLocked();
                          stats.decrementAvailable();
                      }
                  }
                  else
                  {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                          SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState);
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                          SibTr.exit(this, tc, "lockItemIfAvailable");
                      throw new StateException(_itemLinkState.toString());
                  }
                  locked = true;
                  _lockID = lockID;
                  hasBecomeNonReleasable = _declareNotDiscardable(_getItemNoRestore());
                  _itemLinkState = ItemLinkState.STATE_LOCKED;
              }
          }
          if (hasBecomeNonReleasable)
          {
              _declareNotReleasable();
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(this, tc, "lockItemIfAvailable", Boolean.valueOf(locked));
          return locked;
      }
docs: /*
  (non-Javadoc)
  
  @see com.ibm.ws.sib.msgstore.Membership#lockIfAvailable(long)