L - the launchable to launch by this launcher.public abstract class AbstractLauncher<L extends org.openbase.jul.iface.Launchable>
extends org.openbase.jul.extension.rsb.com.AbstractIdentifiableController<rst.domotic.state.ActivationStateType.ActivationState,rst.domotic.state.ActivationStateType.ActivationState.Builder>
implements org.openbase.jul.pattern.Launcher, org.openbase.jul.iface.VoidInitializable, org.openbase.jul.iface.provider.NameProvider
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractLauncher.LauncherState |
| Modifier and Type | Field and Description |
|---|---|
static long |
LAUNCHER_TIMEOUT |
protected org.slf4j.Logger |
logger |
static String |
SCOPE_PREFIX_LAUNCHER |
| Constructor and Description |
|---|
AbstractLauncher(Class applicationClass,
Class<L> launchableClass)
Constructor prepares the launcher and registers already a shutdown hook.
|
| Modifier and Type | Method and Description |
|---|---|
L |
getLaunchable() |
long |
getLaunchTime() |
String |
getName()
Method returns the application name.
|
long |
getUpTime() |
void |
init() |
protected L |
instantiateLaunchable()
Method creates a launchable instance without any arguments..
|
boolean |
isVerified() |
void |
launch() |
protected abstract void |
loadProperties() |
static void |
main(String[] args,
Class application,
Class<? extends AbstractLauncher>... launchers) |
void |
registerMethods(org.openbase.jul.extension.rsb.iface.RSBLocalServer server) |
void |
relaunch() |
void |
shutdown() |
void |
stop() |
protected void |
verify()
Method verifies a running application.
|
getIdactivate, cloneDataBuilder, deactivate, getBuilderSetup, getControllerAvailabilityState, getData, getDataBuilder, getDataClass, getDataField, getDataFieldDescriptor, getScope, hasDataField, init, init, init, init, init, init, isActive, notifyChange, ping, postInit, requestStatus, reset, setDataField, setDataField, supportsDataField, toString, validateInitialization, waitForAvailabilityStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprotected final org.slf4j.Logger logger
public static final long LAUNCHER_TIMEOUT
public static final String SCOPE_PREFIX_LAUNCHER
public AbstractLauncher(Class applicationClass, Class<L> launchableClass) throws org.openbase.jul.exception.InstantiationException
launchableClass - the class to be launched.applicationClass - the class representing this application. Those is used for scope generation if the getName() method is not overwritten.org.openbase.jul.exception.InstantiationExceptionpublic void init()
throws org.openbase.jul.exception.InitializationException,
InterruptedException
init in interface org.openbase.jul.iface.DefaultInitializableinit in interface org.openbase.jul.iface.DefaultInitializableImpl<Void>org.openbase.jul.exception.InitializationExceptionInterruptedExceptionpublic void registerMethods(org.openbase.jul.extension.rsb.iface.RSBLocalServer server)
throws org.openbase.jul.exception.CouldNotPerformException
registerMethods in class org.openbase.jul.extension.rsb.com.RSBCommunicationService<rst.domotic.state.ActivationStateType.ActivationState,rst.domotic.state.ActivationStateType.ActivationState.Builder>org.openbase.jul.exception.CouldNotPerformExceptionpublic L getLaunchable()
public String getName() throws org.openbase.jul.exception.NotAvailableException
getName in interface org.openbase.jul.iface.provider.NameProviderorg.openbase.jul.exception.NotAvailableExceptionprotected L instantiateLaunchable() throws org.openbase.jul.exception.CouldNotPerformException
org.openbase.jul.exception.CouldNotPerformException - is thrown in case the launchable could not properly be instantiated.protected abstract void loadProperties()
protected void verify()
throws org.openbase.jul.exception.VerificationFailedException,
InterruptedException
org.openbase.jul.exception.VerificationFailedException - is thrown if the application is started with any restrictions.InterruptedException - is thrown if the verification process is externally interrupted.public void launch()
throws org.openbase.jul.exception.CouldNotPerformException,
InterruptedException
launch in interface org.openbase.jul.pattern.Launcherorg.openbase.jul.exception.CouldNotPerformExceptionInterruptedExceptionpublic void relaunch()
throws org.openbase.jul.exception.CouldNotPerformException,
InterruptedException
relaunch in interface org.openbase.jul.pattern.Launcherorg.openbase.jul.exception.CouldNotPerformExceptionInterruptedExceptionpublic void stop()
stop in interface org.openbase.jul.pattern.Launcherpublic void shutdown()
shutdown in interface org.openbase.jul.iface.Shutdownableshutdown in class org.openbase.jul.extension.rsb.com.RSBCommunicationService<rst.domotic.state.ActivationStateType.ActivationState,rst.domotic.state.ActivationStateType.ActivationState.Builder>public long getUpTime()
getUpTime in interface org.openbase.jul.pattern.Launcherpublic long getLaunchTime()
getLaunchTime in interface org.openbase.jul.pattern.Launcherpublic boolean isVerified()
isVerified in interface org.openbase.jul.pattern.Launcherpublic static void main(String[] args, Class application, Class<? extends AbstractLauncher>... launchers)
Copyright © 2014–2016 openbase.org. All rights reserved.