001/*
002 * JPPF.
003 * Copyright (C) 2005-2018 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 */
018
019package org.jppf.startup;
020
021/**
022 * This interface represents objects that are run at node startup time.
023 * <p>More precisely, they are run just after the node MBeans have been registered,
024 * and just before the network handshake with the server is performed.
025 * <p>Classes implementing this interface must have a public no-arg constructor and
026 * implement the {@link java.lang.Runnable#run() run()} method.
027 * <p>Node startup classes allow a developer to perform initializations at runtime,
028 * such as load specific APIs  * that can be reused in the tasks, create connection
029 * pools, subscribe to the monitoring MBeans notifications, etc. The range of applications is quite broad.
030 * <p>They are looked up by using the Service Provider Interface (SPI) lookup mechanism.
031 * For the SPI to find them, proceed as follows:
032 * <ul>
033 * <li>in the classpath root create, if it does not exist, a folder named META-INF/services</li>
034 * <li>in this folder create a file named &quot;org.jppf.startup.JPPFNodeStartupSPI&quot;</li>
035 * <li>the content of this file is one or more line(s) with the fully qualified class name of an implementation of this interface</li>
036 * <li>to specify multiple implementations, just put one per line in the file</li>
037 * <li>there can also be multiple META-INF/services/org.jppf.startup.JPPFNodeStartupSPI resources in the classpath
038 * (for instance in multiple jar files); all of them will be looked up and processed</li>
039 * </ul>
040 * @author Laurent Cohen
041 */
042public interface JPPFNodeStartupSPI extends JPPFStartup
043{
044}