|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.startup.DefaultStartup
public class DefaultStartup
A default implementation of StartupMBean.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.startup.Startup |
|---|
GROUP_ID_PROPERTY, SCRIPT_ENGINE_PROPERTY, SCRIPT_LANGUAGE_PROPERTY, USER_ID_PROPERTY |
| Constructor Summary | |
|---|---|
DefaultStartup()
Constructs a new startup. |
|
DefaultStartup(MBeanServer server)
Constructs a new startup with arguments in the specified server. |
|
| Method Summary | |
|---|---|
void |
addProperty(int index,
String key,
String value)
Inserts a multivalued property at the specified index. |
void |
addProperty(String key,
String value)
Adds a multivalued property. |
void |
addPropertyFilePath(String path)
Adds a property file path. |
void |
addPropertyFilePath(String path,
String encoding)
Adds a property file path with an encoding. |
void |
clearProperties()
Clears all properties. |
boolean |
containsProperty(String key)
Checks whether a property is defined. |
String |
getConfigKey()
Gets the path finder key for resolving configuration paths. |
String[] |
getProperties(String key)
Gets a multivalued property. |
String |
getProperty(String key)
Gets a property. |
String |
getPropertyFilePath()
Gets the property file path. |
String[] |
getPropertyFilePaths()
Gets the property file paths. |
int |
getRestartDelay()
Gets the restart delay. |
long |
getShutdownDelay()
Gets the shutdown delay. |
int |
indexOfProperty(String key,
String value)
Returns the index of a multivalued property value. |
boolean |
isStarted()
Checks whether the startable has been started. |
OrderedMap<String,Object> |
propertyMap()
Returns a map of properties. |
OrderedMap<String,Object> |
propertyMap(String prefix)
Returns a map of prefixed properties. |
void |
register(String[] args)
Registers the startup without starting. |
Object |
removeProperty(String key)
Removes a property. |
boolean |
removeProperty(String key,
String value)
Removes a multivalued property. |
void |
removePropertyFilePath(String path)
Removes a property file path. |
void |
restart(int delay)
Restarts after a delay. |
void |
setConfigKey(String key)
Sets the path finder key for resolving configuration paths. |
Object |
setProperties(String key,
String[] values)
Sets a multivalued property. |
Object |
setProperty(String key,
String value)
Sets a property. |
void |
setPropertyFilePath(String path)
Sets the property file path. |
void |
setPropertyFilePath(String path,
String encoding)
Sets the property file path with an encoding. |
void |
setPropertyFilePaths(String[] paths)
Sets the property file paths. |
void |
setPropertyFilePaths(String[] paths,
String... encoding)
Sets the property file paths with encodings. |
void |
setShutdownDelay(long delay)
Sets the shutdown delay forcing a shutdown after running all shutdown scripts. |
void |
start()
Starts up if registered. |
void |
stop()
Shuts down. |
void |
storeProperties()
Stores properties to the property file. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.core.startup.Startup |
|---|
unregister |
| Constructor Detail |
|---|
public DefaultStartup()
public DefaultStartup(MBeanServer server)
server - the MBean server.| Method Detail |
|---|
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.
public void register(String[] args)
throws Exception
Startup
register in interface Startupargs - the startup arguments.
Exception - if registration fails.public boolean isStarted()
Startable
isStarted in interface Startable
public void start()
throws Exception
Startup
start in interface Startablestart in interface StartupException - if startup fails.public void stop()
Startup
stop in interface Startablestop in interface Startuppublic void restart(int delay)
Startup
restart in interface Startupdelay - the restart delay in secs.public int getRestartDelay()
Startup
getRestartDelay in interface Startuppublic long getShutdownDelay()
Startup
getShutdownDelay in interface Startuppublic void setShutdownDelay(long delay)
Startup
setShutdownDelay in interface Startupdelay - the shutdown delay in msecs (-1 = never).public String getConfigKey()
Configurable
getConfigKey in interface Configurablepublic void setConfigKey(String key)
Configurable
setConfigKey in interface Configurablekey - the path finder key.public String getPropertyFilePath()
Configurable
getPropertyFilePath in interface Configurablepublic void setPropertyFilePath(String path)
ConfigurableNote that all previously defined property file paths and properties are cleared.
setPropertyFilePath in interface Configurablepath - a property file path.
public void setPropertyFilePath(String path,
String encoding)
Configurable
setPropertyFilePath in interface Configurablepath - a property file path.encoding - an encoding to use.public String[] getPropertyFilePaths()
Configurable
getPropertyFilePaths in interface Configurablepublic void setPropertyFilePaths(String[] paths)
Configurable
setPropertyFilePaths in interface Configurablepaths - property file paths.
public void setPropertyFilePaths(String[] paths,
String... encoding)
Configurable
setPropertyFilePaths in interface Configurablepaths - property file paths.encoding - encodings to use.public void addPropertyFilePath(String path)
Configurable
addPropertyFilePath in interface Configurablepath - a property file path.
public void addPropertyFilePath(String path,
String encoding)
Configurable
addPropertyFilePath in interface Configurablepath - a property file path.encoding - an encoding to use.public void removePropertyFilePath(String path)
Configurable
removePropertyFilePath in interface Configurablepath - the property file path.public boolean containsProperty(String key)
Configurable
containsProperty in interface Configurablekey - the key.
public String getProperty(String key)
Configurable
getProperty in interface Configurablekey - the key.
public Object setProperty(String key,
String value)
Configurable
setProperty in interface Configurablekey - the key.value - the value.
public String[] getProperties(String key)
Configurable
getProperties in interface Configurablekey - the key.
public Object setProperties(String key,
String[] values)
Configurable
setProperties in interface Configurablekey - the key.values - the values.
public Object removeProperty(String key)
Configurable
removeProperty in interface Configurablekey - the key.
public int indexOfProperty(String key,
String value)
Configurable
indexOfProperty in interface Configurablekey - the key.value - the value.
public void addProperty(String key,
String value)
Configurable
addProperty in interface Configurablekey - the key.value - the property.
public void addProperty(int index,
String key,
String value)
Configurable
addProperty in interface Configurableindex - the index.key - the key.value - the value.
public boolean removeProperty(String key,
String value)
Configurable
removeProperty in interface Configurablekey - the key.value - the value.
public void clearProperties()
Configurable
clearProperties in interface Configurablepublic OrderedMap<String,Object> propertyMap()
Configurable
propertyMap in interface Configurablepublic OrderedMap<String,Object> propertyMap(String prefix)
Configurable
propertyMap in interface Configurableprefix - the prefix.
public void storeProperties()
throws IOException
Configurable
storeProperties in interface ConfigurableIOException - on I/O errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||