001/*
002 * JPPF.
003 * Copyright (C) 2005-2016 JPPF Team.
004 * http://www.jppf.org
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.jppf.node;
019
020import org.jppf.classloader.AbstractJPPFClassLoader;
021import org.jppf.management.*;
022
023/**
024 * Interface for a node that provides information about its activity.
025 * @author Laurent Cohen
026 */
027public interface Node extends Runnable {
028  /**
029   * Get this node's UUID.
030   * @return the uuid as a string.
031   */
032  String getUuid();
033
034  /**
035   * Get the system information for this node.
036   * @return a {@link JPPFSystemInformation} instance.
037   */
038  JPPFSystemInformation getSystemInformation();
039
040  /**
041   * Determine whether this node is local to another component.
042   * @return {@code true} if this node is local, {@code false} otherwise.
043   */
044  boolean isLocal();
045
046  /**
047   * Reset the current task class loader if any is present (i.e. if a job is being executed), without reconnecting to the server.
048   * @param params a (possibly empty) set of arbitrary parameters to propagate to the class loader.
049   * @return the newly created class loader, or {@code null} if none could be created at this time. 
050   */
051  AbstractJPPFClassLoader resetTaskClassLoader(final Object...params);
052
053  /**
054   * Determine whether this node is running in offline mode.
055   * @return {@code true} if this node is offline, {@code false} otherwise.
056   */
057  boolean isOffline();
058
059  /**
060   * Determine whether this node is a 'master' node for the provisioning features.
061   * @return {@code true} if this node is a master, {@code false} otherwise.
062   */
063  boolean isMasterNode();
064
065  /**
066   * Determine whether this node is a 'slave' node for the provisioning features.
067   * @return {@code true} if this node is a slave, {@code false} otherwise.
068   */
069  boolean isSlaveNode();
070
071  /**
072   * Determine whether this node can execute .Net tasks.
073   * @return {@code true} if this node can execute .Net tasks, {@code false} otherwise.
074   */
075  boolean isDotnetCapable();
076
077  /**
078   * Determine whether this node is an Android node.
079   * @return {@code true} if this node runs on Androis, {@code false} otherwise.
080   */
081  boolean isAndroid();
082
083  /**
084   * Get the JMX connector server associated with the node.
085   * @return a JMXServer instance.
086   * @throws Exception if any error occurs.
087   */
088  JMXServer getJmxServer() throws Exception;
089}