Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E4E8E1853B for ; Fri, 28 Aug 2015 12:49:20 +0000 (UTC) Received: (qmail 89956 invoked by uid 500); 28 Aug 2015 12:49:20 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 89872 invoked by uid 500); 28 Aug 2015 12:49:20 -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 89165 invoked by uid 99); 28 Aug 2015 12:49:20 -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; Fri, 28 Aug 2015 12:49:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2A484DFFAB; Fri, 28 Aug 2015 12:49:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Fri, 28 Aug 2015 12:49:34 -0000 Message-Id: In-Reply-To: <03d00f7f08c642578bff5db4caeea5e6@git.apache.org> References: <03d00f7f08c642578bff5db4caeea5e6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [16/41] ignite git commit: IGNITE-1303: Created PlatformContext abstraction. IGNITE-1303: Created PlatformContext abstraction. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/08be80ff Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/08be80ff Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/08be80ff Branch: refs/heads/ignite-1093 Commit: 08be80ffee4b24506802cb22130903cb1e749873 Parents: ed974f3 Author: vozerov-gridgain Authored: Wed Aug 26 12:05:51 2015 +0300 Committer: vozerov-gridgain Committed: Wed Aug 26 12:05:51 2015 +0300 ---------------------------------------------------------------------- .../processors/platform/PlatformContext.java | 107 +++++++++++++++++++ 1 file changed, 107 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/08be80ff/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java new file mode 100644 index 0000000..0385f46 --- /dev/null +++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java @@ -0,0 +1,107 @@ +/* + * 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. + */ + +package org.apache.ignite.internal.processors.platform; + +import org.apache.ignite.cluster.*; +import org.apache.ignite.internal.*; +import org.apache.ignite.internal.portable.*; +import org.apache.ignite.internal.processors.platform.callback.*; +import org.apache.ignite.internal.processors.platform.memory.*; + +import java.util.*; + +/** + * Platform context. Acts as an entry point for platform operations. + */ +public interface PlatformContext { + /** + * Gets kernal context. + * + * @return Kernal context. + */ + public GridKernalContext kernalContext(); + + /** + * Gets platform memory manager. + * + * @return Memory manager. + */ + public PlatformMemoryManager memory(); + + /** + * Gets platform callback gateway. + * + * @return Callback gateway. + */ + public PlatformCallbackGateway gateway(); + + /** + * Get memory reader. + * + * @param mem Memory. + * @return Reader. + */ + public PortableRawReaderEx reader(PlatformMemory mem); + + /** + * Get memory reader. + * + * @param in Input. + * @return Reader. + */ + public PortableRawReaderEx reader(PlatformInputStream in); + + /** + * Get memory writer. + * + * @param mem Memory. + * @return Writer. + */ + public PortableRawWriterEx writer(PlatformMemory mem); + + /** + * Get memory writer. + * + * @param out Output. + * @return Writer. + */ + public PortableRawWriterEx writer(PlatformOutputStream out); + + /** + * Sends node info to native platform, if necessary. + * + * @param node Node. + */ + public void addNode(ClusterNode node); + + /** + * Writes a node id to a stream and sends node info to native platform, if necessary. + * + * @param writer Writer. + * @param node Node. + */ + public void writeNode(PortableRawWriterEx writer, ClusterNode node); + + /** + * Writes multiple node ids to a stream and sends node info to native platform, if necessary. + * + * @param writer Writer. + * @param nodes Nodes. + */ + public void writeNodes(PortableRawWriterEx writer, Collection nodes); +}