org.apache.cayenne.remote.service
Class HttpRemoteService

java.lang.Object
  extended by org.apache.cayenne.remote.service.BaseRemoteService
      extended by org.apache.cayenne.remote.service.HttpRemoteService
All Implemented Interfaces:
Remote, RemoteService
Direct Known Subclasses:
HessianService

public abstract class HttpRemoteService
extends BaseRemoteService

A RemoteService implementation that stores server context information in HTTP sessions.

Since:
1.2

Field Summary
 
Fields inherited from class org.apache.cayenne.remote.service.BaseRemoteService
configuration, domain, EVENT_BRIDGE_FACTORY_PROPERTY, eventBridgeFactoryName, eventBridgeParameters
 
Constructor Summary
HttpRemoteService()
           
 
Method Summary
protected  ServerSession createServerSession()
          Creates a new ServerSession with a dedicated DataChannel.
protected  ServerSession createServerSession(String name)
          Creates a new ServerSession based on a shared DataChannel.
protected  ServerSession getServerSession()
          Returns a ServerSession object that represents Cayenne-related state associated with the current session.
protected abstract  javax.servlet.http.HttpSession getSession(boolean create)
          Returns an HttpSession associated with the current request in progress.
protected  DataChannel getSharedChannel(String name)
           
protected  void saveSharedChannel(String name, DataChannel channel)
           
 
Methods inherited from class org.apache.cayenne.remote.service.BaseRemoteService
createChannel, createRemoteSession, destroyService, establishSession, establishSharedSession, getEventBridgeFactoryName, getEventBridgeParameters, getRootChannel, initCayenneStack, initEventBridgeParameters, initService, processMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRemoteService

public HttpRemoteService()
Method Detail

getSession

protected abstract javax.servlet.http.HttpSession getSession(boolean create)
Returns an HttpSession associated with the current request in progress.


getServerSession

protected ServerSession getServerSession()
Returns a ServerSession object that represents Cayenne-related state associated with the current session. If ServerSession hasn't been previously saved, returns null.

Specified by:
getServerSession in class BaseRemoteService

createServerSession

protected ServerSession createServerSession()
Creates a new ServerSession with a dedicated DataChannel. Returned ServerSession is stored in HttpSession for future reuse.

Specified by:
createServerSession in class BaseRemoteService

createServerSession

protected ServerSession createServerSession(String name)
Creates a new ServerSession based on a shared DataChannel. Returned ServerSession is stored in HttpSession for future reuse.

Specified by:
createServerSession in class BaseRemoteService
Parameters:
name - shared session name used to lookup a shared DataChannel.

getSharedChannel

protected DataChannel getSharedChannel(String name)

saveSharedChannel

protected void saveSharedChannel(String name,
                                 DataChannel channel)


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.