public class FwkServiceControlManager extends FwkApplication implements FwkServiceControlManagerInterface
,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected FwkApplicationInterface |
application |
static java.lang.String |
applicationName |
protected int |
checkPoint |
protected int |
currentState |
protected static FwkDescriptionInterface |
descriptor |
protected static java.lang.String |
loadLibName |
protected boolean |
nativeMode |
protected FwkPropertyEditorDialogPaneValue |
propertyList |
protected boolean |
shutdownRequested |
protected int |
threadMonitor |
static java.lang.String |
version |
protected int |
waitHint |
applicationThread, args, controller, eternal, executeStateListeners, pageFormat, panel, port, readingDOM, serviceControlManager, statusLabel, statusPanelinfoBusMemberSupportchangeManager, properties, suspendChangeManagersourceauthor, buildnr, className, company, copyright, creationDate, dateFormatString, description, eMail, FWK_ICON, FWK_ICON_ARRAY, FWK_ICON_BG, FWK_ICON_BG_ARRAY, FWK_ICON_BG_LARGE, FWK_ICON_BG_LARGE_ARRAY, FWK_ICON_LARGE, FWK_ICON_LARGE_ARRAY, icon, ICON, iconCount, iconKey, internetAddress, name, titleNameNO_ERROR, SERVICE_CONTINUE_PENDING, SERVICE_CONTROL_CONTINUE, SERVICE_CONTROL_INTERROGATE, SERVICE_CONTROL_PAUSE, SERVICE_CONTROL_SHUTDOWN, SERVICE_CONTROL_STOP, SERVICE_NOT_INITIALIZED, SERVICE_PAUSE_PENDING, SERVICE_PAUSED, SERVICE_RUNNING, SERVICE_SHUTTING_DOWN, SERVICE_START_PENDING, SERVICE_STOP_PENDING, SERVICE_STOPPEDINFOBUS_SOURCEAUTHOR, BUILDNR, COMPANY, COPYRIGHT, DATE_FORMAT, DEFAULT_ICON, DESCRIPTION, INTERNET, LARGE_ICON, LARGE_KEY_EXT, LARGE_OPAQUE_ICON, LARGE_OPAQUE_KEY_EXT, OPAQUE_ICON, OPAQUE_KEY_EXT, RCS_DATE_FORMAT, SUPPORT_EMAIL, TITLE_NAME| Constructor and Description |
|---|
FwkServiceControlManager()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
exit()
Exit the application gracefully and release all
related resources.
|
FwkApplicationInterface |
getApplication()
Get the application that is controlled by the Service
Control Manager.
|
int |
getCheckPoint()
Get the checkpoint counter which indicates that
the application is still alive.
|
FwkCommandInterface[] |
getCommands()
Retrieve the command array.
|
static FwkDescriptionInterface |
getDescriptor() |
FwkIconInterface |
getIcon()
Get the icon image.
|
FwkIconInterface |
getIcon(int type)
Get the image icon of the application
|
FwkPanelInterface |
getPanel()
Get the panel of this application.
|
int |
getState()
Get the current state.
|
java.lang.String |
getVersion()
Return the version string of the FWK component.
|
void |
incrementCheckPoint()
Increment the checkpoint counter to indicate that
the application is still alive.
|
void |
init()
Initialize the application defaults.
|
boolean |
isContinueRequested()
Check if continue is requested.
|
boolean |
isPauseRequested()
Check if pause is requested.
|
boolean |
isShutdownRequested()
Check if shutdown is requested.
|
boolean |
isStopRequested()
Check if stop is requested.
|
static void |
main(java.lang.String[] args)
Main module of this application.
|
boolean |
reportStatus(int exitCode,
int specificExitCode,
int checkPoint,
int waitHint)
Send a status message to Service Control Manager.
|
void |
run()
Run the application.
|
void |
serviceCtrlHandler(int controlCode)
The Service Control Handler receives commands from
the Service Control Manager via control codes.
|
void |
setApplication(FwkApplicationInterface application)
Set the application that shall be controlled by the Service
Control Manager.
|
void |
setNativeMode(boolean nativeMode)
Set the operation mode of this Service Control Manager.
|
void |
setState(int newState)
As a reaction to the control codes, a controlled application
must be able to set its current state.
|
void |
setWaitHint(int waitHint)
The controlled application should set the wait
hint - that is the number of milliseconds the
Service Control Manager shall wait for any
progress indication.
|
org.w3c.dom.Element |
writeConstructor(org.w3c.dom.Document document,
FwkXmlDtdInterface dtd,
org.w3c.dom.Node node,
java.util.Map classProperties)
Write a constructor dom node.
|
org.w3c.dom.Element |
writeToDOM(org.w3c.dom.Document document,
FwkXmlDtdInterface dtd,
org.w3c.dom.Node node,
java.util.Map classProperties)
Write this application as child to the given DOM node.
|
addExecuteStateListener, destroyController, fireExecuteStateEvent, getController, getFwkPort, getNumberOfPages, getPageFormat, getPrintable, getPrintJobName, getPriority, getStatusPanel, hasFwkPort, isEternal, isInterrupted, isRegistered, print, readConstructor, readFromDOM, readingDOM, readingDOM, register, register, register, removeExecuteStateListener, setArguments, setController, setEternal, setPageFormat, setPanel, setPriority, setServiceControlManager, start, stop, unregister, writeToXMLaddInfoBusPropertyListener, addInfoBusVetoableListener, finalize, getInfoBus, getInfoBusName, getMemberName, isConnected, joinInfoBus, removeInfoBusPropertyListener, removeInfoBusVetoableListener, setInfoBus, setInfoBusName, setMemberName, setNameaddDataItemChangeListener, fireItemAdded, fireItemDeleted, fireItemRevoked, fireItemValueChanged, getName, getProperty, getPropertyGroup, getSource, isChangeManagerSuspended, release, removeDataItemChangeListener, setProperty, setPropertyGroup, suspendChangeManageraddCommand, addCommand, addToGroup, addToGroup, addVetoableChangeListener, addVetoableChangeListener, clearCommands, commandsAvailable, compareTo, deleteGroup, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getAuthor, getBuild, getCommand, getCommands, getCompany, getCompanyInternetAddress, getCopyright, getCreationDate, getCreationDate, getDateFormatString, getDescription, getFwkMimeTypes, getGroup, getIconKey, getIconKey, getPersistentObjectNames, getSupportEMail, getTitle, getTitleName, getVetoableChangeArray, getVetoableChangeListenerArray, getVetoableChangeListenerArray, groupExists, removeCommand, removeFromGroup, removeVetoableChangeListener, removeVetoableChangeListener, setAuthor, setBuild, setCommands, setCompany, setCompanyInternetAddress, setCopyright, setCreationDate, setDateFormatString, setDescription, setDescriptor, setDescriptor, setIcon, setIcon, setIconKey, setIconKey, setSource, setSupportEMail, setTitleNameaddPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, suspendPropertyChangeEventsgetClassName, getPresentationString, getPresentationString, getTransferData, getTransferDataFlavors, isDataFlavorSupported, lostOwnership, setClassName, setCreationDate, toStringgetNiceVersionclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitaddExecuteStateListener, fireExecuteStateEvent, getFwkPort, getStatusPanel, hasFwkPort, isEternal, isRegistered, register, register, register, removeExecuteStateListener, setArguments, setEternal, setPanel, setServiceControlManager, unregistergetInfoBusName, getMemberName, isConnected, setInfoBusName, setMemberNameaddInfoBusPropertyListener, addInfoBusVetoableListener, getInfoBus, removeInfoBusPropertyListener, removeInfoBusVetoableListener, setInfoBusgetCompany, readConstructor, readFromDOM, readingDOM, readingDOM, writeToXMLgetController, setControllergetPrintJobName, setPageFormatfireItemAdded, fireItemDeleted, fireItemRevoked, fireItemValueChanged, getProperty, getPropertyGroup, setProperty, setPropertyGroup, suspendChangeManagergetCommands, getPersistentObjectNamesdestroyControlleraddPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEventsaddVetoableChangeListener, addVetoableChangeListener, getVetoableChangeArray, getVetoableChangeListenerArray, getVetoableChangeListenerArray, removeVetoableChangeListener, removeVetoableChangeListenergetAuthor, getBuild, getClassName, getCompanyInternetAddress, getCopyright, getCreationDate, getCreationDate, getDateFormatString, getDescription, getIconKey, getIconKey, getName, getPresentationString, getPresentationString, getSupportEMail, getTitle, getTitleName, setAuthor, setBuild, setClassName, setCompany, setCompanyInternetAddress, setCopyright, setCreationDate, setCreationDate, setDateFormatString, setDescription, setDescriptor, setIcon, setIcon, setIconKey, setIconKey, setName, setSupportEMail, setTitleNamegetTransferData, getTransferDataFlavors, isDataFlavorSupportedaddCommand, addCommand, addToGroup, addToGroup, clearCommands, commandsAvailable, deleteGroup, getCommand, getGroup, groupExists, removeCommand, removeFromGroup, setCommandsgetPresentationString, getPresentationStringreleasegetNumberOfPages, getPageFormat, getPrintablegetPriority, isInterrupted, setPriority, start, stoppublic static final java.lang.String version
protected static final FwkDescriptionInterface descriptor
public static final java.lang.String applicationName
protected static final java.lang.String loadLibName
protected boolean nativeMode
protected int currentState
protected FwkApplicationInterface application
protected boolean shutdownRequested
protected FwkPropertyEditorDialogPaneValue propertyList
protected int checkPoint
protected int waitHint
protected int threadMonitor
public java.lang.String getVersion()
FwkInterfacegetVersion in interface FwkInterfacegetVersion in class FwkApplicationpublic static FwkDescriptionInterface getDescriptor()
public boolean exit()
exit in interface FwkApplicationInterfaceexit in class FwkApplicationpublic FwkApplicationInterface getApplication()
getApplication in interface FwkServiceControlManagerInterfacepublic int getCheckPoint()
getCheckPoint in interface FwkServiceControlManagerInterfacesetWaitHint(),
incrementCheckPoint()public FwkCommandInterface[] getCommands()
getCommands in interface FwkInstructionInterfacegetCommands in class FwkPersistencepublic FwkIconInterface getIcon()
getIcon in interface FwkDescriptionInterfacegetIcon in class FwkPersistenceFwkPersistence.setIcon(FwkIconInterface)public FwkIconInterface getIcon(int type)
getIcon in interface FwkDescriptionInterfacegetIcon in class FwkPersistencetype - The type of the icon, use the predefined values (see above).#setIcon(Icon)public FwkPanelInterface getPanel()
getPanel in interface FwkApplicationInterfacegetPanel in class FwkApplicationpublic int getState()
getState in interface FwkServiceControlManagerInterfacepublic void incrementCheckPoint()
incrementCheckPoint in interface FwkServiceControlManagerInterfacesetWaitHint()public void init()
init in interface FwkApplicationInterfaceinit in class FwkApplicationsetArguments()public boolean isPauseRequested()
isPauseRequested in interface FwkServiceControlManagerInterfacepublic boolean isShutdownRequested()
isShutdownRequested in interface FwkServiceControlManagerInterfacepublic boolean isContinueRequested()
isContinueRequested in interface FwkServiceControlManagerInterfacepublic boolean isStopRequested()
isStopRequested in interface FwkServiceControlManagerInterfacepublic void serviceCtrlHandler(int controlCode)
serviceCtrlHandler in interface FwkServiceControlManagerInterfacecontrolCode - One of the control codes specified above.public boolean reportStatus(int exitCode,
int specificExitCode,
int checkPoint,
int waitHint)
reportStatus in interface FwkServiceControlManagerInterfaceexitCode - Error code.specificExitCode - Application specific error code.checkPoint - An is-alive indicator to be incremented by the application.waitHint - The estimated remaining time to completion in ms.public void run()
run in interface java.lang.Runnablerun in class FwkApplicationpublic void setApplication(FwkApplicationInterface application)
setApplication in interface FwkServiceControlManagerInterfaceapplication - The application to be controlled.public void setNativeMode(boolean nativeMode)
setNativeMode in interface FwkServiceControlManagerInterfacenativeCode - The native code.public void setState(int newState)
setState in interface FwkServiceControlManagerInterfacenewState - The new state of the application.public void setWaitHint(int waitHint)
setWaitHint in interface FwkServiceControlManagerInterfacewaitHint - The expected wait time in milliseconds.incrementCheckPoint()public org.w3c.dom.Element writeConstructor(org.w3c.dom.Document document,
FwkXmlDtdInterface dtd,
org.w3c.dom.Node node,
java.util.Map classProperties)
writeConstructor in interface FwkDOMHandlerInterfacewriteConstructor in class FwkApplicationdocument - The documnent Object Model.dtd - The dtd descriptor.node - The node.classProperties - Map the contains the writable object properties.
May be null.public org.w3c.dom.Element writeToDOM(org.w3c.dom.Document document,
FwkXmlDtdInterface dtd,
org.w3c.dom.Node node,
java.util.Map classProperties)
writeToDOM in interface FwkDOMHandlerInterfacewriteToDOM in class FwkApplicationdocument - The documnent Object Model.node - The parent node.classProperties - Map the contains the writable object properties.
May be null.public static void main(java.lang.String[] args)