Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 39DE5200B7C for ; Thu, 8 Sep 2016 16:45:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 38E38160AAD; Thu, 8 Sep 2016 14:45:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4537C160AF2 for ; Thu, 8 Sep 2016 16:45:46 +0200 (CEST) Received: (qmail 60286 invoked by uid 500); 8 Sep 2016 14:45:45 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 59674 invoked by uid 99); 8 Sep 2016 14:45:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2016 14:45:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E68E4E2F11; Thu, 8 Sep 2016 14:45:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Thu, 08 Sep 2016 14:46:23 -0000 Message-Id: <5f00369d69c54c8e98754fcf753b686f@git.apache.org> In-Reply-To: <801a9be6e4164ce8853784b2e99566e2@git.apache.org> References: <801a9be6e4164ce8853784b2e99566e2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [41/50] ignite git commit: Return LockEntryResult from LockEntryProcessor archived-at: Thu, 08 Sep 2016 14:45:50 -0000 Return LockEntryResult from LockEntryProcessor Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ddae6acd Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ddae6acd Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ddae6acd Branch: refs/heads/ignite-3199-1 Commit: ddae6acdecced9717fad6c84479d87f9b65b61c7 Parents: 348e5d4 Author: Pavel Tupitsyn Authored: Thu Sep 8 13:54:52 2016 +0300 Committer: Pavel Tupitsyn Committed: Thu Sep 8 13:54:52 2016 +0300 ---------------------------------------------------------------------- .../platform/websession/LockEntryProcessor.java | 6 +- .../websession/SessionStateLockEntryResult.java | 100 ------------------- .../websession/SessionStateLockResult.java | 100 +++++++++++++++++++ .../IgniteSessionStateStoreProvider.cs | 14 +-- .../Apache.Ignite.Core.csproj | 2 +- .../Impl/AspNet/SessionStateLockEntryResult.cs | 76 -------------- .../Impl/AspNet/SessionStateLockResult.cs | 84 ++++++++++++++++ 7 files changed, 195 insertions(+), 187 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/ddae6acd/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockEntryProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockEntryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockEntryProcessor.java index ea53271..751ed48 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockEntryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockEntryProcessor.java @@ -37,14 +37,14 @@ public class LockEntryProcessor implements CacheEntryProcessor @@ -432,9 +432,9 @@ namespace Apache.Ignite.AspNet /// /// Locks the item. /// - private object LockItem(string key, long lockId) + private SessionStateLockResult LockItem(string key, long lockId) { - return ((ICacheInternal) Cache).Invoke((int) Op.Lock, key, GetLockInfo(lockId)); + return ((ICacheInternal) Cache).Invoke((int) Op.Lock, key, GetLockInfo(lockId)); } /// http://git-wip-us.apache.org/repos/asf/ignite/blob/ddae6acd/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj index 2e9a683..f546c21 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj @@ -91,7 +91,7 @@ - + http://git-wip-us.apache.org/repos/asf/ignite/blob/ddae6acd/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockEntryResult.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockEntryResult.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockEntryResult.cs deleted file mode 100644 index 6aa2955..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockEntryResult.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Impl.AspNet -{ - using System; - using System.Diagnostics; - using Apache.Ignite.Core.Binary; - - /// - /// Result of the session state lock processor. - /// - public class SessionStateLockEntryResult - { - /** Success flag. */ - private readonly bool _success; - - /** Session state data. */ - private readonly SessionStateData _data; - - /** Lock time. */ - private readonly DateTime? _lockTime; - - /// - /// Initializes a new instance of the class. - /// - /// The reader. - public SessionStateLockEntryResult(IBinaryRawReader reader) - { - _success = reader.ReadBoolean(); - _data = reader.ReadObject(); - _lockTime = reader.ReadTimestamp(); - - Debug.Assert(_success ^ (_data == null)); - Debug.Assert(_success ^ (_lockTime != null)); - } - - /// - /// Gets a value indicating whether lock succeeded. - /// - public bool Success - { - get { return _success; } - } - - /// - /// Gets the data. Null when is false. - /// - public SessionStateData Data - { - get { return _data; } - } - - /// - /// Gets the lock time. Null when is true. - /// - public DateTime? LockTime - { - get { return _lockTime; } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/ddae6acd/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockResult.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockResult.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockResult.cs new file mode 100644 index 0000000..4bf483c --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/AspNet/SessionStateLockResult.cs @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +namespace Apache.Ignite.Core.Impl.AspNet +{ + using System; + using System.Diagnostics; + using Apache.Ignite.Core.Binary; + + /// + /// Result of the session state lock processor. + /// + public class SessionStateLockResult + { + /** Success flag. */ + private readonly bool _success; + + /** Session state data. */ + private readonly SessionStateData _data; + + /** Lock time. */ + private readonly DateTime? _lockTime; + + /// + /// Initializes a new instance of the class. + /// + /// The reader. + public SessionStateLockResult(IBinaryRawReader reader) + { + _success = reader.ReadBoolean(); + _data = reader.ReadObject(); + _lockTime = reader.ReadTimestamp(); + + Debug.Assert(_success ^ (_data == null)); + Debug.Assert(_success ^ (_lockTime != null)); + } + + /// + /// Gets a value indicating whether lock succeeded. + /// + public bool Success + { + get { return _success; } + } + + /// + /// Gets the data. Null when is false. + /// + public SessionStateData Data + { + get { return _data; } + } + + /// + /// Gets the lock time. Null when is true. + /// + public DateTime? LockTime + { + get { return _lockTime; } + } + + /// + /// Returns a that represents this instance. + /// + public override string ToString() + { + return string.Format("{0} [Success={1}]", GetType().Name, _success); + } + } +}