public class FwkServiceControlManager extends FwkApplication implements FwkServiceControlManagerInterface
,
Serialized FormModifier 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, statusPanel
infoBusMemberSupport
changeManager, properties, suspendChangeManager
source
author, 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, titleName
NO_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_STOPPED
INFOBUS_SOURCE
AUTHOR, 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, writeToXML
addInfoBusPropertyListener, addInfoBusVetoableListener, finalize, getInfoBus, getInfoBusName, getMemberName, isConnected, joinInfoBus, removeInfoBusPropertyListener, removeInfoBusVetoableListener, setInfoBus, setInfoBusName, setMemberName, setName
addDataItemChangeListener, fireItemAdded, fireItemDeleted, fireItemRevoked, fireItemValueChanged, getName, getProperty, getPropertyGroup, getSource, isChangeManagerSuspended, release, removeDataItemChangeListener, setProperty, setPropertyGroup, suspendChangeManager
addCommand, 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, setTitleName
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, suspendPropertyChangeEvents
getClassName, getPresentationString, getPresentationString, getTransferData, getTransferDataFlavors, isDataFlavorSupported, lostOwnership, setClassName, setCreationDate, toString
getNiceVersion
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addExecuteStateListener, fireExecuteStateEvent, getFwkPort, getStatusPanel, hasFwkPort, isEternal, isRegistered, register, register, register, removeExecuteStateListener, setArguments, setEternal, setPanel, setServiceControlManager, unregister
getInfoBusName, getMemberName, isConnected, setInfoBusName, setMemberName
addInfoBusPropertyListener, addInfoBusVetoableListener, getInfoBus, removeInfoBusPropertyListener, removeInfoBusVetoableListener, setInfoBus
getCompany, readConstructor, readFromDOM, readingDOM, readingDOM, writeToXML
getController, setController
getPrintJobName, setPageFormat
fireItemAdded, fireItemDeleted, fireItemRevoked, fireItemValueChanged, getProperty, getPropertyGroup, setProperty, setPropertyGroup, suspendChangeManager
getCommands, getPersistentObjectNames
destroyController
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEvents
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeArray, getVetoableChangeListenerArray, getVetoableChangeListenerArray, removeVetoableChangeListener, removeVetoableChangeListener
getAuthor, 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, setTitleName
getTransferData, getTransferDataFlavors, isDataFlavorSupported
addCommand, addCommand, addToGroup, addToGroup, clearCommands, commandsAvailable, deleteGroup, getCommand, getGroup, groupExists, removeCommand, removeFromGroup, setCommands
getPresentationString, getPresentationString
release
getNumberOfPages, getPageFormat, getPrintable
getPriority, isInterrupted, setPriority, start, stop
public 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()
FwkInterface
getVersion
in interface FwkInterface
getVersion
in class FwkApplication
public static FwkDescriptionInterface getDescriptor()
public boolean exit()
exit
in interface FwkApplicationInterface
exit
in class FwkApplication
public FwkApplicationInterface getApplication()
getApplication
in interface FwkServiceControlManagerInterface
public int getCheckPoint()
getCheckPoint
in interface FwkServiceControlManagerInterface
setWaitHint()
,
incrementCheckPoint()
public FwkCommandInterface[] getCommands()
getCommands
in interface FwkInstructionInterface
getCommands
in class FwkPersistence
public FwkIconInterface getIcon()
getIcon
in interface FwkDescriptionInterface
getIcon
in class FwkPersistence
FwkPersistence.setIcon(FwkIconInterface)
public FwkIconInterface getIcon(int type)
getIcon
in interface FwkDescriptionInterface
getIcon
in class FwkPersistence
type
- The type of the icon, use the predefined values (see above).#setIcon(Icon)
public FwkPanelInterface getPanel()
getPanel
in interface FwkApplicationInterface
getPanel
in class FwkApplication
public int getState()
getState
in interface FwkServiceControlManagerInterface
public void incrementCheckPoint()
incrementCheckPoint
in interface FwkServiceControlManagerInterface
setWaitHint()
public void init()
init
in interface FwkApplicationInterface
init
in class FwkApplication
setArguments()
public boolean isPauseRequested()
isPauseRequested
in interface FwkServiceControlManagerInterface
public boolean isShutdownRequested()
isShutdownRequested
in interface FwkServiceControlManagerInterface
public boolean isContinueRequested()
isContinueRequested
in interface FwkServiceControlManagerInterface
public boolean isStopRequested()
isStopRequested
in interface FwkServiceControlManagerInterface
public void serviceCtrlHandler(int controlCode)
serviceCtrlHandler
in interface FwkServiceControlManagerInterface
controlCode
- One of the control codes specified above.public boolean reportStatus(int exitCode, int specificExitCode, int checkPoint, int waitHint)
reportStatus
in interface FwkServiceControlManagerInterface
exitCode
- 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.Runnable
run
in class FwkApplication
public void setApplication(FwkApplicationInterface application)
setApplication
in interface FwkServiceControlManagerInterface
application
- The application to be controlled.public void setNativeMode(boolean nativeMode)
setNativeMode
in interface FwkServiceControlManagerInterface
nativeCode
- The native code.public void setState(int newState)
setState
in interface FwkServiceControlManagerInterface
newState
- The new state of the application.public void setWaitHint(int waitHint)
setWaitHint
in interface FwkServiceControlManagerInterface
waitHint
- 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 FwkDOMHandlerInterface
writeConstructor
in class FwkApplication
document
- 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 FwkDOMHandlerInterface
writeToDOM
in class FwkApplication
document
- 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)