|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.management.NotificationBroadcasterSupport
org.jboss.bootstrap.impl.base.server.AbstractServer<K,T>
public abstract class AbstractServer<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>
AbstractServer Generic support for Server implementations
| Field Summary |
|---|
| Fields inherited from interface org.jboss.bootstrap.spi.server.Server |
|---|
START_NOTIFICATION_TYPE, STOP_NOTIFICATION_TYPE |
| Constructor Summary | |
|---|---|
protected |
AbstractServer(Class<K> actualClass)
Constructor Creates a new Server using an uninitialized, default configuration (which is an instance of the Class specified by getDefaultServerConfigClass() |
protected |
AbstractServer(Class<K> actualClass,
T configuration)
Constructor Creates a new Server, specifying the configuration to be used. |
| Method Summary | |
|---|---|
void |
addBootstrap(org.jboss.bootstrap.spi.Bootstrap<K,T> bootstrap)
|
protected K |
covarientReturn()
Returns this instance as a typed server (as specified by K), throwing a descriptive error message in case the server is not assignable |
protected void |
doInitialize()
Implementation-specific initialization logic; invoked by initialize() |
protected abstract void |
doShutdown()
Implementation-specific shutdown hook |
protected abstract void |
doStart()
Implementation-specific start hook |
protected Class<K> |
getActualClass()
|
org.jboss.bootstrap.spi.config.ConfigurationInitializer<T> |
getConfigInitializer()
|
T |
getConfiguration()
|
protected abstract Class<? extends T> |
getDefaultServerConfigClass()
Obtains the Class used in constructing a new default Server Configuration if one is not supplied to the constructor |
org.jboss.bootstrap.spi.server.ServerInitializer<K,T> |
getServerInitializer()
|
org.jboss.bootstrap.spi.lifecycle.LifecycleState |
getState()
|
org.jboss.bootstrap.spi.config.ConfigurationValidator<T> |
getValidator()
|
void |
initialize()
|
void |
registerEventHandler(org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler handler,
EnumSet<org.jboss.bootstrap.spi.lifecycle.LifecycleState> states)
|
void |
registerEventHandler(org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler handler,
org.jboss.bootstrap.spi.lifecycle.LifecycleState... states)
|
void |
registerEventHandler(org.jboss.bootstrap.spi.lifecycle.LifecycleState state,
org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler handler)
|
void |
registerEventHandlers(org.jboss.bootstrap.spi.lifecycle.LifecycleState state,
org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler... handlers)
|
void |
removeBootstrap(org.jboss.bootstrap.spi.Bootstrap<K,T> bootstrap)
|
protected void |
sendNotificationWithCurrentTimeUserData(String type,
int sequenceNumber)
Sends a JMX Notification with specified type and sequence number, setting user data to the number of milliseconds since the epoch. |
protected void |
sendStartJmxNotification()
Sends the JMX Notification with type signaling the start of the server |
protected void |
sendStopJmxNotification()
Sends the JMX Notification with type signaling the stop of the server |
void |
setConfigInitializer(org.jboss.bootstrap.spi.config.ConfigurationInitializer<T> configInitializer)
|
void |
setConfiguration(T configuration)
|
void |
setServerInitializer(org.jboss.bootstrap.spi.server.ServerInitializer<K,T> serverInitializer)
|
void |
setValidator(org.jboss.bootstrap.spi.config.ConfigurationValidator<T> validator)
|
void |
shutdown()
|
protected void |
shutdownBootstraps()
Shuts down the bootstraps that have been started |
void |
start()
|
protected void |
startBootstraps()
Starts the bootstraps |
boolean |
unregisterEventHandler(org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler handler,
org.jboss.bootstrap.spi.lifecycle.LifecycleState state)
|
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
|---|
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.management.NotificationBroadcaster |
|---|
addNotificationListener, getNotificationInfo, removeNotificationListener |
| Constructor Detail |
|---|
protected AbstractServer(Class<K> actualClass)
throws IllegalArgumentException
getDefaultServerConfigClass()
IllegalArgumentException - If the actual class was not supplied
protected AbstractServer(Class<K> actualClass,
T configuration)
throws IllegalArgumentException
configuration - The configuration to set. If null a new default
configuration will be made (which is an instance of the Class specified by
getDefaultServerConfigClass()
IllegalArgumentException - If the configuration or actual class has not been supplied| Method Detail |
|---|
public T getConfiguration()
getConfiguration in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>public void setConfiguration(T configuration)
setConfiguration in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>public final org.jboss.bootstrap.spi.lifecycle.LifecycleState getState()
getState in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>
public void shutdown()
throws IllegalStateException,
Exception
shutdown in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalStateException
Exception
public void start()
throws IllegalStateException,
Exception
start in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalStateException
Exception
public void addBootstrap(org.jboss.bootstrap.spi.Bootstrap<K,T> bootstrap)
throws IllegalStateException,
IllegalArgumentException
addBootstrap in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalStateException
IllegalArgumentException
public void removeBootstrap(org.jboss.bootstrap.spi.Bootstrap<K,T> bootstrap)
throws IllegalStateException,
IllegalArgumentException
removeBootstrap in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalStateException
IllegalArgumentExceptionpublic org.jboss.bootstrap.spi.config.ConfigurationValidator<T> getValidator()
getValidator in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>
public final void initialize()
throws IllegalStateException,
org.jboss.bootstrap.spi.config.InvalidConfigurationException,
org.jboss.bootstrap.spi.lifecycle.LifecycleEventException
initialize in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalStateException
org.jboss.bootstrap.spi.config.InvalidConfigurationException
org.jboss.bootstrap.spi.lifecycle.LifecycleEventException
protected void doInitialize()
throws IllegalStateException,
org.jboss.bootstrap.spi.config.InvalidConfigurationException,
org.jboss.bootstrap.spi.lifecycle.LifecycleEventException
initialize()
IllegalStateException
org.jboss.bootstrap.spi.config.InvalidConfigurationException
org.jboss.bootstrap.spi.lifecycle.LifecycleEventExceptionpublic final org.jboss.bootstrap.spi.server.ServerInitializer<K,T> getServerInitializer()
getServerInitializer in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>
public final void setServerInitializer(org.jboss.bootstrap.spi.server.ServerInitializer<K,T> serverInitializer)
throws IllegalStateException
setServerInitializer in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalStateExceptionpublic final org.jboss.bootstrap.spi.config.ConfigurationInitializer<T> getConfigInitializer()
getConfigInitializer in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>public final void setConfigInitializer(org.jboss.bootstrap.spi.config.ConfigurationInitializer<T> configInitializer)
setConfigInitializer in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>public final void setValidator(org.jboss.bootstrap.spi.config.ConfigurationValidator<T> validator)
setValidator in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>
public void registerEventHandler(org.jboss.bootstrap.spi.lifecycle.LifecycleState state,
org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler handler)
throws IllegalArgumentException
registerEventHandler in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalArgumentException
public void registerEventHandler(org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler handler,
EnumSet<org.jboss.bootstrap.spi.lifecycle.LifecycleState> states)
throws IllegalArgumentException
registerEventHandler in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalArgumentException
public void registerEventHandler(org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler handler,
org.jboss.bootstrap.spi.lifecycle.LifecycleState... states)
throws IllegalArgumentException
registerEventHandler in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalArgumentException
public void registerEventHandlers(org.jboss.bootstrap.spi.lifecycle.LifecycleState state,
org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler... handlers)
throws IllegalArgumentException
registerEventHandlers in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalArgumentException
public boolean unregisterEventHandler(org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler handler,
org.jboss.bootstrap.spi.lifecycle.LifecycleState state)
throws IllegalArgumentException
unregisterEventHandler in interface org.jboss.bootstrap.spi.server.Server<K extends org.jboss.bootstrap.spi.server.Server<K,T>,T extends org.jboss.bootstrap.spi.config.ServerConfig<T>>IllegalArgumentException
protected abstract void doStart()
throws Exception
Exception
protected abstract void doShutdown()
throws Exception
Exceptionprotected abstract Class<? extends T> getDefaultServerConfigClass()
protected void sendStartJmxNotification()
protected void sendStopJmxNotification()
protected final void sendNotificationWithCurrentTimeUserData(String type,
int sequenceNumber)
type - sequenceNumber -
protected void startBootstraps()
throws Exception
Exceptionprotected void shutdownBootstraps()
protected final K covarientReturn()
protected final Class<K> getActualClass()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||