org.jboss.web
Class WebService

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.web.WebService
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class WebService
extends ServiceMBeanSupport (src)

The WebService implementation. It configures a WebServer instance to perform dynamic class and resource loading.


Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
WebService()
           
 
Method Summary
 java.net.URL addClassLoader(java.lang.ClassLoader cl)
           
protected  void createService()
          Sub-classes should override this method to provide custum 'create' logic.
 int getBacklog()
          Get the WebService listen queue backlog limit.
 java.lang.String getBindAddress()
          Get the specific address the WebService listens on.
 boolean getDownloadServerClasses()
          A flag indicating if the server should attempt to download classes from thread context class loader when a request arrives that does not have a class loader key prefix.
 java.lang.String getHost()
          Set the name of the interface to use for the host portion of the RMI codebase URL.
protected  ObjectName (src) getObjectName(MBeanServer (src)  server, ObjectName (src)  name)
          Sub-classes should override this method if they only need to set their object name during MBean pre-registration.
 int getPort()
          Get the WebService listening port.
 void removeClassLoader(java.lang.ClassLoader cl)
           
 void setBacklog(int backlog)
          Set the WebService listen queue backlog limit.
 void setBindAddress(java.lang.String host)
          Set the specific address the WebService listens on.
 void setDownloadServerClasses(boolean flag)
           
 void setHost(java.lang.String hostname)
          Get the name of the interface to use for the host portion of the RMI codebase URL.
 void setPort(int port)
          Set the WebService listening port.
 void setThreadPool(BasicThreadPoolMBean (src)  threadPool)
          Set the thread pool used for the WebServer class loading.
protected  void startService()
          Start the web server for dynamic downloading of classes and resources.
protected  void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebService

public WebService()
Method Detail

addClassLoader

public java.net.URL addClassLoader(java.lang.ClassLoader cl)

removeClassLoader

public void removeClassLoader(java.lang.ClassLoader cl)

setPort

public void setPort(int port)
Set the WebService listening port.

Parameters:
port - The listening port; 0 for anonymous

getPort

public int getPort()
Get the WebService listening port.


setHost

public void setHost(java.lang.String hostname)
Get the name of the interface to use for the host portion of the RMI codebase URL.


getHost

public java.lang.String getHost()
Set the name of the interface to use for the host portion of the RMI codebase URL.


getBindAddress

public java.lang.String getBindAddress()
Get the specific address the WebService listens on.

Returns:
the interface name or IP address the WebService binds to.

setBindAddress

public void setBindAddress(java.lang.String host)
                    throws java.net.UnknownHostException
Set the specific address the WebService listens on. This can be used on a multi-homed host for a ServerSocket that will only accept connect requests to one of its addresses.

Parameters:
host - the interface name or IP address to bind. If host is null, connections on any/all local addresses will be allowed.
Throws:
java.net.UnknownHostException

getBacklog

public int getBacklog()
Get the WebService listen queue backlog limit. The maximum queue length for incoming connection indications (a request to connect) is set to the backlog parameter. If a connection indication arrives when the queue is full, the connection is refused.

Returns:
the queue backlog limit.

setBacklog

public void setBacklog(int backlog)
Set the WebService listen queue backlog limit. The maximum queue length for incoming connection indications (a request to connect) is set to the backlog parameter. If a connection indication arrives when the queue is full, the connection is refused.


setThreadPool

public void setThreadPool(BasicThreadPoolMBean (src)  threadPool)
Set the thread pool used for the WebServer class loading.


getDownloadServerClasses

public boolean getDownloadServerClasses()
A flag indicating if the server should attempt to download classes from thread context class loader when a request arrives that does not have a class loader key prefix.


setDownloadServerClasses

public void setDownloadServerClasses(boolean flag)

getObjectName

protected ObjectName (src)  getObjectName(MBeanServer (src)  server,
                                   ObjectName (src)  name)
                            throws MalformedObjectNameException (src) 
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration.

Overrides:
getObjectName in class ServiceMBeanSupport (src)
Throws:
MalformedObjectNameException (src)

createService

protected void createService()
                      throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'create' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
createService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

startService

protected void startService()
                     throws java.lang.Exception
Start the web server for dynamic downloading of classes and resources.

The system java.rmi.server.codebase is also set to http://:/ if the property has not been set.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception