Groovy Documentation

org.jdesktop.ws
[Java] Class AbstractHttpService

java.lang.Object
  org.jdesktop.beans.AbstractBean
      org.jdesktop.ws.BaseService
          org.jdesktop.ws.AbstractHttpService

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.

Authors:
Richard


Nested Class Summary
private static class AbstractHttpService.WSSession

This class simply exposes the setState() method such that the AbstractHttpService can manipulate the state to keep it in synch with this class.

 
Field Summary
private AbstractHttpService.WSSession session

The Session object.

private AtomicReference workerRef

The background worker.

 
Fields inherited from class BaseService
eventInProgress, events, listeners, progress, state
 
Constructor Summary
protected AbstractHttpService()

Creates a new AbstractHttpService which is tied to one Session.

 
Method Summary
protected SwingWorker createWorker()

protected void doAbort()

@inheritDoc

protected void doSend()

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 BaseService
abort, addAbortListener, addDoneListener, addFailureListener, doAbort, doSend, done, fail, fireAbort, fireDone, fireFailure, fireOnEDT, getProgress, getState, removeAbortListener, removeDoneListener, removeFailureListener, send, setProgress, setState
 
Methods inherited from class org.jdesktop.beans.AbstractBean
org.jdesktop.beans.AbstractBean#clone(), org.jdesktop.beans.AbstractBean#addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener), org.jdesktop.beans.AbstractBean#addPropertyChangeListener(java.beans.PropertyChangeListener), org.jdesktop.beans.AbstractBean#removePropertyChangeListener(java.beans.PropertyChangeListener), org.jdesktop.beans.AbstractBean#removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener), org.jdesktop.beans.AbstractBean#getPropertyChangeListeners(java.lang.String), org.jdesktop.beans.AbstractBean#getPropertyChangeListeners(), org.jdesktop.beans.AbstractBean#addVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener), org.jdesktop.beans.AbstractBean#addVetoableChangeListener(java.beans.VetoableChangeListener), org.jdesktop.beans.AbstractBean#removeVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener), org.jdesktop.beans.AbstractBean#removeVetoableChangeListener(java.beans.VetoableChangeListener), org.jdesktop.beans.AbstractBean#getVetoableChangeListeners(java.lang.String), org.jdesktop.beans.AbstractBean#getVetoableChangeListeners(), org.jdesktop.beans.AbstractBean#wait(), org.jdesktop.beans.AbstractBean#wait(long), org.jdesktop.beans.AbstractBean#wait(long, int), org.jdesktop.beans.AbstractBean#equals(java.lang.Object), org.jdesktop.beans.AbstractBean#toString(), org.jdesktop.beans.AbstractBean#hashCode(), org.jdesktop.beans.AbstractBean#getClass(), org.jdesktop.beans.AbstractBean#notify(), org.jdesktop.beans.AbstractBean#notifyAll()
 

Field Detail

session

private AbstractHttpService.WSSession session
The Session object. This reference is kept in the AbstractHttpService so as to enable the service to keep in sync with it both in terms of State management and progress.


workerRef

private AtomicReference workerRef
The background worker. It is non null when a background task is running, null otherwise.


 
Constructor Detail

AbstractHttpService

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


 
Method Detail

createWorker

protected SwingWorker createWorker()


doAbort

// mul
protected void doAbort()
inheritDoc:


doSend

} else
protected void doSend()


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:


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.
Parameters:
s


 

Groovy Documentation