SRJRCFrames
v0.1.296

de.schwarzrot.service.sample
Class SampleService

java.lang.Object
  extended by de.schwarzrot.app.support.AbstractService<ServiceConfig>
      extended by de.schwarzrot.service.sample.SampleService
All Implemented Interfaces:
MainEntry<ServiceConfig>, Service<ServiceConfig>, UserNameProvider, Runnable

public class SampleService
extends AbstractService<ServiceConfig>

is a sample for a service, where the service class and the class providing the main-method is the same.

Author:
Reinhard Mantey

Constructor Summary
SampleService()
           
 
Method Summary
 String getApplicationName()
          print the application name - may be localized.
 boolean isIdle()
          will be used by the ServiceLauncher to determine, whether it should sleep between the calls to Service.run().
static void main(String[] args)
           
 void run()
           
 void setupLate()
          second stage of initialization.
 void usage()
          tell the user about the right usage
 
Methods inherited from class de.schwarzrot.app.support.AbstractService
getAppArgs, getAppInfo, getAppInfo, getApplicationDefaults, getConfig, getLogger, getUserName, isShutdownRequested, setAppArgs, setConfig, setShutdownRequested, setupEarly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleService

public SampleService()
Method Detail

getApplicationName

public String getApplicationName()
Description copied from interface: MainEntry
print the application name - may be localized. For identifying purpose consider using SystemDefault.applicationID

Specified by:
getApplicationName in interface MainEntry<ServiceConfig>
Overrides:
getApplicationName in class AbstractService<ServiceConfig>
Returns:
- the applications name

isIdle

public boolean isIdle()
Description copied from interface: Service
will be used by the ServiceLauncher to determine, whether it should sleep between the calls to Service.run().

Returns:
true if the Service was idle, otherwise false

run

public void run()

setupLate

public void setupLate()
Description copied from interface: Service
second stage of initialization. Will be called after loading all referenced external jars, right before starting the service loop.


usage

public void usage()
Description copied from interface: MainEntry
tell the user about the right usage


main

public static void main(String[] args)

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.