All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hazelcast.spi.NodeEngine Maven / Gradle / Ivy

There is a newer version: 5.4.0
Show newest version
/*
 * Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
 *
 * Licensed 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 com.hazelcast.spi;

import com.hazelcast.cluster.ClusterService;
import com.hazelcast.config.Config;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.Member;
import com.hazelcast.instance.GroupProperties;
import com.hazelcast.internal.serialization.SerializationService;
import com.hazelcast.logging.ILogger;
import com.hazelcast.nio.Address;
import com.hazelcast.nio.serialization.Data;
import com.hazelcast.partition.InternalPartitionService;
import com.hazelcast.quorum.QuorumService;
import com.hazelcast.transaction.TransactionManagerService;
import com.hazelcast.wan.WanReplicationService;

/**
 * The NodeEngine is the 'umbrella' of services/service-method that gets injected into a {@link ManagedService}.
 * 

* So if you are writing a custom SPI service, such as a stack-service, this service should probably implement * the {@link ManagedService} so you can get access to the services within the system. */ public interface NodeEngine { /** * Gets the OperationService. * * @return the OperationService. */ OperationService getOperationService(); /** * Gets the ExecutionService. * * @return the ExecutionService. */ ExecutionService getExecutionService(); /** * Gets the ClusterService. * * @return the ClusterService. */ ClusterService getClusterService(); /** * Gets the InternalPartitionService. * * @return the InternalPartitionService. */ InternalPartitionService getPartitionService(); /** * Gets the EventService. * * @return the EventService. */ EventService getEventService(); /** * Gets the SerializationService. * * @return the SerializationService. */ SerializationService getSerializationService(); /** * Gets the ProxyService. * * @return the ProxyService. */ ProxyService getProxyService(); /** * Gets the WaitNotifyService. * * @return the WaitNotifyService. */ WaitNotifyService getWaitNotifyService(); /** * Gets the WanReplicationService. * * @return the WanReplicationService. */ WanReplicationService getWanReplicationService(); /** * Gets the QuorumService. * * @return the QuorumService. */ QuorumService getQuorumService(); /** * Gets the TransactionManagerService. * * @return the TransactionManagerService. */ TransactionManagerService getTransactionManagerService(); /** * Gets the address of the master member. *

* This value can be null if no master is elected yet. *

* The value can change over time. * * @return the address of the master member. */ Address getMasterAddress(); /** * Get the address of this member. *

* The returned value will never change and will never be null. * * @return the address of this member. */ Address getThisAddress(); /** * Returns the local member. *

* The returned value will never change and will never be null. * * @return the local member. */ Member getLocalMember(); /** * Returns the Config that was used to create the HazelcastInstance. *

* The returned value will never change and will never be null. * * @return the config. */ Config getConfig(); /** * Returns the Config ClassLoader. *

* todo: add more documentation what the purpose is of the config classloader. * * @return the config ClassLoader. */ ClassLoader getConfigClassLoader(); /** * Returns the GroupProperties. *

* The returned value will never change and will never be null. * * @return the GroupProperties */ GroupProperties getGroupProperties(); /** * Gets the logger for a given name. *

* It is best to get an ILogger through this method instead of doing * * @param name the name of the logger. * @return the ILogger. * @throws NullPointerException if name is null. * @see #getLogger(Class) */ ILogger getLogger(String name); /** * Gets the logger for a given class. * * @param clazz the class of the logger. * @return the ILogger. * @throws NullPointerException if clazz is null. * @see #getLogger(String) */ ILogger getLogger(Class clazz); /** * Serializes an object to a {@link Data}. *

* This method can safely be called with a {@link Data} instance. In that case, that instance is returned. *

* If this method is called with null, null is returned. * * @param object the object to serialize. * @return the serialized object. * @throws com.hazelcast.nio.serialization.HazelcastSerializationException when serialization fails. */ Data toData(Object object); /** * Deserializes an object. *

* This method can safely be called on an object that is already deserialized. In that case, that instance * is returned. *

* If this method is called with null, null is returned. * * @param object the object to deserialize. * @return the deserialized object. * @throws com.hazelcast.nio.serialization.HazelcastSerializationException when deserialization fails. */ T toObject(Object object); /** * Checks if the HazelcastInstance that this {@link NodeEngine} belongs to is still active. *

* A HazelcastInstance is not active when it is shutting down or already shut down. * * Also see {@link NodeEngine#isRunning()} * * @return true if active, false otherwise. */ @Deprecated boolean isActive(); /** * Indicates that node is not shutting down or it has not already shut down * @return true if node is not shutting down or it has not already shut down */ boolean isRunning(); /** * Returns the HazelcastInstance that this {@link NodeEngine} belongs to. * * @return the HazelcastInstance */ HazelcastInstance getHazelcastInstance(); /** * Gets the {@link SharedService} for the given serviceName. * * @param serviceName the name of the shared service to get. * @param * @return the found service, or null if the service was not found. * @throws NullPointerException if the serviceName is null. */ T getSharedService(String serviceName); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy