org.jboss.system.server
Class ServerImpl

java.lang.Object
  extended byorg.jboss.system.server.ServerImpl
All Implemented Interfaces:
NotificationBroadcaster (src) , NotificationEmitter (src) , Server (src)

public class ServerImpl
extends java.lang.Object
implements Server (src) , NotificationEmitter (src)

The main container component of a JBoss server instance.

Concurrency

This class is not thread-safe.


Field Summary
 
Fields inherited from interface org.jboss.system.server.Server (src)
START_NOTIFICATION_TYPE, STOP_NOTIFICATION_TYPE
 
Constructor Summary
ServerImpl()
          No-arg constructor for ServerLoader (src) .
 
Method Summary
 void addNotificationListener(NotificationListener (src)  listener, NotificationFilter (src)  filter, java.lang.Object handback)
          Add a listener to an MBean.
 void exit()
          Shutdown the server, the JVM and run shutdown hooks.
 void exit(int exitcode)
          Shutdown the server, the JVM and run shutdown hooks.
 java.lang.String getBuildDate()
           
 java.lang.String getBuildID()
           
 java.lang.String getBuildJVM()
           
 java.lang.String getBuildNumber()
           
 java.lang.String getBuildOS()
           
 ServerConfig (src) getConfig()
          Get the typed server configuration object which the server has been initalized to use.
 MBeanNotificationInfo (src) [] getNotificationInfo()
          Returns the notification metadata associated with the MBean.
 java.util.Date getStartDate()
           
 java.lang.String getVersion()
           
 java.lang.String getVersionName()
           
 void halt()
          Forcibly terminates the currently running Java virtual machine.
 void halt(int exitcode)
          Forcibly terminates the currently running Java virtual machine.
 void init(java.util.Properties props)
          Initialize the Server instance.
 boolean isStarted()
          Check if the server is started.
 void removeNotificationListener(NotificationListener (src)  listener)
          Removes a listener from an MBean.
 void removeNotificationListener(NotificationListener (src)  listener, NotificationFilter (src)  filter, java.lang.Object handback)
          Removes a listener from the Emitter.
 void runFinalization()
          Hint to the JVM to run any pending object finailizations.
 void runGarbageCollector()
          Hint to the JVM to run the garbage collector.
 void sendNotification(Notification (src)  notification)
           
 void shutdown()
          Shutdown the Server instance and run shutdown hooks.
 void start()
          Start the Server instance.
 void traceInstructions(java.lang.Boolean flag)
          Enable or disable tracing instructions the Runtime level.
 void traceMethodCalls(java.lang.Boolean flag)
          Enable or disable tracing method calls at the Runtime level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerImpl

public ServerImpl()
No-arg constructor for ServerLoader (src) .

Method Detail

init

public void init(java.util.Properties props)
          throws java.lang.IllegalStateException,
                 java.lang.Exception
Initialize the Server instance.

Specified by:
init in interface Server (src)
Parameters:
props - The configuration properties for the server.
Returns:
Typed server configuration object.
Throws:
java.lang.IllegalStateException - Already initialized.
java.lang.Exception - Failed to initialize.

getConfig

public ServerConfig (src)  getConfig()
                       throws java.lang.IllegalStateException
Get the typed server configuration object which the server has been initalized to use.

Specified by:
getConfig in interface Server (src)
Returns:
Typed server configuration object.
Throws:
java.lang.IllegalStateException - Not initialized.

isStarted

public boolean isStarted()
Check if the server is started.

Specified by:
isStarted in interface Server (src)
Returns:
True if the server is started, else false.

start

public void start()
           throws java.lang.IllegalStateException,
                  java.lang.Exception
Start the Server instance.

Specified by:
start in interface Server (src)
Throws:
java.lang.IllegalStateException - Already started or not initialized.
java.lang.Exception - Failed to start.

shutdown

public void shutdown()
              throws java.lang.IllegalStateException
Shutdown the Server instance and run shutdown hooks.

If the exit on shutdown flag is true, then exit(int) is called, else only the shutdown hook is run.

Specified by:
shutdown in interface Server (src)
Throws:
java.lang.IllegalStateException - No started.

exit

public void exit(int exitcode)
Shutdown the server, the JVM and run shutdown hooks.

Specified by:
exit in interface Server (src)
Parameters:
exitcode - The exit code returned to the operating system.

exit

public void exit()
Shutdown the server, the JVM and run shutdown hooks. Exits with code 1.


halt

public void halt(int exitcode)
Forcibly terminates the currently running Java virtual machine.

Specified by:
halt in interface Server (src)
Parameters:
exitcode - The exit code returned to the operating system.

halt

public void halt()
Forcibly terminates the currently running Java virtual machine. Exits with code 1.


runGarbageCollector

public void runGarbageCollector()
Hint to the JVM to run the garbage collector.


runFinalization

public void runFinalization()
Hint to the JVM to run any pending object finailizations.


traceMethodCalls

public void traceMethodCalls(java.lang.Boolean flag)
Enable or disable tracing method calls at the Runtime level.


traceInstructions

public void traceInstructions(java.lang.Boolean flag)
Enable or disable tracing instructions the Runtime level.


getStartDate

public java.util.Date getStartDate()

getVersion

public java.lang.String getVersion()

getVersionName

public java.lang.String getVersionName()

getBuildNumber

public java.lang.String getBuildNumber()

getBuildJVM

public java.lang.String getBuildJVM()

getBuildOS

public java.lang.String getBuildOS()

getBuildID

public java.lang.String getBuildID()

getBuildDate

public java.lang.String getBuildDate()

addNotificationListener

public void addNotificationListener(NotificationListener (src)  listener,
                                    NotificationFilter (src)  filter,
                                    java.lang.Object handback)
Description copied from interface: NotificationBroadcaster (src)
Add a listener to an MBean.

Specified by:
addNotificationListener in interface NotificationBroadcaster (src)
Parameters:
listener - implementation of the listener object
filter - implementation of the filter object or null if no filtering is required
handback - A handback object associated with each notification sent by this notification broadcaster.

removeNotificationListener

public void removeNotificationListener(NotificationListener (src)  listener)
                                throws ListenerNotFoundException (src) 
Description copied from interface: NotificationBroadcaster (src)
Removes a listener from an MBean.

Specified by:
removeNotificationListener in interface NotificationBroadcaster (src)
Parameters:
listener - the listener object to remove
Throws:
ListenerNotFoundException (src) - if the listener was not found

removeNotificationListener

public void removeNotificationListener(NotificationListener (src)  listener,
                                       NotificationFilter (src)  filter,
                                       java.lang.Object handback)
                                throws ListenerNotFoundException (src) 
Description copied from interface: NotificationEmitter (src)
Removes a listener from the Emitter.

Only the listener, filter, handback triplet is removed

Specified by:
removeNotificationListener in interface NotificationEmitter (src)
Parameters:
listener - the listener object to remove
filter - the filter registered with the listener
handback - the handback object associated with the registered listener
Throws:
ListenerNotFoundException (src) - if the listener was not found

getNotificationInfo

public MBeanNotificationInfo (src) [] getNotificationInfo()
Description copied from interface: NotificationBroadcaster (src)
Returns the notification metadata associated with the MBean.

Specified by:
getNotificationInfo in interface NotificationBroadcaster (src)
Returns:
MBean's notification metadata
See Also:
MBeanNotificationInfo (src)

sendNotification

public void sendNotification(Notification (src)  notification)