org.jdesktop.ws
Class AbstractHttpService

java.lang.Object
  extended by org.jdesktop.beans.AbstractBean
      extended by org.jdesktop.ws.BaseService
          extended by org.jdesktop.ws.AbstractHttpService
Direct Known Subclasses:
HttpService, WebService.Operation

public abstract class AbstractHttpService
extends BaseService

An abstact implementation of an HTTP based service. This BaseService extension provides a Session object to subclasses for working with HTTP based services such as REST or some SOAP operations. This class handles the job of synchronizing state between a Session and the State for this class.


Constructor Summary
protected AbstractHttpService()
          Creates a new AbstractHttpService which is tied to one Session.
 
Method Summary
protected abstract  SwingWorker createWorker()
           
protected  void doAbort()
          Invoked by this AbstractHttpService, this method performs the actual chores behind aborting the asynchronous process.
protected  void doSend()
          Invoked by this AbstractHttpService, this method performs the actual send operation.
protected  Session getSession()
          Gets the session of this AbstractHttpService.
protected  void setState(State s)
          Overridden to ensure that the state of the Session is kept in sync with the state of this AbstractHttpService.
 
Methods inherited from class org.jdesktop.ws.BaseService
abort, addAbortListener, addDoneListener, addFailureListener, done, fail, fireOnEDT, getProgress, getState, removeAbortListener, removeDoneListener, removeFailureListener, send, setProgress
 
Methods inherited from class org.jdesktop.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractHttpService

protected AbstractHttpService()
Creates a new AbstractHttpService which is tied to one Session.

Method Detail

setState

protected void setState(State s)
Overridden to ensure that the state of the Session is kept in sync with the state of this AbstractHttpService.

Overrides:
setState in class BaseService
Parameters:
s -

getSession

protected Session getSession()
Gets the session of this AbstractHttpService. Subclasses may invoke this method when they need to get hold of the session to execute requests, and so forth.

Returns:

createWorker

protected abstract SwingWorker createWorker()

doSend

protected void doSend()
Description copied from class: BaseService
Invoked by this AbstractHttpService, this method performs the actual send operation. This method must not block.

Specified by:
doSend in class BaseService

doAbort

protected void doAbort()
Description copied from class: BaseService
Invoked by this AbstractHttpService, this method performs the actual chores behind aborting the asynchronous process. Do not bother setting the state, just abort the process.

Specified by:
doAbort in class BaseService